IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Building services > Building a Decision service
Adding a JRules Decision Service component to a service
When building a Decision service in Process Designer, you can include decision services available on an ILOG JRules Rule Execution Server in your implementation.
IBM BPM integrates with IBM WebSphere ILOG JRules by providing a JRules Decision Service component. This rule component enables you to use rule applications available on a JRules Rule Execution Server for your IBM BPM implementations.
Why should you choose using a JRules Decision Service component over creating a standard web service when connecting to a WebSphere Operational Decision Management (WODM) server, which is IBM’s recently renamed ILOG JRules Rule Execution Server? The JRules Decision Service component is specifically designed for calling a JRules decision service. It has a closer conceptual mapping to the JRules decision service called and, therefore, is a more efficient representation of it in your business process model. A JRules Decision Service component can handle decision services hosted on either a WebSphere ILOG JRules BRMS 7.1 or WODM 7.5 or higher server.
Conversely, the web service will treat the service called as it would any other generic service; that is, the web service has no corresponding model representing the JRules decision service called. Each time a JRules server version changes, you will need to modify the web service.
The following procedure describes how to use the JRules Decision component to connect to an ILOG JRules Rule Execution Server and invoke the rule applications and rule sets available on that server as decision services.
Before using the JRules Decision Service component in your Rules service, review the following requirements:
- Use environment variables to provide the URL of an ILOG Rule Execution Server. For more information, refer to the related topic "Adding a Server Configuration".
- For a secure connection to a Rule Execution Server running on WebSphere Application Server, you must provide the SOAP port and, if necessary, the user name and password for the Rule Execution Server. This secure connection enables you to choose the applications and rule sets that you want to use from the Rule Execution Server.
- If you connect to a Rule Execution Server that is running on WebSphere Application Server, but the Rule Execution Server is not properly configured for security or you are not able to provide the SOAP port, user name, and password, then you cannot list the rule applications and rule sets available on that Rule Execution Server. In this case, you can manually enter the names of the rule applications and rule sets that you want to use. If the names that you provide are accurate, you can successfully generate types as described in the following procedure.
- If you connect to a Rule Execution Server that is running on an application server other than WebSphere, you cannot list the rule applications and rule sets available on that Rule Execution Server. In this case, you can manually enter the names of the rule applications and rule sets that you want to use. If the names that you provide are accurate, you can successfully generate types as described in the following procedure.
Procedure
To build a Decision service that includes an JRules Decision Service component, complete these steps:
- Create a Decision service as described in the related topic "Adding a Decision service to a process."
- Drag a JRules Decision Service component from the palette to the service diagram.
- With the JRules Decision Service component selected, click the Implementation option in the Properties tab.
- In the Discovery section, enter the following information to connect to a Rule Execution Server that contains deployed rule applications (Rule Apps) that you want to use.
Input required to connect to the Rule Execution Server Field Action Server Select the server that you want from the list of ILOG Rules Server variables. (See the related topic "Setting environment variables" for more information.) SOAP Port Specify a port for the SOAP connection if the Rule Execution Server is running on WebSphere Application Server. User name Enter the user name to use, if necessary, for a secure connection. Password Enter the password to use, if necessary, for a secure connection. The SOAP port, user name, and password fields accept embedded JavaScript expressions, so variables can be used to provide those values.
- Click Connect.
- In the Rule section, select the Rule App that you want from the menu, then select the version that you want to use. If a secure connection to the Rule Execution Server has not been established, the menu is not populated. In this case, manually enter the name and version of the Rule App and Rule Set that you want to use. The names must be accurate for the next step to work.
- Click Generate Types.
- In the Generating Types window, make sure the Generate request/response wrapper types option is not selected. Click Next.
- Click Finish when type generation is complete.
- In the Properties section, click Data Mapping.
- Click the auto-map icon in upper right corner of the Input Mapping section. The Create variables for auto-mapping window opens, listing the private variables needed for input parameters from the selected Rule App.
- Click to select each variable to create in your Decision service and then click OK.
- Click the auto-map icon in upper right corner of the Output Mapping section. The Create variables for auto-mapping window opens, listing the private variables needed for output parameters from the selected Rule App.
- Click to select each variable to create in your Decision service and then click OK.
- Use sequence lines to connect the JRules Decision Service component to the Start and End Events.
- Save the new Decision service.
What to do next
You can nest this Decision service in any other service within your process application that requires the same logic. Be sure to adjust the input and output variables as required for each implementation. Refer to the related topic "Declaring and passing variables" for more information.
Related concepts:
Declaring and passing variables
Related tasks:
Adding a Decision service to a process
Adding a server configuration