OnEvaluate
Invoked when the rule has to be evaluated
Note: This events does not support multiple subscription. Previous subscription will be lost if subscribe twice.
Callback Signature
boolean xxxxxxxxxxxxxxxxx(sender: object, product: Product, invoker: object);
Name | Type | Description |
sender | Object | The object associated with the changed property (e.g. divert rule) |
product | Product | The product associated with the evaluation decision |
invoker | Object | The component that called Evaluate on the rule (e.g. CBS) |
Return Value: Returning true from this function causes the divert rule object to instruct the invoker to divert, false has the opposite affect
Example
SubscribeToEvent("OnEvaluate", "EDSd4", "Divert Rule", "DivertToEDS"); ... function DivertToEDS(sender, product, invoker) { var iDest = product.DestinationData[product.DestinationData.length-1]; if (iDest == 800 && product.Identified) return true; return false; }