You can add business rules from IBM® Operational Decision Manager to the steps of the workflow
definition for a task, and then modify the business rules without
modifying the workflow definition.
Before you begin
Before you can add business rules from
IBM Operational Decision Manager to a solution, you must
install and configure
IBM Operational Decision Manager to
use web services to generate a Web Service Definition Language (WSDL)
file that describes the interface for invoking the business rule.
Before
you add a business rule to a solution, review the rule and verify
that the rule was deployed in IBM Operational Decision Manager.
About this task
A business rule captures and implements business policies
and practices, such as enforcing a business policy or making a decision
that is based on specific data. For example, a business rule can update
a particular case property to indicate that a fraud investigation
task is required if an automobile insurance claim is filed by the
driver of a sports car.
You can use rules software, such as IBM Operational Decision Manager, to separate the business
rules from the process, which makes it easier for a business analyst
to independently manage the process and the rules for the process,
rather than modifying a workflow definition.
Procedure
To add business rules from IBM Operational Decision Manager to a solution:
- Open the solution in Case Manager Builder and add case properties,
case types, tasks, steps, and roles as necessary. Include
properties that can be parameters for the Operational Decision Manager rule in this solution.
For example, an automobile insurance claims solution might have case
properties that include Vehicle Year (integer), Vehicle Make (string),
Policy Number (string), Claimant Age (integer), and Potential Fraud
(Boolean).
- Deploy and test the solution.
- In the Operational Decision Manager Rule
Execution Server console, select the ruleset that contains the rules
that are related to your solution to verify that the rules are deployed
in Operational Decision Manager.
- Obtain the URL for the Web Service Definition Language
(WSDL) file.
- In the Rule Execution Server console, click Explorer and
click the RuleApp that contains your ruleset.
- In the RuleApp view, click the
ruleset and click Retrieve HTDS Description File.
- Select the Latest ruleset version and Latest
RuleApp version options.
- Click View to open the file in
a web browser.
- Copy the URL from the address bar of the browser and
paste it into a text document so that you can refer to the URL in
the next step. For example, the URL might be http://localhost:9082/DecisionService/ws/AutomobileFraudCheckRuleApp/1.0/AutomobileFraudCheck/1.0?WSDL
- Define the partner link to the web service. A
partner link consists of a name and the WSDL URL for Invoke functions.
- Open the solution in Process Designer. On the Manage
Solutions page in Case Manager Builder,
click Open Process Designer from
the More Actions option for your solution.
- Select a case type and a task.
- Click .
- Specify a name for the partner link.
- Select Invoke and paste the WSDL
URL into the WSDL URL field.
- Click the Browse icon (...),
which populates the available port types and select the port type
from the menu.
- Add the following parameters to the workflow definition
on the tab in Process Designer.
- ODMDecisionID
- String
- ODMOutput
- String
- ODMRulesCount
- Integer
The parameters are specific to Operational Decision Manager and therefore are not
included in your solution.
- Complete this step for business rules that you created
in Case Manager Builder and exported
to Operational Decision Manager, and any other
rules that use a case object to represent the set of case properties
in a single object:
Create an XML data field to store
the execution results that are returned from the IBM Operational Decision Manager web services. In Process Designer, click and add a field
with the name ODMOutputXML.
- Create a system step to implement the rules:
- Add a system step to your solution workflow in Process Designer. You might
have created a stub step for this purpose in Case Manager Builder.
- Connect the final workflow step to the new system step.
- Specify a name for the step.
- Select the Invoke function from
the Available Functions list and move it to
the Selected Functions list.
- In the Selected Functions list,
double-click Invoke.
- Click Messages. Then, select
the partner link and the operation. The incoming and outgoing
parameters are automatically populated with the Operational Decision Manager rules parameters
- Define the outgoing and incoming values.
- For typical business rules that you created in Operational Decision Manager:
- In the Outgoing Parameters list, select
the matching case property for each parameter from the Expression menu.
- In the Incoming Parameters list, select
the matching data field for each parameter from the Field
Name menu. You created the data fields in a previous step.
You can also use a field assignment to assign values.
- For business rules that you created in Case Manager Builder and exported to Operational Decision Manager, and any other rules that
use a case object to represent the set of case properties in a single
object:
- For the Message Type option, select XML.
- In the Outgoing Message field, replace
the place holder values in the <caseObject> XML element with expressions
that represent the case properties and data fields that are mapped
to custom rule parameters. Use the format F_CaseFolder.attribute_name.
For example, change the value "<Creator>" + "Creator" +"</Creator>" to "<Creator>"
+ F_CaseFolder.Creator +"</Creator>". For the CmAcmCaseState
property, set the value to <CmAcmCaseState>"+ "Working"
+"</CmAcmCaseState>.
Tip: All parameter values
in the <caseObject> XML element must be strings. To avoid validation
errors, use Expression builder to change time and date values to timetostring
functions and numbertostring functions.
- In the Incoming XML Data Field field, specify ODMOutputXML.
- Select the Assign function from the Available
Functions list and move it to the Selected
Functions list.
- In the Selected Functions list, double-click Assign to
view the assignment parameters that correspond to case properties
and data fields that are mapped to custom rule parameters.
- For the ODMOutputXML parameter, specify the following expression:
substitute(ODMOutputXML,
"xsi:type=""ns0:caseType""", "")
- For each case property or data field whose value is set by the
business rule, specify an XPath expression that returns the corresponding
value from the ODMOutputXML data field. For example, specify the following
XPath expression to the value of a case property:
xmlstringexpr(ODMOutputXML,
"/", "/*[local-name()=""CSR1_CT1_RuleName""]/*[local-name()=""caseObject""]/*[local-name()=""caseObject""]/*[local-name()=""F_CaseFolder.CSR1_StringProperty""]")
- Validate, transfer, and check the workflow.
- In Case Manager Builder,
click Manage Solutions and deploy the solution
to the development environment for testing.