The below mentioned scenario describes when and how to use ccBPM in SAP XI/PI.
(BPM in PI is called as ccBPM. So wherever the term BPM is used in this blog, consider it as ccBPM.)
Scenario: We need to merge the multiple files coming from different file servers/systems into the SAP PI system and send the single output file to the receiver system. In this case, BPM is required for merging the files.
There are lot of other scenarios when we need to use BPM. i.e. Splitting of messages, Merging of messages, Multicast a message to various systems, Send an Alert, Make the asynchronous call into the synchronous,etc.
In this scenario, we are merging the three files coming into the PI system with the help of BPM and sending the single output file to the receiver system.Both the sender and receiver are Asynchronous applications.With the help of this scenario you will get to know the basic steps of BPM and also the use of Fork and correlation in BPM.
ENTERPRISE SERVICE REPOSITORY: Design Time Objects
STEP 1: Create the Software Component in SLD (System Landscape Directory) and then import it in ESR.
STEP 2: Create the Software Component Version inside the Software Component imported from SLD.
STEP 3: Create the Namespace under the Software Component version.
STEP 4: Create DATA TYPE.
Data Type – Input File1:
Data Type – Input File 2:
Data Type – Input File 3:
Data Type – Output File:
STEP 5: Create MESSAGE TYPE.
Message Type – Input File 1:
In the same way, create the Message Type for – Input File 2, Input File 3, Output File. i.e.
- InsuranceDetails_OB (MT for File 2)
- ProjectDetails_OB (MT for File 3)
- EmpCompleteDetails_IB (MT for Output File)
STEP 6: Create SERVICE INTERFACE.
Here we need to create three outbound asynchronous interface for picking up three sender input files, one inbound asynchronous interface for the receiving side and four asynchronous abstract interfaces because the Integration process do only understand the abstract interfaces. Abstract interfaces are those interfaces which do not have any direction.
1. Outbound Asynchronous Interface: Sender side
In the same way create two more asynchronous outbound interface as shown above.i.e.
2. Abstract Asynchronous Interface: Integration Process
3. Inbound Asynchronous Interface: Receiver side
STEP 7: Create MESSAGE MAPPING
Create 3:1 Message mapping as the source is having 3 input messages and target is having 1 message.
Make sure signature tab should be like as mentioned in the below screenshot.
STEP 9: Create INTEGRATION PROCESS
Integration Process is created in this scenario as shown below:
STEPS To Create the Integration Process:
Create the Integration Process under the same namespace and SCV in which above all the objects created as shown below.
After creating the Integration process, it will take you to the below mentioned screen. Now it is ready to design the integration process.
Below are the following steps which needs to be taken care while designing the Integration process:
- First step is to create the container elements. In order to process the message into BPM, it is required to create the container elements because it’s not possible to use the abstract interface directly. Container elements are nothing but just the variables which keeps the reference of the abstract interfaces and needs to be declare during the design time.
In the below screenshot CompleteEmpDetails, EmpDetails, InsDetails & ProjectDetails are the container elements of type Abstract Interface assigned to the respective Abstract Interfaces created above.
- Second step is the Receiving Step.
To process the messages into BPM, Integration process should receive the messages. To do this need to insert RECEIVE step. But here in this scenario there are three input messages, so we need to have three receiving steps. In order to this, first insert FORK and then create three branches into it as shown in the below screenshot.
(When to use FORK: You need to use a FORK whenever you want to continue a process in branches that are independent of each other.For example: To communicate with three different systems that are independent of each other. The branches of the FORK join in a union operator.)
Insert RECEIVE step in the three branches of FORK as shown below.
In the Properties Window, click help against Message as shown above. After clicking, you can see following screen that shows Interface Variable . Here it will show all the Container elements that are declared as Abstract Interface category. From this container element list choose appropriate element that should refer to original message. Below screen shows the same.
In the above screenshot, you can see the list of container elements as assigned to the abstract interface. From this container variable list choose the appropriate element that should refer to original message. In the same way assign the container element to rest of the receivers as shown below in the Receive STEP1, Receive STEP 2 & Receive STEP 3.
In the same Properties Window, there are two more rows i.e. Use Correlations and Activate Correlations as shown in the above screenshot. Brief detail description about the correlation as given below.
A correlation enables you to identify objects that belong together, for example, a quotation and the relevant sales order. This involves correlating the objects by using one or more common elements, for example, the quotation number. When you define a Workflow, you can specify the object that the Workflow must wait for, without having to enter the ID of the object.
You can define a correlation with the correlation editor. In the correlation editor, first you need to define the correlation name. Then Mention the container elements under correlation container. There you have to give the common field which is having in both the input files. Select the input messages interfaces in the involved messages. In the properties you need to mention the value. Select the value from the expression editor.
Steps to define a Correlation:
Go To -> VIEW -> Correlation Editor
Receive STEP 2 :
Receive STEP 3 :
- Third step is the Transformation Step. If you want to collect messages, split messages you need to use Transformation step after the receive step that refers to N: 1 Interface Mapping or 1: N Interface Mapping created.In this step, you need to configure the Interface mapping as created as shown below.
- Last step is the Send Step. Once messages are received and processed then these processed messages are to send by the BPM using Send Step.
STEP 10: Save and Activate all the changes.
ESR Part is over.
INTEGRATION DIRECTORY: Configuration Objects
Click here for ID objects . Due to size limit, I won’t be able describe the ID Objects in the same blog.
Please feel free to disagree, ask questions, provide your views.