IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Building services > Building a Decision service

Scenario: Exporting rules to a Rule Execution Server

This scenario shows you how to export, migrate and connect BAL rules to a rule execution server (RES). You can migrate the rules created in Process Designer to a business rules management system (BRMS) such as IBM WebSphere ILOG JRules, and then continue to use the rules in a business process definition.

This scenario assumes that you previously completed the Decision Service in a Personalized Notification Process scenario. Upon completion of that scenario, your business process definition includes a Decision service called NotificationRulesService, which contains a BAL Rule component called AlertRules. For the purposes of the current exporting scenario, assume that the rules you wrote for the AlertRules component also apply to other processes in your organization, so you want to share the rules with your co-workers, who are developing business rules using IBM WebSphere ILOG JRules.

You can export the rules you created in Process Designer, import them into Rule Studio, deploy the rules to a Rule Execution Server (RES) , and then connect your Decision service to the RES using a JRules Decision Service component.


Procedure

To export rules for use in Rule Studio and the Rule Execution server, complete these steps:

  1. Export the BAL rules from your Decision service.

    1. Verify that you are editing the NotificationRulesService Decision service and the AlertRules BAL Rule component.

    2. In the AlertRules component panel, click the Decisions tab to open the rule editor.

    3. In the menu bar above the rule editor window, click the Export icon.

    4. In the Save As window, navigate to the location where you want to save the exported rule file.

    5. Enter a name for the export file, then click Save to specify the location.
    You can find more information about exporting rules in the related topic about exporting rules for use in Rule Studio.
  2. Import the rules into Rule Studio.

    1. Using IBM WebSphere ILOG Rule Studio, import the project .zip file to create a new Rule Studio project.

    2. Click File > Import > General > Existing Projects into Workspace.

    3. Click Select archive file. Click Browse to navigate to the location where you saved the exported rule project file and select the file.

    4. Select an existing project where the rules will be imported, or create a new Rule Studio project, then click Finish.
    You can find more information about importing rules in the related topic about configuring a remote decision service.
  3. Deploy the rules to the rule execution server (RES).

    1. In Rule Studio, select the RuleApp which contains the AlertRules and click Deploy a RuleApp to one or more Rule Execution Servers.

    2. Select an existing Rule Execution Servicer and deploy the RuleApp to the server.
    See the related topic about deploying from Rule Studio in the IBM WebSphere ILOG JRules BRMS Information Center.

  4. Add a JRules Decision Service component the Decision service and connect it to the RES.

    1. Configure your Decision service to include a JRules Decision Service component. When you specify the correct rule execution server and port settings, the JRules Decision component establishes a connection between Process Designer and the Rule Execution Server that contains the imported rule project.
    2. Verify that you are editing the NotificationRulesService Decision service.
    3. Remove the AlertRules BAL Rule component that contains the rules you exported.
    4. Replace the BAL Rule component with a JRules Decision Service component. Drag a JRules Decision Service component from the palette to the service diagram, and place it in the same location as the deleted BAL Rule component. Reconnect any sequence lines to other activities or services.

    5. Select the new JRules Decision Service component, then click Implementation in the Properties tab.

    6. In the Discovery section, enter the following information to connect to the Rule Execution Server that contains the rules that you want to use.

      • Server: Select the Rule Execution Server (RES).
      • SOAP Port: Specify a port for the SOAP connection if the Rule Execution Server is running on WebSphere Application Server.

      • User name: Enter a user name if the JRules server requires a secure connection.
      • Password: Enter the password if the JRules server requires a secure connection.

    7. Click Connect.

    8. In the Rule section, select the Rule App that you want from the menu, then select the version that you want to use.

    9. Click Generate Types.
    You can find more information about adding a JRules Decision Service component in the related topic about configuring a remote Decision service.
  5. Map the variables to make sure that the variables used in the rules on the Rule Execution Server correspond to variables defined in Process Designer.

    1. Click the Properties tab in the JRules Decision Service panel.

    2. In the Properties section, click Data Mapping.

    3. Click the auto-map icon in upper right corner of the Input Mapping section.

    4. In the Create variables for auto-mapping window, click to select each variable to create in your Decision service and then click OK.

    5. Click the auto-map icon in upper right corner of the Output Mapping section.

    6. In the Create variables for auto-mapping window, click to select each variable to create in your Decision service and then click OK.
  6. Save the updated Decision service.


What to do next

After completing the scenario, test and debug the Decision service and the JRule Decision service component to make sure the rules from the Rule Execution Server are producing the results you expect. For more information about testing and debugging a Decision service, see the related topic about testing a Decision service.

Building a Decision service


Related tasks:
Scenario: Creating a Decision service in a Personalized Notification process
Export rules for use in Rule Studio
Configure a remote Decision service
Testing a Decision service


Related information:

Deploying from Rule Studio