Using NetWeaver PI’s Mapping in NetWeaver BPM
With NetWeaver 7.31, a new capability is introduced to use PI mappings in BPM. Even though BPM has a powerful mapping capability using XPath expressions, it is not quite as powerful or flexible as PI’s Operation Mapping. Using Operation Mapping, we have the following advantages:
- We can use Message Mapping, XSLT and Java programs; this provides much greater flexibility when we design mappings and transformations.
- Operation Mapping can have multiple mapping programs during the mapping process. The mapping programs can be executed in sequence. The mapping programs can be a combination of Message Mapping, XSLT and Java.
- Reuse existing Operation Mapping to save development time.
In this blog, I will go over the steps of how to use PI’s Operation Mapping in BPM.
It is assumed that the user is familiar with using the NWDS tool to design BPM processes.
There are some limitations:
- No parameters. The Operation Mapping cannot contain any parameters, since there is currently no way to pass parameter values from BPM to PI. So, this eliminates the possibility of using the “wizard” to do lookups using tables and RFCs. However, we can still use user-defined functions to do such lookups.
- NetWeaver 7.31 SP2 or above.
Operation Mapping Design in the ESR
We can develop or use the existing mappings in the ESR as before. The Service Interface used can have any interface pattern; it is not examined by BPM. Therefore, we can just use “stateless”, or whatever the existing interface pattern is using.
The Operation Mapping I am using is very simple; it uses a key then use the Fixed Values Lookup Table to find the value.
There is no need for any configuration in the Integration Directory. Operation Mapping is exposed as a web service and can be call by BPM directly.
BPM Process Design in NWDS
I will not go through the steps and how-tos of using the BPM design tool in NWDS, this information can be obtained from SAP Help and other SCN blogs and articles. However, I will only detail the how-tos of using Operation Mapping during the design phase.
The basics steps are:
- Import the WSDL of Operation Mapping.
- Create an Automated Activity in BPM to reference the imported WSDL.
- Create a new Service Reference using the type “WS” and “localhost”.
- Create the Input and Output Mappings. This is to:
- map the BPM local variable to the outbound interface of the Operation Mapping
- map the result of the mapping in the inbound interface to a local variable.
These mappings are normally drag-n-drop, one-to-one…very simple.
As you can see in the Composite Designer perspective, where we design our BPM process, there is no place where we can import Operation Mapping:
Therefore, we have to use the Process Development perspective:
You will be prompted for username and password to logon to the ESR. Select the Operation Mapping from the ESR by navigating the SWCV and namespace.
After importing, you should see something like the screen below with the WSDL of the mapping:
You can now switch back to the Composite Designer perspective and find the WSDL under Service Interfaces:
In BPM design tool, we create a mapping step of Automated Activity:
Select in the mapping WSDL in the drop-down for the Service Interface:
Select “New…” for Service Reference:
In the New Service Reference dialog box, check the “Local Provider System” and “Finish”.
Perform Input Mapping:
Perform Output Mapping:
That is it!