Академический Документы
Профессиональный Документы
Культура Документы
Cookbook on how to create a simple Business Rule Composite in Oracle SOA Suite
Drag Business Rule in the composite.xml, enter Name and Package and click + Input
You dont want to have copies of shared xsds (xsds used by multiple composites and/or systems) scattered around in multiple projects. Only xsds which are only used within a composite are stored within a composite project.
Click + Output
Finally Select OK
Open composite
Drag a Mediator to the Components lane, enter Name and select Synchronous Interface
Always use a Mediator to expose to the outside world! It offers routing and mapping flexibility for future changes.
Select as Input same type as Business Rule Engine, so first import types
Same applies for output type. Make sure Create Composite Service with SOAP Bindings is checked
Press OK
Drag the arrow of the Mediator to the Rule Engine to wire execute method to callFunctionStateless method
In the mapper on the right side expand node parameterList, right click on NOM-details and select Add XSL Node > copy-of
Select Replace the selected Node with the results of the copy-of
In the mapper on the right click, rightclick on attribute name and select Set Text > Enter Text
Enter text NominationRulesService (name of the service in the business rule engine)
Save all, close mapper, open mediator again and create reply mapping
Save all, close mapper and mediator and open NominationRules by double click in the composite
Click on + to create a function and enter Name, select void as Return Type and enter a meaningful Description
Click on <insert action> in the Body part and create the following code:
assert new TVALAnswer( <edit properties> )
Click on <edit properties> and select null and true as constant values
The same for new function validateNOK with null and false as constant values
Dont worry, were gonna fill the error part later on.
Navigate back to DecisionTable NomStatus in Ruleset1, click on <insert action> and select Call
Test this basic setup by deploying the composite and using soapUI.
Select subtab Java Facts (bottom screen), press + button, browse and search for java.util.ArrayList
Add two arguments of type String with the + button of the Arguments section and name them code and message
With right click next to statement you can delete, insert new statements, etc
In decision table create two more rules and split up R2 into separate values and enter their arguments for A2
If you, by accident provide arguments, for unused A2 call, you can not delete them! Run time this doesnt matter, but you can set them to null value for readability.
Select tab Globals and with + button create variable MaxNomAmount of type int, value 10000 and check both Constant and Final
Select tab Bucketsets and with + button create new bucketset of type List of Ranges
Edit this new bucketset by selecting it and the pencil button (or double click on bucketset icon) and first provide a decent name
Use the + button to create 0 value endpoint and again to create Endpoint of Global value MaxNomAmount. Uncheck checkbox Included Endpoint, so MaxNomAmount will be allowed.
Create two rules for status INITIAL with < 0 and > MaxNomAmount buckets, assign validateNOK and provide decent arguments