Cookbook Oracle SOA Business Rules
Upcoming SlideShare
Loading in...5

Cookbook Oracle SOA Business Rules



How to create a simple decision table in Oracle SOA Suite 11g

How to create a simple decision table in Oracle SOA Suite 11g



Total Views
Views on SlideShare
Embed Views



8 Embeds 2,131 2092 32 2 1 1 1 1 1


Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • To fill the error list we need to import an implementation of a List, for example java.util.ArrayList

Cookbook Oracle SOA Business Rules Cookbook Oracle SOA Business Rules Presentation Transcript

  • Business Rules CompositeCookbook on how to create a simple Business Rule Composite in Oracle SOA Suite
  • Create New SOA Project
  • Enter Project Name and Directory
  • Begin with Empty Composite (or Composite With Business Rule)
  • Drag Business Rule in thecomposite.xml, enter Name and Package and click + Input…
  • Define Input Message by importing types from MDS
  • Do not ‘Copy to Project’ !You don’t want to have copies of shared xsd’s (xsd’s used bymultiple composites and/or systems) scattered around in multipleprojects. Only xsd’s which are only used within a composite arestored within a composite project.
  • Select Input Type
  • Click + Output…
  • Define Output Message by importing types from MDS
  • Again do not ‘Copy to Project’ !
  • Select Output Type
  • Select tab Advanced to enter a nice Service Name
  • Finally Select OK
  • Open composite
  • Drag a Mediator to the Components lane, enter Name and select Synchronous InterfaceAlways use a Mediator to expose to the outside world! It offers routing andmapping flexibility for future changes.
  • Select as Input same type as Business Rule Engine, so first import types
  • Again do not ‘Copy to Project’ !
  • Select same Input Type
  • Same applies for output type.Make sure “Create Composite Service with SOAP Bindings” is checked
  • Press OK
  • Drag the arrow of the Mediator to theRule Engine to wire execute method to callFunctionStateless method
  • Double click on Mediator and click on button to create a mapping
  • Provide meaningfull name for the new Mapper file
  • 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”
  • Drag the NOM-details on the left side to the copy-of
  • In the mapper on the right click, right-click 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
  • Copy in the same way VAL-answerfrom resultList to Val-answer target
  • Save all, close mapper and mediatorand open NominationRules by double click in the composite
  • Select Ruleset1 and Create Decision Table
  • Click on the table name to enter a meaningful name
  • Click on <insert condition>
  • Double click on C1 <edit condition> and select TNOMDetails.status
  • Click on ? below R1 and select INITIAL
  • Click on button Gap Analysis…
  • Select the checkbox to fill the gap
  • Click on tab Functions
  • Click on + to create a function andenter Name, select void as Return Type and enter a meaningful Description
  • Click on <insert action> in the Bodypart 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 valuesDon’t worry, we’re gonna fill the error part later on.
  • Navigate back to DecisionTableNomStatus in Ruleset1, click on <insert action> and select Call
  • Double click on ‘A1 call(’ and select function validateOK
  • Click on + and select Action > Call
  • Select validateNOK for A2, select A1 as action for R1 and A2 for R2
  • Test this basic setup by deploying the composite and using soapUI.Retrieve WSDL url from Test tab in Enterprise Manager.
  • Create new Project in soapUI with WSDL url
  • Fill request with test data and invoke
  • Nominaton status value ‘initial’ results to true as nomination response
  • Open NominationRules again and select the Facts tab
  • Select subtab Java Facts (bottomscreen), press + button, browse and search for java.util.ArrayList
  • Select! (checkbox) and press OK
  • Select tab Functions and selectvalidateNOK function to change it
  • Add two arguments of type String withthe + button of the Arguments section and name them code and message
  • With right click next to statement youcan delete, insert new statements, etc
  • Create code for function validateNOK:
  • Select Ruleset1 and double click onaction A2 to edit argument settings
  • Check Parameterized checkbox for both arguments and press OK
  • Fill arguments for R2 with code “001” message “Invalid Nomination”
  • Deploy and assert arguments are returned in output
  • In decision table create two more rules and split up R2 into separate values and enter their arguments for A2If you, by accident provide arguments, for unused A2 call, you can not delete them! Runtime this doesn’t matter, but you can set them to null value for readability.
  • Deploy and test again
  • Select tab Globals and with + buttoncreate variable MaxNomAmount oftype int, value 10000 and check bothConstant 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 valueendpoint and again to create Endpoint of Global value MaxNomAmount.Uncheck checkbox Included Endpoint, so MaxNomAmount will be allowed.
  • Press OK to save the bucketset
  • Select Ruleset1 again and add condition with + button
  • Double click on C2 and select TNOMDetails.totalAmount
  • Select C2 and assignNominationAmountBuckets to it
  • Set [0..MaxNomAmount] as value for R1 with status INITIAL and OK result
  • Enter - , a dash, as value for R2-R4 meaning ‘otherwise’
  • Create two rules for status INITIAL with < 0 and > MaxNomAmount buckets, assign validateNOK and provide decent arguments
  • Deploy and test your end result