Modern software-systems design emphasizes the use of business rules management systems (BRMS) for managing the complex business and decision logic. This enables you to better manage the demand to swiftly change business rules. You can improve the agility of your business processes, providing options for better decision-making and overall maintenance of your software systems. Business process management system (BPMS) can directly leverage the features BRMS solutions provide. See Resources for more information about business-focused joint value propositions for BPM and BRMS.
This article describes the steps required to integrate two industry-leading software systems:
- IBM FileNet P8 Business Process Manager
- Manages workflow among people and systems for content and human-intensive processes.
- IBM WebSphere ILOG JRules
- Helps organizations to swiftly change business decisions by allowing real-time modifications to their business rules.
There are multiple ways the two products can be integrated:
- Rules connectivity framework
- Java™ component integration
- Web services
This article focuses on a loosely coupled integration between the two products using web services.
Understanding the prerequisites
This article requires the following minimum configuration:
- IBM FileNet P8 Platform Version 4.5 or above with Content Engine, Process Engine, and Application Engine installed
- IBM WebSphere ILOG JRules Version 7.0 or above with Rule Studio and Rule Execution Server installed
The following will also be helpful:
- Familiarity with Eclipse
- Basic level experience using IBM FileNet P8 Process Designer
In this article, IBM FileNet P8, Version 4.5.1, integrates with IBM WebSphere ILOG JRules, Version 7.0.2.
Exploring a use case for health insurance underwriting
The first example scenario describes part of an insurance underwriting process that leverages BRMS for straight-through processing. The BRMS handles the tasks that can be automated, including checking the bmi, calculating the health rating, and calculating the customer's premium. The combination of Filenet and BRMS provides process orchestration and automated decision-making, which enables automation of the enrollment of minimum-risk applications. Human underwriters then process only the complicated applications using human tasks in Filenet.
The underwriting process workflow for the example scenario consists of a system step that invokes a decision service for straight-through processing to keep the scenario simple and focus on the technical integration scenario with BRMS. In underwriting processes, some of the major steps, including validating the client input, calculating the clients health rating, and calculating the insurance premium, could be separate process activity steps in Filenet invoking separate decisions.
The decision service for automated-underwriting is implemented using rules in JRules. There are two human tasks that are conditionally routed. If the decision service rejects the policy request (returns false), the workflow is routed to human underwriters for evaluation. The email notification can be automated, but to simplify the implementation, it is designed as a human task in the example scenario. Figure 1 shows this process workflow.
Figure 1. Health insurance use case diagram
Designing the business rules
WebSphere ILOG JRules Rule Studio is an Eclipse plug-in used to build rule projects. To create a new rule, complete the following steps:
- Select Program Files > IBM WebSphere ILOG JRules V7.0.2 > Rule Studio to open the Rule Studio.
- Click File > New > Rule Project, as shown in Figure 2.
Figure 2. Create a new rule project using Rule Studio
- Select Standard Rule Project, and enter an appropriate name for the project.
- Accept the default settings for the project, and click Finish.
The rule project map at the bottom of the Rule Studio guides you from the rule project definition to the RuleApp deployment.
Create the XOM and BOM
The rules created in ILOG JRules are executed against an Executable Object Model (XOM) that references the application objects and data of the external application. The XOM is the base implementation of the Business Object Model (BOM). BOM is the model against which the rules are written. You can create a BOM from scratch, or you can create it automatically by parsing your execution object model (XOM). This article describes how to create a BOM starting from a XOM, as shown in the following steps. JRules enables you to create the XOM either from Java objects or from XML. This article uses a dynamic XML XOM.
- Save the following FileNet XSDs onto your local disk:
http://www.wfmc.org/standards/docs/TC-1025_schema_10_xpdl.xsd. The bpmnxpdl_24.xsd file refers to the schema_10_xpdl.xsd file as its schema definition.
- Edit the bpmnxpdl_24.xsd file, and change the schemaLocation attribute
- Select Import XOM from the rule project map.
- Select Dynamic Execution Object Model (XSD or WSDL) in the XOM selection window.
- Click Add External XSD, as shown in Figure 3.
Figure 3. Create the XOM
- Select the FileNet XSD (bpmnxpdl_24.xsd), and click Finish. This creates the XOM for the rule project.
- Click the Create BOM link from the rule project map, and assign a name for the BOM.
- Ensure that Create a BOM entry from a XOM is checked, and click Next.
- Click Browse XOM, select the only available XOM, and click OK. The available entries are shown in Figure 4.
Figure 4. Create the BOM
- Select the first entry, and click Finish. You can expect a few errors when the BOM is created, because several members of the XOM have the same name.
- Click each of the errors, and change the default verbalization by appending numeric suffixes to correct the errors.
- Save the rule project. The errors should be gone.
Create the required parameters
The business rules act on a set of objects called parameters, which represent the interface of the rule service. To create the parameters, complete the following steps:
- Click Define parameters from the rule project map.
- Ensure that the direction of the parameters is correctly selected based on your design.
- Keep the variable names, types, and verbalizations from the example, including the variables that are used in this article, as shown in Table 1.
Table 1. Key variables for example
|dob||java.util.Date||IN||Date of Birth|
|insurRejected||java.lang.Boolean||IN||Insurance Rejected in 5 years|
|empInsurance||java.lang.Boolean||IN||Applicant has Employer provided Insurance|
|otherInsurance||java.lang.Boolean||IN||Applicant has other Insurance|
|hasAIDS||java.lang.Boolean||IN||Applicant has AIDS|
|isAlcoholic||java.lang.Boolean||IN||Applicant is Alcoholic|
|hasCancer||java.lang.Boolean||IN||Applicant has Cancer|
|hasKidneyStones||java.lang.Boolean||IN||Applicant has Kidney Stones|
|hasTumor||java.lang.Boolean||IN||Applicant has Tumor|
|hasHiBP||java.lang.Boolean||IN||Applicant has High Blood Pressure|
|hasDiabetes||java.lang.Boolean||IN||Applicant has Diabetes|
|bmi||java.lang.Float||IN_OUT||Body Mass index|
|kidneyStonesRating||java.lang.Integer||IN_OUT||Kidney Stones Rating|
|hiBPRating||java.lang.Integer||IN_OUT||High BP Rating|
Create the rule package
Rules can be grouped into packages. To create a new rule package, click Add rule package from the rule project map, and assign an appropriate name. Add the following three rule packages in order:
- Initialize: to initialize the parameters used in the business rules
- Calculate: to calculate bmi and health rating
- Verify: for the actual business rules for automatic underwriting
Create the required business rules
Each business rule consists of a set of conditions and a set of actions. The conditions and statements act on the parameters defined in the rule project. To create a business rule, complete the following steps:
- Click File > New > Business Rule, and assign an appropriate name.
- Select the package under which you want to create the rule.
- Click Finish. The code editor prompts you to enter the rule.
- Under the Verify package, create a rule in the code editor, as shown
in Listing 1, such that if a patient's bmi result is
Underweight, the Insurance Accepted is set to
Listing 1. Rule to check body mass index
if 'BMI Result' is "Obese" or 'BMI Result' is "Underweight" then set 'Insurance Accepted' to false ;
- Under the Verify package, create a rule in the code editor, as shown
in Listing 2, such that if a patient's health rating is more than
60, the Insurance Accepted is set to
Listing 2. Rule to verify an acceptable health rating
if 'Health Rating' is more than 60 then set 'Insurance Accepted' to false ;
- Under the Verify package, create a rule in the code editor, as shown
in Listing 3, such that if the insurance was rejected in the past 5
years, the Insurance Accepted is set to
Listing 3. Rule to check whether insurance has been rejected in the past 5 years
if 'Insurance Rejected in 5 years' is true then set 'Insurance Accepted' to false ;
- Under the Initialize package, create the rule in the code editor to initialize the parameters, as shown in Listing 4.
Listing 4. Initialize the input variables
then set 'Insurance Accepted' to true ; set 'AIDS Rating' to 100 ; set 'Cancer Rating' to 90 ; set 'Tumor Rating' to 80 ; set 'Kidney Stones Rating' to 70 ; set 'Diabetes Rating' to 60 ; set 'Alcoholic Rating' to 50 ; set 'High BP Rating' to 40 ; set 'Body Mass index' to Weight / ( Height * Height ) ; set 'Health Rating' to 0;
- Under the Calculate package, create the set of rules one after the other with appropriate names, as shown in Listings 5-11, to calculate the health rating for the different diseases.
Listing 5. If applicant has AIDS, add it up to the health rating
if 'Applicant has AIDS' then set 'Health Rating' to 'Health Rating' + 'AIDS Rating' ;
Listing 6. If applicant is alcoholic, add it up to the health rating
if 'Applicant is Alcoholic' then set 'Health Rating' to 'Health Rating' + 'Alcoholic Rating' ;
Listing 7. If applicant has cancer, add it up to the health rating
if 'Applicant has Cancer' then set 'Health Rating' to 'Health Rating' + 'Cancer Rating' ;
Listing 8. If applicant has tumor, add it up to the health rating
if 'Applicant has Tumor' then set 'Health Rating' to 'Health Rating' + 'Tumor Rating' ;
Listing 9. If applicant is has kidney stones, add it up to the health rating
if 'Applicant has Kidney Stones' then set 'Health Rating' to 'Health Rating' + 'Kidney Stones Rating' ;
Listing 10. If applicant has diabetes, add it up to the health rating
if 'Applicant has Diabetes' then set 'Health Rating' to 'Health Rating' + 'Diabetes Rating' ;
Listing 11. If applicant has hjgh blood pressure, add it up to the health rating
if 'Applicant has High Blood Pressure' then set 'Health Rating' to 'Health Rating' + 'High Blood Pressure Rating' ;
- Calculate the bmi result using a decision table that correlates bmi with the bmi result, as shown in Figure 5.
Figure 5. Calculate bmi result using a decision table
Create the rule flow
A rule flow determines the order of execution of the rule set. To create the rule flow, complete the following steps.
- Click Add RuleFlow, assign a name, and click Finish. This opens a graphical editor.
- Click the Start icon, and click within the diagram area to create the starting point of the flow.
- Click to create the end point.
- Drag the rule packages from the project explorer onto the diagram area in the order of execution.
- Click the Create Transition icon, and click the start object.
- Click the rule package. This creates the transition between the start and the first rule package.
- Create similar transitions for the rest of the rule packages and for the end point. Figure 6 shows the resulting rule flow.
Figure 6. Create the rule flow
Create the rule application
The rule application is the deployment archive that gets deployed onto the execution server. To create the rule application, complete the following steps.
- Click Create RuleApp from the rule project map, and assign a name.
- Select the projects and rule sets to be added to the archive.
- Click Finish.
The rule application for the rule sets is created. You can now directly deploy the rule application on to the execution server or export it as a JAR file for later deployment.
Running, debugging, and deploying the business rules
Because Rule Studio is based on an Eclipse plugin, you can test and debug business rules similarly to how you would test and debug Java projects. Complete the following steps to test and debug the business rules.
- Click Run > Open Run Dialog, and configure a new rule project from the context menu.
- Provide initial values for the parameters, and click Run. To test the results, you can insert print statements within your rules and check the output in the console window.
- Once you are ready for deployment, right-click the rule application from the project explorer, and click Ruleapp > Deploy. The deployment dialog appears.
- Accept the default settings, and click Deploy. This deploys the RuleApp archive onto the rule execution server.
- To verify the deployment, open the rule execution server using Program Files > IBM WebSphere ILOG JRules V7.0.2 > Web Interfaces.
- Log in as resAdmin/resAdmin (ILOG Version 7.0.2), and click the Explorer tab.
- Click the RuleApps tree. Your newly deployed rule set appears, as shown in Figure 7.
Figure 7. Deploy the business rules
Extracting the WSDL for the deployed rules
Web Services Description Language (WSDL) is an interface definition language for web services clients to identify the interface details that the server provides. Complete the following steps to generate the WSDL link for the deployed ILOG rule set.
- Click Start > Program Files > IBM WebSphere ILOG JRules V7.0.2 > Web Interfaces to log in to the rule execution server.
- Click the Explorer tab, and select the deployed rule set.
- Click Get WSDL for the latest ruleset version.
This opens a new browser window with the generated WSDL in XML format, as shown in Figure 8. You can use the WSDL from the IBM FileNet P8 Process Designer to invoke the rule sets.
Figure 8. Generated WSDL for ILOG rule sets
Designing the process workflow using IBM FileNet P8
The most important step in the implementation of the example use case is to design the process workflow. You can create the workflow using IBM FileNet P8 Process Designer by completing the following steps.
- Sign in to IBM FileNet P8 Workplace using your credentials.
- Launch the Process Designer by clicking Author > Advanced Tools on the left frame of the screen. The designer applet opens.
- Drag and drop the workflow steps from the BPM palette, and create the workflow in which the Personal Insurance (Automated Underwriting) is a system task that invokes the HTDS of JRules for straight-through automated-underwriting processing, as shown in Figure 9. See Resources for information about the workflow steps.
Figure 9. Process workflow
Creating the required workflow variables
Workflow variables are the basis of human-system interaction within the workflow. They are also used for conditional routing among the various workflow steps. To create workflow variables, complete the following steps.
- Click the Workflow Properties icon from the Process Designer.
- Open the Data Fields tab.
- Double-click the data grid, and create the variables with the associated data types, as shown in Table 2. Make sure that the data type for Merge Type is Override.
Table 2. Workflow variables
Associating workflow variables to steps and assigning participants
When you assign workflow variables to steps, they show up in the step processor for that step, and they act as either input fields or information fields populated from the previous steps. Remember that the workflow variables are global to all the steps. To assign variables to individual steps, complete the following steps.
- Click the step to which you want to assign the variables.
- On the step properties pane, click the Parameters tab. (For the LaunchStep, click the General tab).
- Select the following parameters from the Available Parameters list
that you want to assign to the launch step, and use the right-arrow to
move the parameters to the Selected Parameters list:
- Select and move the following parameters to assign them to the
Selected Parameters for the Human Underwriting step:
- Select and move the following parameters to assign them to the Email
For human tasks (Human Underwriting and Email Notification), workflow participants need to be assigned. To add a participant to a task, complete the following steps.
- Click the step.
- From the General tab in the participant area, check the Participants radio button.
- Select a user with privileges to process work items. For simplicity,
you can assign the user
Administratorto all human steps, as shown in Figure 10.
Figure 10. Associate workflow participant
After you associated variables and participants to steps, add the conditions for routing by completing the following steps.
- Click Result = True.
- Enter insuranceAccepted = true for the routing condition.
- Click Result = False.
- Enter insuranceAccepted = false for the routing condition.
Configuring IBM FileNet P8 BPM to consume web services
To configure IBM FileNet P8 BPM to consume web services, complete the following steps.
- Click Workplace Admin, and open the Process Configuration Console applet.
- Connect to your isolated region.
- Right-click the region, and click Properties.
- Click the Web Services tab, and enable the check box Enable Process Designer to enter WSDL links without browsing for Web Services, as shown in Figure 11.
Figure 11. Enable process designer to accept WSDL URL directly
Configuring the workflow invoke step to execute the business rules
In order to use the web service that ILOG exposes, you need to configure a partner link with the WSDL extracted from the ILOG execution server. To configure the partner link, complete the following steps.
- Click Workflow Properties > Web Services on your Process Designer.
- Double-click the empty line in the list of Partner Links to add a new partner link.
- Click the Invoke check box.
- In the text field, paste the WSDL link that ILOG generated.
- Ensure Port Type is automatically selected for ILOG WSDL. The resulting screen is shown in Figure 12.
Figure 12. Configure workflow to consume web services
- Once the partner link is configured, click the web services invoke
task, such as Personal Insurance (Automated Underwriting). This is a system
Invokeis the selected operation on the selected list.
- Double-click Invoke to configure the web service invocation.
- Select the partner link you just created, and select the operation. For ILOG, you can select only the executeDecisionService() operation. The Process Designer then populates all the input and output variables of the web service in two separate lists from which you can select the local variables to map to.
- For each of the input and output variables, select the appropriate local variables from the drop-down list. Figure 24 shows the mapping of the output variables.
Table 3. Map the output variables for sending data to ILOG web service
Table 4 shows the mapping of the input variables.
Table 4. Map the input variables for consuming the ILOG web service
Launching the workflow and testing the business rules in action
With the partner link selected and the variables mapped, you are ready to launch the workflow by completing the following steps.
- Validate the workflow by clicking File > Validate Workflow Collection.
- Click File > Transfer Workflow Collection to transfer the workflow to the object store and the Process Engine.
- While transferring, select an appropriate title for the document, and select a location on the objectstore to store the workflow.
- Select the default security settings for the document.
- Click File > Launch Main Workflow to launch the workflow. Remember that you selected Administrator as the default user for all the manual tasks. The launch window opens and acts as an input form, as shown in Figure 13.
Figure 13. Launch the workflow
- Complete the fields with any appropriate values, and click Launch, as shown in Figure 13.
The automated-underwriting task is executed. If the rule engine gives a positive response, the task is routed to the email notification task. If the rule engine gives a negative response, the task is routed to the human underwriters task.
To verify the results, click Tasks > Inbox from the workplace, and click the step processor for the work item.
Fine-tuning with tips and tricks
Consider using the following ideas to optimize your work.
- If you use the same variable names in both Rule Studio and IBM FileNet P8 Process Designer, the mapping of the variable in the invoke step is done automatically.
- If you use the WSDL for the latest rule set version, you can modify the rules and deploy them as minor versions without affecting the workflow. The workflow uses the latest rule set for its execution.
- When you have a large set of rules that act on the same set of variables organized in the form of records (for example, from an Excel® spreadsheet), use the ILOG JRules import function. It enables you to import an Excel file and create a decision table.
- Instead of the example XSD file, you can create your own basic XML file with different variables and types to develop an XSD file in order to create a XOM.
Using web service integration: an alternative to HTDS
There are two ways in which IBM FileNet P8 BPM and IBM WebSphere ILOG JRules can achieve web services integration. As described under Configuring the workflow invoke step to execute the business rules, you can use the HTDS WSDL directly within your process workflow and map the input and output variables. Or, you can generate a web service client for the rule set using the code generator function of ILOG Rule Studio. To use the code generator function, create a Java® component that makes web service calls using the generated client and then integrates the component with the process workflow. See Resources for best practices regarding configuration and deployment and for product documentation to use this method.
This article described how to integrate IBM FileNet P8 BPM with IBM WebSphere ILOG JRules using web services. It also detailed the steps for developing and deploying your business rules using the provided tools. A solution where IBM FileNet P8 BPM is used in conjunction with JRules enables rapid changes to business decisions, which in turn helps an organization to affirm its position in today's competitive market. The solution improves the agility of the business processes and provides proper tooling for each of the stakeholders.
Our deepest gratitude to the following reviewers who spent their valuable time reviewing and giving their suggestions and comments on all aspects of this article:
- Chris Berg - Product Manager (WebSphere BRMS)
- Andy J Ritchie - ILOG Development Integration & Synergy (WebSphere BRMS)
- Jiehua Eva Lu - Technical Alliance Manager (WebSphere BRMS)
- Srinivas Nv Gannavarapu - Advisory Software Engineer (Enterprise Content Management)
- Refer to IBM FileNet P8 documentation for information about the workflow steps.
- Check out the WebSphere ILOG Business Rule Management Systems (BRMS) Best Practices Webinar Series.
- WebSphere ILOG JRules: Develop and deploy powerful rule-based applications.
- Learn more about Information Management at the developerWorks Information Management zone. Find technical documentation, how-to articles, education, downloads, product information, and more.
- Stay current with developerWorks technical events and webcasts.
Get products and technologies
- Build your next development project with IBM trial software, available for download directly from developerWorks.
- Participate in the discussion forum.
- Get connected on the WebSphere ILOG Business Rule Management Systems forums.
- Check out the developerWorks blogs and get involved in the developerWorks community.
Dig deeper into Information management on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.