Integrating PI Operation Mapping with SAP BPM
With the overwhelming boom that SAP PO Suite has been receiving so far, we see new challenges coming up in all the 3 components.
We face many hurdles when it comes to integrating BPM with BRM, BRM with PI, PI Components with BPM etc.
This document captures one such important facet of integration.
This document will have a step by step approach as to how we can import a PI Operation Mapping into SAP BPM in NetWeaver Developer Studio 7.3 EHP1.
The Scenario of this document will be the same as in this document. The only difference will be that instead of importing the PI Service Interface, we will be importing an Operation Mapping from the PI Repository for further processing.
Check the NetWeaver Developer Studio for the following:
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.
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 Operation Mapping) –>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 Operation Mapping 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 Operation Mapping.
Right-click on ‘Operation Mappings’ in Project Explorer–>Import Operation Mapping–>Enter Credentials–>OK:
14 . Expand the folders to the appropriate Operation Mapping–>Select it–>Finish:
15. Once the Operation Mapping is successfully imported to your BPM Project, you will see the corresponding packages in the ‘WSDL Files’ Folder under Operation Mappings:
16. 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 :
17. Name the WSDL File –> Next:
18. Keep the protocol unchanged (SOAP) –> Finish:
19.You will see the design of the created WSDL:
20. As our Scenario is Asynchronous, we will delete the output parameters.
Right-click on output tab –> Delete:
21. 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:
22. 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:
23. Double-click on the parameter name to edit:
24. Double-click on the data-type to change:
25. Repeat Steps 23-24 to create the following structure:
26. 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:
27. Name the Trigger –> Next:
28. Select the WSDL we created for the Start Event from the Dropdown for the Service Interface and click Finish:
29. The trigger is now created. Assign this trigger to the Start Event.
Right-click on Start-event –> Properties –>Event Trigger –>Select from Dropdown:
30.Now, we need to call the PI Operation Mapping in the Automated Activity.
Right-click on Automated Activity –> Properties –> Interface –> Select from Dropdown:
31. Now, right-click on the Notification Activity –> Properties –> To–>’Choose’ UME User (As the recipient of the email):
32. In the next dialog box, enter the search criteria –> click on the desired recipient from the result-set –> Add –> OK:
33. Now that the recipient is set, we need to add the Subject and the Content of the email in the ‘Mail’ Property:
34.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 Operation Mapping):
C. Automated Activity –> Process Context(Output of PI Operation Mapping to Process Context):
35. 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:
36. In Pool Properties, Set the Administrator in the Administrator property, similarly like we selected the recipient of the email in step # 31 & 32:
37. Finally, check for any Build-errors.
Right-click on BPM Project –> Development Component –> Build:
38. 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.
39. 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.