...
When a message is received from FMAudit the system considers if it would be appropriate to create a new machine part. For example should the system add a new machine part for a toner because FMAudit has sent information about a new toner.
Step 1: Try to find the matching product for the part (toner) based on the contents of the supply name field on the FMAudit message.
This step in the matching process is driven by the text in the supply name field on the FMAudit message. To investigate any issues, you need to know how to find and read the message to determine what text is in the supply name field. The matching procedure is as follows:
If the message received includes a supply name field that is not empty.
if (!string.IsNullOrEmpty(supply.SupplyName))
{
productCriteria = CriteriaOperator.Parse("ProductID = ? && Status != ?", supply.SupplyName, ProductStatus.Archived);
product = unitOfWork.FindObject<Product>(productCriteria);
if (product == null)
{
productCriteria = CriteriaOperator.Parse("Model = ? && Status != ?", supply.SupplyName, ProductStatus.Archived);
product = unitOfWork.FindObject<Product>(productCriteria);
}
if (product == null)
{
productCriteria = CriteriaOperator.Parse("AlternateProductIDs[ID = ?].Exists && Status != ?", supply.SupplyName, ProductStatus.Archived);
product = unitOfWork.FindObject<Product>(productCriteria);
}
}
if (!string.IsNullOrEmpty(supply.OEMPartNo))
{
if (product == null)
{
productCriteria = CriteriaOperator.Parse("ProductID = ? && Status != ?", supply.OEMPartNo, ProductStatus.Archived);
product = unitOfWork.FindObject<Product>(productCriteria);
}
if (product == null)
{
productCriteria = CriteriaOperator.Parse("Model = ? && Status != ?", supply.OEMPartNo, ProductStatus.Archived);
product = unitOfWork.FindObject<Product>(productCriteria);
}
if (product == null)
{
productCriteria = CriteriaOperator.Parse("AlternateProductIDs[ID = ?].Exists && Status != ?", supply.OEMPartNo, ProductStatus.Archived);
product = unitOfWork.FindObject<Product>(productCriteria);
}
}First see if you can find a qualifying product.
If there is a product that has the same productid as the supply name and that does not have a status of archived, set the part to be used to be used to be that product
Otherwise
If the step/s above did not set a product to be used for the part. Then if there is a product that has the same model as the supply name and that does not have a status of archived, use that product
Otherwise
If the step/s above did not set a product to be used for the part. Then if there is a product that has an alternate product id that is the same as the supply name and that does not have a status of archived, use that product
Step 2: Optional, if the steps above have not found a product for the part. Then try to find the matching product for the part (toner) based on the contents of the OEMPartNo field on the FMAudit message.
This step in the matching process is driven by the text in the OEMPartNo field on the FMAudit message. To investigate any issues, you need to know how to find and read the message to determine what text is in the OEMPartNo field. If the first step shown above has already found a match. This second step will be skipped. Otherwise if we could not match a product based on the supply name. The matching procedure is as follows using the OEMPartNo if it is filled in:
If the step/s above did not set a product to be used for the part. If the OEMPartNo on the FMAudit message is not empty.
If there is a product that has the same productid as the OEMPartNo and that does not have a status of archived, set the part to be used to be used to be that product
Otherwise
If the step/s above did not set a product to be used for the part. Then if there is a product that has the same model as the OEMPartNo and that does not have a status of archived, use that product
Otherwise
If the step/s above did not set a product to be used for the part. Then if there is a product that has an alternate product id that is the same as the OEMPartNo and that does not have a status of archived, use that product
If the FMAudit messages are not matching to products as you expect. Then look at the content of the supply name and OEMPartNo fields on a FMAudit message. Then trace the matching process through the logic above. You should be able to identify why the system picked the product it did to be used for the new machine part, if any.