Validate_arc_spec.mp > process_tkts > Reformat01
Use a Corticon decision service to transform/reformat input data to output data by applying business rules.
This applies to the Fare Amount, Tax Amount, Commission Amount, Document Amount, Quarterly Surcharge, Yearly Surcharge, Supplemental Fare Amount and Net Fare Amount, Penalty Fee Amount.
Currency Type Flag
Set the flag to 1 if any of the Amount columns have a valid numeric value.
Generalizing the Amount Rules to handle all amount fields (without duplicating the rule sheets
Once all the amount attributes are added, the vocabulary looks like this:
It defines the inputs, outputs and any temporary attributes:
In order to avoid having to copy the amount rule sheet for each different attribute we can make use of Corticon’s ability to write rules about collections.
So we can convert the nine (or any number of ) separate amount fields into instances of an Amount collection (using name value pairs)
The vocab for this would look like:
And this would be attached to the Transaction using a one to many association:
Then we can create instances of AMOUNT using these expressions:
The rule flow for this part might look like:
Now we can us a generic rule sheet to process any instance of AMOUNT with the same rules:
After the rule sheet has processed all the AMOUNTs we can map the output back into the separate transaction fields for return to the calling application:
So now a full test case might look like this:
And if desired the rules that applied to any individual amount can be inspected:
There are two versions of the decision service:
NOTE: the rules that access the lookup tables are the same in both cases
Transaction SOAP Request
Create a new SOAP UI Project and import the WSDL
SOAP Request in SOAP UI
Export the Corticon request from the tester
Make sure you have the following property set to JSON in your brms.properties:
It will look like this
This can be used in SOAP UI to invoke Corticon using REST
Make sure to create a header with dsname = decision service name
This can be added to control how Corticon executes:
Need information from ARC for this section
Download PDF version.