I am missing some aspect of Ruleset processing. I am probably doing something wrong. Anyway, here goes.
I have object OrderDetail, and below is the Ruleset for create/modify for it. The objective is to setup some of the key values once a user selects the product for the new line. In other words, they click "Add New" and see a blank line with a combo box from which to choose the Product.
I am not getting what I expect. The fundamental undesired behavior I see is that it fails to recognize the objects from the FIND requests, which I know were successful. The attrbute assignments from the FIND results do not occur, and any values tested in IF statements are not resolved, so it skips the THEN part. I pasted exerpts from the Aware IM Server log below to show this. I have the whole sequence and will provide it if needed. It is a few pages long...
...Executing action FIND Person WHERE Person=OrderDetail.OrderCustomer.Person from rules of object OrderDetail
2011-07-26 17:47:20,336 L3WBCHEM01#Roy -33 Found 1 objects
...Executing action FIND Person WHERE Person=OrderDetail.OrderCustomer.Person from rules of object OrderDetail
2011-07-26 17:47:20,336 L3WBCHEM01#Roy -33 Found 1 objects
...Executing action FIND Discount WHERE OrderDetail.OrderCustomer.Person.PersonCategory IN Discount.PersonCategories AND OrderDetail.Product.ProductCategory IN Discount.ProductCategories TAKE BEST 1 from rules of object OrderDetail
2011-07-26 17:47:20,341 L3WBCHEM01#Roy -33 Found 1 objects
The engine executes each of these twice with the same outcome (found).
The activity I describe here was initiated using the "Add New" button from a form where OrderDetails, a collection of OrderDetail objects belonging to
OrderCustomer.
NOTE: This is not a Process. Input objects is not the problem here.
Ruleset:
Name/Rule
FindPerson -- FIND Person WHERE Person=OrderDetail.OrderCustomer.Person
AssignProductValues -- FIND Product WHERE Product=OrderDetail.Product
AssignTaxable -- OrderDetail.Taxable=Product.Taxable
AssignProductType -- OrderDetail.Type=Product.Type
FindDiscount -- FIND Discount WHERE (OrderDetail.OrderCustomer.Person.PersonCategory IN Discount.PersonCategories AND OrderDetail.Product.ProductCategory IN Discount.ProductCategories) TAKE BEST 1
DeterminePctDiscount -- IF Discount.DiscountType='%' THEN OrderDetail.DiscountAmt=ROUND(Product.Price * 0.01*Discount.DiscountAmt,2)
DetermienDolDiscount -- IF Discount.DiscountType='$' THEN OrderDetail.DiscountAmt=Discount.DiscountAmt
AssignPrice -- OrderDetail.Price=OrderDetail.Product.Price-OrderDetail.DiscountAmt
CalculateExtension -- OrderDetail.ExtPrice=OrderDetail.Quantity * OrderDetail.Price
Clearly the Configuration Tool is anticipating the following complaints when I go to save the Ruleset...
Possibly wrong object identifier Product is used in path Product.Type in rule AssignProductType
Possibly wrong object identifier Discount is used in path Discount.DiscountAmt in rule DetermienDolDiscount
Possibly wrong object identifier Product is used in path Product.Taxable in rule AssignProductTaxable
Possibly wrong object identifier Discount is used in path Discount.DiscountType in rule DetermienDolDiscount
Possibly wrong object identifier Discount is used in path Discount.DiscountAmt in rule DeterminePctDiscount
Possibly wrong object identifier Discount is used in path Discount.DiscountType in rule DeterminePctDiscount
Possibly wrong object identifier Product is used in path Product.Price in rule DeterminePctDiscount
Of course, it looked OK to me, so I saved and ran it.
The engine seemed to scramble a bit processing this, repeating the FINDs many times, so I added Priority to make sure FIND's were completed before it started evaluating the other attributes. That seemed to shorten the execution path, but it did not resolve my problem.
Any help is welcome!