Custom Calculation
Custom calculation involves calling a custom business service to calculate the points and return a value. The custom business service can use data, by means of custom look-up tables outside of Siebel Loyalty, to calculate base points. This option is relevant when the base point calculation involves complex mathematical operations involving data stored outside of Siebel Loyalty.
Example of Custom Calculation
For example, VoiceMobile loyalty program rewards members with base points based on the following criteria:
One point for each dollar billed on Local calls
Two points for each dollar billed on Long distance calls
Four points for each dollar billed on VAS to the members.
A member of VoiceMobile loyalty program, has:
$100 bill amount on local calls
$250 on Long distance calls
$75 on VAS
This member is rewarded (100 plus 500 plus 300) 900 base points.
These base points can then be used as a basis for rewarding bonus and incentives. The base points are available for all the promotions.
For example, VoiceMobile loyalty program rewards 25% of base points as bonus to members in Gold tier. This member, who is a Gold member, earns 175 points as bonus (that is, 900 times 0.25 equals 175 points).
Code Example for Custom Calculation
The value used in the custom calculation is sourced from the custom attribute defined in Program Level Attributes view. This custom attribute calls a custom function to derive this value. This function must be written as part of the LOY Customer Action Business Service.
The following example of the code for a custom function shows how to read Input parameters and return output arguments.
function GetValuesCustomAttribute(inputs, outputs)
{
try{
// All the field values would be in the format Object.Field.Field Name. All the
// values would be passed to custom attributes.
// Using transaction Id and querying transaction BC must be avoided because in
// simulation mode the attributes passed in transaction are passed to simulation.
// Always use the values from the Transaction.Field.Field Name.
var strOrgAirPort = inputs.GetProperty ("Transaction.Field.Origination Airport");
var strDestAirPort = inputs.GetProperty ("Transaction.Field.Destination Airport");
var customCoeff = inputs.GetProperty ("Transaction.Field.Custom Coeff Factor");
var points = 0;
if(strOrgAirPort == "SFO" &&strDestAirPort ="BOS")
points = 200 * customCoeff ;
outputs.SetProperty("Field Value",points);
}
catch(e)
{
TheApplication().RaiseErrorText(e.toString());
}
finally
{
}
}