DivertRule: OnEvaluate

Invoked when the rule has to be evaluated

Note: This event does not support multiple subscription. Previous subscription will be lost if subscribe twice.

Event

boolean xxxxxxxxxxxxxxxxx(sender: object, product: Product, invoker: object);

Return Value

Returning true from this function causes the divert rule object to instruct the invoker to divert, false has the opposite affect

Parameters

Name Type Description
sender Object The object associated with the changed property
product Product The product associated with the evaluation decision
invoker Object The component that called Evaluate on the rule (e.g. CBS)

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;
}