Creating an end-to end BPM Process with PI Service Interface Integration in 40 Easy Steps (NWDS 7.31 & above)
This document guides you with creation of a simple BPM Process along with Integrating a PI Service Interface in the Process. The objective of this document is to demonstrate a perfect example of using all components of the PO Suite (BPM, BRM & PI).
We will develop the BPM with a ‘Travel Expense Approval’ scenario in mind, where, based on the Employee Level & His Travel Expense, the BRM will decide if it is Approved or Rejected. This BRM will be called by a PI Service Interface.
The Start Trigger (Web-service) of the BPM process will consist of 2 Input Parameters : Employee_Level & Expense Amount.
These input parameters will be passed from BPM to PI Service Interface, which, in turn, will call a BRM web-service to check the Business Rules. The BRM web-service will return the corresponding output value to PI, which will again be passed to BPM for further usage.
So the flow would go like this: BPM–>PI–>BRM–>PI–>BPM.
1. Check for Proper Connection between NWDS and PI Enterprise Service Repository in Window–>Preferences–>Web-services–>Enterprise Service Browser. Enter the appropriate details and check if the Service Repository is reachable.
2. The PI Connectivity is done properly in Windows–>Preferences–>PI Tools Configuration–>Connections.
3. A developed PI Service Interface which calls the BRM Ruleset for Travel Expense Approval. For our scenario, the BRM Ruleset Decision Table looks like this:
Note: For more details on hot to create a BRM, please refer this step-by-step document.
Let’s get started:
1. Open the ‘Development Infrastructure’ perspective in NWDS. Right-click on the SCA –> New –> Development Component:
2. Select ‘Process Composer’ perspective –> Next :
3. Name the vendor, the component,provide description –> Finish:
4. The project will be created with the following structure:
5. Now, to create a process in the BPM Project, right-click on Processes –> New Process:
6. Name the Process, Pool and Lanes –> Finish:
7. The created Process, along with the Pool and the Lanes should look like this:
8. Now, depending on the process flow design we will drag and drop various activities and events from the Design-palette into the process flow and link them according to the flow:
9. Now, according to our scenario, we need the Business Flow as follows:
Start-Event (With input parameters) –> Automated Activity (To execute PI Service Interface) –>Notification Activity (To send an email to the recipient)–>End.
As we already have the Start and End Event by default, we only need Automated Activity and Notification Activity from the Palette:
10. Now that the process design is ready, we need to create the data holders which will hold the data throughout the process execution. These are called Data Objects in BPM. They are available in the design-palette:
11. Now, to set Data-type for the Data Object, Right-click on the Data-object –> Properties–>Select Data-type from the dropdown:
12. Similarly, create 2 more data objects- One to store the Expense amount(int) & one to store the Approval Result(string):
13. Now that the process design and the data holders are ready, we need to integrate the external components required for each of the design activities in the process design.
In our case, we need only the Service Interface to be integrated into the automated activity. (Notification Activity does not require any external entity).
Entities such as Service Interfaces, Web-services etc. are converted to WSDL files and then integrated into the BPM Project.
So, we will integrate the Service Interface as a WSDL. Right-click on WSDL Folder in Project Explorer–>Import WSDL–>Select the appropriate method (Enterprise Service Repository)–>Next:
14. Enter credentials –> Next:
15. Expand the folders to the appropriate Service Interface, select it –> Finish:
16. Once the Service interface is successfully imported to your BPM Project, you will see the corresponding packages in the ‘WSDL Files’ Folder:
17. Now that the Service interface is ready for use in the BPM Project, now we will create all the components required for each and every activity in the process design.
As we know that the Start Event of every Process is nothing but a web-service, we need to create the corresponding WSDL for the Start Event in the BPM Project.
Right-click on ‘Service Interfaces’ –> New WSDL :
18. Name the WSDL File –> Next:
19. Keep the protocol unchanged (SOAP) –> Finish:
20. You will see the design of the created WSDL:
21. As our Scenario is Asynchronous, we will delete the output parameters.
Right-click on output tab –> Delete:
22. Deleting output from design is not enough. We need to delete the output parameter from the XML code of the WSDL too.
Click on ‘Source’ tab –> Delete the ‘/output’ tag:
23. Now go to the design tab again. As we need to add Input Parameters (Employee_Level,Expense_Amt), we will add these as Input for Start Event:
Click on the Arrow next to ‘input’ tag:
24. Double-click on the parameter name to edit:
25. Double-click on the data-type to change:
26. Repeat Steps 24-25 to create the following structure:
27. Now, the Asynchronous WSDL is ready to use. Now, each and every start event is associated with a trigger. In our case, it will be a Message Trigger. So we will create a new message trigger.
Right-click on ‘Event Triggers’ –> New Message:
28. Name the Trigger –> Next:
29. Select the WSDL we created for the Start Event from the Dropdown for the Service Interface and click Finish:
30. The trigger is now created. Assign this trigger to the Start Event.
Right-click on Start-event –> Properties –>Event Trigger –>Select from Dropdown:
Now, we need to call the PI service Interface in the Automated Activity.
Right-click on Automated Activity –> Properties –> Interface –> Select from Dropdown:
This takes care of the Automated Activity.
32. Now, right-click on the Notification Activity –> Properties –> To–>’Choose’ UME User (As the recipient of the email):
33. In the next dialog box, enter the search criteria –> click on the desired recipient from the result-set –> Add –> OK:
34. Now that the recipient is set, we need to add the Subject and the Content of the email in the ‘Mail’ Property:
35. Now that all the properties of all the design activities are set, we need to do the data mapping:
- Start Event –> Process Context:
B. Process Context –> Automated Activity (Passing input to PI Service Interface):
C. Automated Activity –> Process Context(Output of PI Service Interface, back to BPM Process Context):
36. Now that the data mapping is complete, the BPM Process is complete and ready for use.
But for Troubleshooting and Admin purposes, we assign an administrator to the BPM Process.
Right-click on Pool –> Properties:
37. In Pool Properties, Set the Administrator in the Administrator property, similarly like we selected the recipient of the email in step # 32 & 33:
38. Finally, check for any Build-errors.
Right-click on BPM Project –> Development Component –> Build:
39. Check the status in the Infrastructure Console:
Note: There are no build errors but warnings are always going to be present. However, these warnings do not affect the deployment.
40. Now that there are no build errors in the project, it is ready to be deployed onto the server and used. Deploy the DC.
Right-click on the BPM Project –>Development Component –> Deploy:
Now, our BPM is ready to use on the server. You can test it in 2 ways:
1. Trigger the BPM Start Web-service in WSNavigator
2. Start the Process Manually from the Process Repository.
Hope this document helps people in some way or the other.
Please let me know if I have mentioned anything incorrectly in this document.