Summary:
This document provides step by step guidance on how to implement a process flow to merge files using SAP NetWeaver BPM.
Contents
1 Interface Description.
2 Prerequisites
3 SAP PI I-Flows
4 Integration Design Configurations
4.1 Data types
4.2 Message Types
4.3 Service Interfaces
4.4 Message Mappings
4.5 Operation Mappings
5 Integration Flow Configurations
5.1 Integration Flow from NWPI to NWBPM for File 1
5.2 Integration Flow from NWPI to NWBPM for File 2
5.3 Integration Flow from NWBPM to NWPI for Final Merged file
6 Integration Process Flow
6.1 Process Diagram
6.2 Process Steps Definition
7 Testing the Scenario
8 Monitoring
9 References
We will develop a scenario which will merge 2 simple emp files containing employee details and his company information in 2 separate files. These two files are merged into single file. The whole process in done using NWBPM
Input File 1:
EmpID: String
EmpName: String
Place: String
Input File 2:
EmpID: String
Company: String
DOJ: String
For this scenario, we need 3 integration flows.
This is used to process employee file1 details and send this data to NWBPM
2. Integration flow for file2 from SAP PI to NWBPM (Input File2)
This is used to process employee file1 details and send this data to NWBPM
3. Integration flow from NWBPM to SAP PI (Output File after Merging)
This flow is for sending the merged file from NWBPM to NWPI.
Create Data type for File 1
Create Data type for File 2
Create Data type for Super Data Type
Create Data type for Output file
Create Message type for File1
Create Message type for File2
Create Message type for Super Data type (DT_Super_Emp)
Create Message type for Output
Create Service interface for File1 with Category as “Outbound”
Create Service interface for File2 with Category as “Outbound”
Create Service interface for Super Message type which will trigger the NWBPM.
Make sure the Interface pattern is “Stateless (XI30-Compatible)”.
For category we can either use “Inbound” or “Abstract”. Here I am using Abstract for the service interfaces which are used in BPM to avoid the confusion.
Create abstract service interface for the output file after merge from BPM. Select the interface pattern to “Stateless (XI30-Compatible)”.
Create an inbound service interface which is used at the final integration flow from NWBPM to NWPI.
Create message mapping for the input message type (For File1) to Super Message type and map the correlation ID.
Note: Here in this mapping only File 1 details are mapped and also we need to map the CorrelationID with the EmpID.
Create message mapping for the input message type (For File2) to Super Message type and map the correlation ID.
PS: Here in this mapping only File 2 details are mapped and also we need to map the CorrelationID with the EmpID.
Create Operation mapping for the Outbound Service interface (For File1) to Super service interface. This will send file1 details to NWBPM.
Create Operation mapping for the Outbound Service interface (For File2) to Super service interface. This will send file2 details to NWBPM
Now we are done with ESR part.
The below details are configured for this integration flow. This will send file1 details to NWBPM.
Sender Component: BS_Sender
Sender Interface: SI_Emp_File1
Receiver Component: NWBPM
Receiver Interface: SI_Super_Emp_Abs
Operation Mapping: OM_Emp_File1
Configure sender file channel with FILE adapter and receiver channel with SOAP adapter.
Provide the below URL for Target URL and use logon data to non-SAP system.
“http://servername:port/MessagingSystem/receive/JPR/XI”
Use “X1 3.0” for Message Protocol for receiver SOAP channel.
The below details are configured for this integration flow. This will send file2 details to NWBPM.
Sender Component: BS_Sender
Sender Interface: SI_Emp_File2
Receiver Component: NWBPM
Receiver Interface: SI_Super_Emp_Abs
Operation Mapping: OM_Emp_File2
Configure sender file channel with FILE adapter and receiver channel with SOAP adapter.
Provide the below URL for Target URL and use logon data to non-SAP system.
“http://servername:port/MessagingSystem/receive/JPR/XI”
Use “X1 3.0” for Message Protocol for SOAP receiver channel
The below details are configured for this integration flow. This will send merged file from BPM to PI.
Sender Component: NWBPM
Sender Interface: SI_Emp_Output_Abs
Receiver Component: BC_Receiver
Receiver Interface: SI_Emp_Output
Configure receiver file channel with FILE adapter and sender channel with SOAP adapter.
Use “X1 3.0” for Message Protocol for sender SOAP channel.
The below process flow is designed for our scenario.
Please note here I am explaining the properties of the steps which I have used for the process flow.
For detailed explanation of to create process component, please refer William’s Lee article
To start working on the process flow, first need to import the service interfaces from ESR to Composite Designer. And also need to create service groups for the service interfaces.
The below service interfaces are imported from ESR to BPM component.
SI_Emp_Output_Abs
SI_Super_Emp_Abs
Here 2 data objects “IncomingMesg” and “OutgoingMesg” are allocated with input and output data types.
START STEP:
Create trigger with super service interface (SI_Super_Emp_Abs)
The message which is received by Start trigger is mapped to the data object “IncomingMesg”.
Please note each time only one message is received, either EMP File1is received or EMP File 2 is received.
EXCLUSIVE CHOICE: (Check if File1 or File2)
For defining the condition for “No”, use the standard function which is available within the BPM. “isSet” function will check if the field is filled with value or not? As we are receiving only one message at a time from Incoming message we need to evaluate if the received message is for file1 or for file2. So based on the condition Yes, it will map for file1 and the condition is not satisfied by default it will map for file2.
MAPPING STEP: (Used for both File1 and File2)
So now based on the condition we now know that for what message is received. So do the mapping from IncomingMesg—File1 to OutgoingMesg—File1
Like above do the same for File2 mapping.
EXCLUSIVE CHOICE: (Check if both files are received)
Now we need to check if both file1 and file2 are received. If yes then the output is send to NWPI and if No, need to wait for the next message. To check if both messages are received, I am comparing the EmpID’s of both the files. If both of them are equal we can send to “Automated activity -- OutputFile” else “Intermediate Message Event” will trigger.
Automated Activity: (OutputFile)
For this step, select final service interface which is sent out from BPM (SI_Emp_Output_Abs)
Click on Service reference and provide the “XI” for the Type and give the Sender Component.
Now map the “OutgoingMesg” details to Final output message type.
So the final output structure is having both the file contents in a single file.
Intermediate Message: (Wait for File)
For trigger, need to select the same trigger which is used in Start Event.
The same mapping what we have used in Start step is done here. Map the received message to the data object “IncomingMesg”.
Now we need to define the correlation to ensure the incoming messages are assocaited with the right process instance.
Now we are done with all the steps. Build and deploy the process.
The below files are used for testing
File 1:
File2:
Output File.
You can monitor the message flows in Adapter engine message monitoring.
Monitoring -- ProcessTasks--Manage Process
If we want to check the data, select “Context Data” and select the data object and you can view the data present in the data variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |