Using Invoke Custom Action
You can define your own custom actions for promotions. Supported custom actions include:
CancelTxnAttributes
SetLoanBalance
DebitVoucher
CancelRedmptionVoucher
ReIssueVoucher
PurchasePoints
TransferPoints
LoungePurchase
RenewMembership
To create an action of the type Invoke Custom Action, you must create a method that performs the custom action. The method must be implemented on the LOY Customer Action Business Service. The arguments in the following table are passed in to the method. Some of these arguments might not be present, depending on the processing context.
Argument | Context Where It Is Specified |
---|---|
Member Id |
Always |
Transaction Id |
Only for Rules that apply to transactions |
Bucket Id |
Only for rules that apply to attributes and for rules that apply to transactions that a promotion bucket has been created for |
Promotion Id |
Always |
Promotion Rule Id |
Always |
Tier Id |
Only for tier promotions |
Example of Using Invoke Custom Action
This topic gives one example of how to create a method and use it in Invoke Custom Action. You might use this feature differently, depending on your business model.
An airline wants to calculate the redemption price for flights dynamically. This price varies depending upon the load factor of each flight, information that is outside Siebel Loyalty.
The example creates a custom attribute in Siebel Loyalty, with a method that retrieves the load factor data from outside, uses this data to modify the transaction attribute and returns the value to Loyalty. This attribute can be used in Loyalty promotion criteria and actions. It is used to calculate the final redemption price at the time the transaction is processed.
To implement this functionality, perform the following steps:
Write a Siebel eScript in the LOY Customer Action Business Service. The sample eScript follows:
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if (MethodName == "GetValue") { var ActiveBO = TheApplication().GetBusObject("LOY Transaction"); var myBusComp = ActiveBO.GetBusComp("LOY Transaction"); var txnId = ""; txnId = Inputs.GetProperty("Transaction Id"); myBusComp.ClearToQuery(); myBusComp.SetSearchSpec("Id", txnId); myBusComp.ExecuteQuery(ForwardBackward); var points = 0; points = myBusComp.GetFieldValue("Load Factor"); points = points * 1000; Outputs.SetProperty("Field Value",points); return (CancelOperation); } }
Compile the eScript.
In the Loyalty Program Administration, Programs, Program Level Attributes, Custom Attributes view, create a new custom attribute named Load Factor of type integer.
Give the method the name GetValue.
Use this custom attribute in a promotion’s action. In the Loyalty Promotions Administration, Promotion, Rules, Actions view, in the Assign Points form, select Custom as the Object and GetValue as the Attribute.