Creating a Simple BRM Ruleset in 30 Easy Steps using NWDS 7.3 (Flow Ruleset with a Decision Table)
This document illustrates how to create a simple BRM (Flow) Ruleset using NWDS 7.3 in 30 easy steps, consisting of static values and conditions in a Decision Table and exposing the Rulseset as a reusable Web-Service.
For now, we will create a local project.
For practice purpose, we will create a BRM which will decide an Approver for an Employee for a specified Cost of Trip he/she has made.
Please follow these steps and refer to the screenshots:
1. Create DC:
2. Select DC Type (Rules Composer):
3. Name your DC and Click on ‘Finish’:
Your Created DC should look like this in your Workspace:
4. Creating a New Flow Ruleset (Right click on ‘Rules Modelling’):
Name your Ruleset:
The created Ruleset will appear in the Project:
5. Now, we will have to create custom XSD elements that can be used in the BRM rule. Right click on the ‘wsdl’ folder within ‘src’ in the project:
6. Name the New XML Schema and click on ‘Finish’:
The blank XML Schema should look like this:
7. Now, we will create 2 Simple types (elements) in the XML Schema Definition which will be used going ahead. Right-click in the ‘Types’ area and select the data type. Here, we will create 2 Data elements, one for the trip cost and one for the corresponding approver:
8. So, the created Schema should look like this:
9. Now, to use this created schema in the project, we need to add it in the project resources. Open the properties of the project resources of the project to add the custom datatypes(XSD) elements:
10. Click on the ‘aliases’ tab and select ‘add’ as highlighted:
11. Select the created XSD elements:
The added aliases should look like this:
Now, the XSD elements are ready to use.
12. Create a new Decision Table and Name it:
13. Select the conditions to add as shown:
14. Add the elements by clicking the downward arrow and check ’Table has horizontal condition’:
15. Select the Action as shown:
The created decision table will look like this:
16. To edit values in the conditions, double click on the existing value and enter the new value:
17. To add values in the conditions:
18. Enter the desired value in the dialog box and click on OK:
Now the table will look like this:
19. Similarly, you can edit the values in the action entries by double-clicking on the existing values. After making all the entries to the table, it should look like this:
Your decision table is ready.
20. Now, we have to make a Flow for the created ruleset:
Name the Flow:
21. The created flow will look like this:
22. Now, as we want the input to flow through our created decision table, we will have to add the decision table in this flow:
Drag and drop the decision table activity from the palette onto the flow editor and connect the flow:
23. Now, we have to assign the created decision table to the decision table activity in the flow:
24. Select ‘Browse’ from the ‘Decision table’ dropdown:
Now the flow should look like this:
This step completes the creation of the BRM Ruleset.
25. Further, we need to expose this BRM as a web-service so that it can be used across applications.
To do this, follow the following steps:
26. Name the Web Service:
27. The details in step 26 are going to be the details of the web service. Please keep a note of this.
28. The Web service will be:
29. Check the options as shown below in the following dialog box:
30. The XML structure of the web service will follow in the next dialog box:
Click on finish. The BRM web service is now created.
Your BRM is now ready to use.
This BRM web service can be used as any other web service which can provide certain outputs for decision-making purposes. Most commonly used as integrated in BPM Business Processes.
Hope this document helps. Please provide inputs if I have missed out on anything.