Skip to Content
Author's profile photo Siddhant Bhatankar

Integrating PI Operation Mapping with SAP BPM

Hello All,

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.

Objective:

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.

Scenario:

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.

Prerequisites:


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:

PI1.jpg

2. Select ‘Process Composer’ perspective –> Next :

PI1.jpg

3. Name the vendor, the component,provide description –> Finish:

PI1.jpg

4. The project will be created with the following structure:

PI1.jpg

5. Now, to create a process in the BPM Project, right-click on Processes –> New Process:

PI1.jpg

6. Name the Process, Pool and Lanes –> Finish:

PI1.jpg

7. The created Process, along with the Pool and the Lanes should look like this:

PI1.jpg

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:

PI1.jpg

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:

PI2.png

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:

/wp-content/uploads/2014/09/pi5_546933.jpg

11. Now, to set Data-type for the Data Object, Right-click on the Data-object –> Properties–>Select Data-type from the dropdown:

/wp-content/uploads/2014/09/pi5_546933.jpg

12. Similarly, create 2 more data objects- One to store the Expense amount(int) & one to store the Approval Result(string):

/wp-content/uploads/2014/09/pi6_546935.png

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:

/wp-content/uploads/2014/09/pi7_546936.png

/wp-content/uploads/2014/09/pi8_546937.png

14 . Expand the folders to the appropriate Operation Mapping–>Select it–>Finish:

/wp-content/uploads/2014/09/pik_546938.png

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:

/wp-content/uploads/2014/09/pil_546939.png

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 :

PI1.jpg

17. Name the WSDL File –> Next:

PI1.jpg

18. Keep the protocol unchanged (SOAP) –> Finish:

PI1.jpg

19.You will see the design of the created WSDL:

PI1.jpg

20. As our Scenario is Asynchronous, we will delete the output parameters.

Right-click on output tab –> Delete:

PI1.jpg

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:

PI1.jpg

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:

PI1.jpg

23. Double-click on the parameter name to edit:

PI1.jpg

24. Double-click on the data-type to change:

PI1.jpg

25. Repeat Steps 23-24 to create the following structure:

PI1.jpg

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:

PI1.jpg

27. Name the Trigger –> Next:

PI1.jpg

28. Select the WSDL we created for the Start Event from the Dropdown for the Service Interface and click Finish:

PI1.jpg

29. The trigger is now created. Assign this trigger to the Start Event.

Right-click on Start-event –> Properties –>Event Trigger –>Select from Dropdown:

PI1.jpg

30.Now, we need to call the PI Operation Mapping in the Automated Activity.

Right-click on Automated Activity –> Properties –> Interface –> Select from Dropdown:

/wp-content/uploads/2014/09/pin_546954.png

31. Now, right-click on the Notification Activity –> Properties –> To–>’Choose’ UME User (As the recipient of the email):

PI1.jpg

32. In the next dialog box, enter the search criteria –> click on the desired recipient from the result-set –> Add –> OK:

PI1.jpg

33. Now that the recipient is set, we need to add the Subject and the Content of the email in the ‘Mail’ Property:

PI1.jpg

34.Now that all the properties of all the design activities are set, we need to do the data mapping:

  1. Start Event –> Process Context:

PI1.jpg

B. Process Context –> Automated Activity (Passing input to PI Operation Mapping):

/wp-content/uploads/2014/09/pio_546892.png

C. Automated Activity –> Process Context(Output of PI Operation Mapping to Process Context):

/wp-content/uploads/2014/09/piu_546893.png

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:

PI1.jpg

36. In Pool Properties, Set the Administrator in the Administrator property, similarly like we selected the recipient of the email in step # 31 & 32:

PI1.jpg

37. Finally, check for any Build-errors.

Right-click on BPM Project –> Development Component –> Build:

PI1.jpg

38. Check the status in the Infrastructure Console:

PI1.jpg

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:

PI1.jpg

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.

Cheers.

Sid.

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jonny Wellard
      Jonny Wellard

      Hi

      the WSDL that is generated from the imported Operation Mapping : what end point is expected here. My wsdl:service > soap:address location has a port of 50500 - which does not even exist!. How can it work  Does this get automatically deployed onto the Service Registry?.

      I have built and deployed this but I get a run time error when it executes the operation mapping.   A technical error during invocation: Could not invoke service reference name.

      I have seen in the deployed BPM's Application Configuration against the Consumed Service Groups an error against the associated service group

      Configuration for service
      group [SG_localhost] failed. Error details: [No endpoints found. Check if the  service is configured and if its endpoints are available in the . Service

      It almost seems that it wants me to publish the end point on the service registry -  no idea how....but I none of the blogs and post indicate that I need to fiddle with this at all.

      I have this question in SDN too if you care to take a look.

      thanks

      Author's profile photo Siddhant Bhatankar
      Siddhant Bhatankar
      Blog Post Author

      Yes Jonny. It will throw an error. The automated activity in the BPM where you have called the WSDL of the operation mapping, go to properties and click on the 'Service reference' link. In the 'type' dropdown, select "XI" and then deploy and test.

      Author's profile photo Jonny Wellard
      Jonny Wellard

      Hi

      the guides and William Li's blog suggest that WS is enough.   When I do try and use XI I get this error

      Service Group "SG_localhost" is already assigned to a provider system, therefore it is not possible to add XI Service References to it. In order to do that you need to remove the assignment in NWA.

      If XI really is the correct type on the service reference does the sender component need to be the BPM business component or the default one that is proposed.   I've tried both

      So even with a new Service Group to get around that error I mentioned just above and with the type as XI - yes it does build and deploy - but again I still get the run time error 'could not invoke service reference'.

      All seems to point to the WSDL of this operation mapping that is imported that has what looks like an incorrect address -   I mean I wonder what is port 50500?

      soap:address xmlns:soap="http/schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:50500/mycompany.co.uk~mc_is0090_mes_ampla_wenco/pr/pm/wsdl/om_Wenco_Ampla_equipment_merged"/>