Skip to Content


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

 

1       Interface Description

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

2     Prerequisites

  1. Check for proper connection is established between NWDS and PI Enterprise Service Repository (Window–>Preferences–>Web-services–>Enterprise Service Browser).

  /wp-content/uploads/2014/11/21_593502.jpg

  1. Check for a proper connection is established between NWDS and Integration Directory (Windows–>Preferences–>PI Tools Configuration–>Connections).

/wp-content/uploads/2014/11/22_593503.jpg

  1. Check proper PO system details are provided to deploy the NWBPM process component in PO (Windows–>Preferences–>SAP AS Java)

  /wp-content/uploads/2014/11/23_593523.jpg

3       SAP PI I-Flows

For this scenario, we need 3 integration flows.

  1.    Integration flow for file1 from SAPPI to NWBPM (Input File1)

            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.

4       Integration Design Configurations

       

4.1    Data types

  Create Data type for File 1 

                           /wp-content/uploads/2014/11/1_593524.jpg

Create Data type for File 2

                

                /wp-content/uploads/2014/11/2_593527.jpg

Create Data type for Super Data Type

                          /wp-content/uploads/2014/11/3_593585.jpg

     Create Data type for Output file

               

                              /wp-content/uploads/2014/11/4_593586.jpg

4.2     Message Types

      Create Message type for File1

                           /wp-content/uploads/2014/11/5_593587.jpg

    

Create Message type for File2

                          /wp-content/uploads/2014/11/6_593588.jpg

     Create Message type for Super Data type (DT_Super_Emp)

                         /wp-content/uploads/2014/11/7_593589.jpg

    

       Create Message type for Output

                          /wp-content/uploads/2014/11/8_593590.jpg

4.3     Service Interfaces

      Create Service interface for File1 with Category as “Outbound”

       

                      /wp-content/uploads/2014/11/9_593597.jpg

      Create Service interface for File2 with Category as “Outbound”

          

                       /wp-content/uploads/2014/11/10_593598.jpg

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.

              

                      /wp-content/uploads/2014/11/11_593599.jpg

           

   Create abstract service interface for the output file after merge from BPM. Select the interface pattern to “Stateless (XI30-Compatible)”.

                      /wp-content/uploads/2014/11/12_593600.jpg

      Create an inbound service interface which is used at the final integration flow from NWBPM to NWPI.

                      /wp-content/uploads/2014/11/13_593601.jpg

4.4     Message Mappings

             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.

                     /wp-content/uploads/2014/11/14_593602.jpg

                    

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.

                    /wp-content/uploads/2014/11/15_593604.jpg

                 

4.5     Operation Mappings

                Create Operation mapping for the Outbound Service interface (For File1) to Super service interface. This will send file1 details to NWBPM.

         

                     /wp-content/uploads/2014/11/16_593605.jpg

Create Operation mapping for the Outbound Service interface (For File2) to Super service interface. This will send file2 details to NWBPM 

                      /wp-content/uploads/2014/11/17_593607.jpg

Now we are done with ESR part.

5       Integration Flow Configurations

5.1     Integration Flow from NWPI to NWBPM for File 1

                       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.

/wp-content/uploads/2014/11/18_593615.jpg

       

            

5.2     Integration Flow from NWPI to NWBPM for File 2

                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

/wp-content/uploads/2014/11/19_593616.jpg

5.3     Integration Flow from NWBPM to NWPI for Final Merged file

                    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.

/wp-content/uploads/2014/11/20_593617.jpg

6       Integration Process Flow

6.1     Process Diagram

                     The below process flow is designed for our scenario.

                /wp-content/uploads/2014/11/24_593618.jpg

6.2     Process Steps Definition

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.

                     /wp-content/uploads/2014/11/25_593619.jpg

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.

        

           

/wp-content/uploads/2014/11/26_593620.jpg

START STEP:

                   

/wp-content/uploads/2014/11/27_593645.jpg

Create trigger with super service interface (SI_Super_Emp_Abs)

/wp-content/uploads/2014/11/28_593646.jpg

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.

/wp-content/uploads/2014/11/1_593524.jpg

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.

/wp-content/uploads/2014/11/29_593647.jpg

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

/wp-content/uploads/2014/11/30_593648.jpg

Like above do the same for File2 mapping.

/wp-content/uploads/2014/11/31_593649.jpg

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.

/wp-content/uploads/2014/11/32_593650.jpg

Automated Activity: (OutputFile)

For this step, select final service interface which is sent out from BPM (SI_Emp_Output_Abs)

/wp-content/uploads/2014/11/33_593658.jpg

Click on Service reference and provide the “XI” for the Type and give the Sender Component.

/wp-content/uploads/2014/11/34_593659.jpg

Now map the “OutgoingMesg” details to Final output message type.

/wp-content/uploads/2014/11/35_593660.jpg

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.

/wp-content/uploads/2014/11/36_593661.jpg

The same mapping what we have used in Start step is done here. Map the received message to the data object “IncomingMesg”.

/wp-content/uploads/2014/11/37_593662.jpg

Now we need to define the correlation to ensure the incoming messages are assocaited with the right process instance.

/wp-content/uploads/2014/11/38_593663.jpg

Now we are done with all the steps. Build and deploy the process.

7       Testing the Scenario

        The below files are used for testing

                                    

File 1:

/wp-content/uploads/2014/11/39_593664.jpg

File2:

/wp-content/uploads/2014/11/40_593665.jpg

Output File.

/wp-content/uploads/2014/11/41_593666.jpg

8       Monitoring

You can monitor the message flows in Adapter engine message monitoring.

/wp-content/uploads/2014/11/42_593668.jpg

Monitoring — ProcessTasks–Manage Process

/wp-content/uploads/2014/11/43_593670.jpg

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.

/wp-content/uploads/2014/11/44_593671.jpg

9 References

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90308598-4b8d-2f10-4a9a-b78973859665?QuickLink=index&overridelayout=true&55357833497094

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60bf80bb-736f-2f10-4593-a57a6ccb0193?overridelayout=true

http://scn.sap.com/docs/DOC-27342

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. jake sully

    Hi Leela,

    I am getting a communication error between SAP PI AEX and BPM components I followed exact steps as you/bill provided above any idea on below error?

    Thanks

    Jake

    Delivery of the message to the application using connection JPR failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing inbound message. FaultException: com.sap.aii.proxy.xiruntime.core.ESPXISystemFaultException: Error encountered during processing of XI request message in inbound ESP; Hint: com.sap.engine.interfaces.webservices.runtime.RuntimeProcessException: Unexpected uriID ‘/{urn:http://xyz.com/xi/XIMapping/mergebpmpoc}SI_Super_Emp_Abs’. Found: BindingData ‘null’, interfaceMapping ‘null’ interfaceDefinition ‘null’

    (0) 
  2. Sai K

    Hi Leela,

    Thanks for a descriptive blog.

    Quick question:

    The scenario shown here is for input files having 1..1 row. I am trying a scenario where input files have multiple rows.

    • I am unable to find a way to modify the above approach to fit multiple rows
    • Is there a way to leverage a standard pattern?

    I think we can write a EJB custom function and use it in BPM. But, i am trying to avoid this route. 🙂

    Thanks,

    Sai

    (0) 

Leave a Reply