Skip to Content

Dear SCN users,

This blog gives the step by step approach of collecting messages based on correlation and count(Aggregator pattern).

Prerequisties:

1.NWDS Installation.

2.PI 7.31 and above with NWBPM installation

In this scenario I am collecting messages based on product and number of messages collected will be 3(count = 3)

ESR Objects:

Below is the MT Type I have created.

Input:

/wp-content/uploads/2014/06/1_474561.jpg

Output:

Below is the MT type for Output

/wp-content/uploads/2014/06/1_474561.jpg

Based on the product Brand Messages will be collected(For Example all LG Products will be collected together)

1.we need to create 4 service interfaces as shown below

Outbound Interface for sending data to PI,Refering to Input Message type

/wp-content/uploads/2014/06/1_474561.jpg

Inbound Interface to send message to NWBPM.Here the pattern should be XI 3.0 Stateless and Refering to Input Message type

/wp-content/uploads/2014/06/1_474561.jpg

outbound Interface to send message from NWBPM to PI.Here also pattern should be Statelss XI 3.0 compatitable and Refering to Output Message type

/wp-content/uploads/2014/06/1_474561.jpg

Inbound Interface to send message from PI to File system Refering to Output Message type

/wp-content/uploads/2014/06/1_474561.jpg

NWDS Steps:

1.Open NWDS->Select perspective->development

2.Then new project,and select lanes and name them

3. And service interfaces should be imported from PI.To import service interfaces right click on service interface/mapping and import them from PI.

Untitled.jpg

Below is the pattern for collecting based on count and correlaction.

Untitled.jpg

Here 4 data artifcats are used

1 is input message artifact

2 is Output message artifact

3 count- to keep the count of messages

4 Product- to keep the correlation Id(product)

Start Message:

Here the Event trigger will be the start which will refer to Inbound Service Iterface.

Untitled.jpg

In the output mapping start Event Incoming message is mapped to the Input data artifact as shown belowUntitled.jpg

And count is intialised with the value of zero

Untitled.jpg

And product is assigned with the product Brand(based on which messages will be collected)-correlation.

Untitled.jpg

Count Event(Automated activity):

In the count Event,the count will increment based on the collected messages.Here automated activity or mapping activity can be used.

Untitled.jpg

Here I selected Sampletimer as interface which is not going to impact anything.And in the Output mapping Count is incremented using add Function

Untitled.jpg

Intermediate Message:

Here the messages are collected based on correlation.

The event trigger here will be same as that of start.

In the Output mapping ,Input message is mapped to the input data artifact using append assignmentUntitled.jpg

And in the correlation condition the Incoming product brand is compared with product assingned in start event.If the condition is true,messages are collected.

Untitled.jpg

Exclusive Choice Event:

This is used to check the condtion and loop accordingly.

If the count<3,it is looped to Intermediate message ,If the count=3 then mapping event is looped.

Untitled.jpg

Mapping Event(Automated Activity):

In mapping event,the mapping program as interface is selected.

Untitled.jpg

1.From Input artifact to the input of the mapping in the input mapping tab

Untitled.jpg

2.From output of the mapping to the output artifact in the output mapping tab

Untitled.jpg

Message Sent(Automated Activity):

This activity is automated activity which is used to send the message to PI.

Here BPM Outbound interface is selected as interface

Untitled.jpg

And in the input mapping ,from the output artifact message is passed to the interface.

Untitled.jpg

Service References:

For mapping and message sent event service refernces should be configured.

For Mapping event,select new service reference group and select local host option

For Message event select new service reference group and select XI details and fill details as shown below.

Untitled.jpg

Integration Directory Objects:

In ID 2 Icos need to be configured.

One for sending message to BPM

Untitled.jpg

Below is the Soap receiver channel to send message to BPM

/wp-content/uploads/2014/06/1_474561.jpg

In second ICO,message is sent from BPM to PI to IFile interface.

Untitled.jpg

Testing:

I am sending 6 messages corresponding to 2 different product brands,3 are correlated collected as shown below

/wp-content/uploads/2014/06/1_474561.jpg

To report this post you need to login first.

11 Comments

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

    1. pavan thiruveedula

      Hi Raghu,

      I am getting below error while testing the interface.

      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 /{http://NWBPM_POC}SI_Product_Details_Async_IN_To_NW_BPM. Found: BindingData null, interfaceMapping null interfaceDefinition null



      I am using “start” as a event trigger in both start & intermediate message steps. Please help me.

      (0) 
  1. Rohini Potham

    Hi Raghu,

    I tried to replicate your scenario for demo purpose, but I am facing the below issue.

    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 /{http://NWBPM_POC}SI_Product_Details_Async_IN_To_NW_BPM. Found: BindingData null, interfaceMapping null interfaceDefinition null


    The receiver BPM channel for 1st IFLOW is throwing above error.

    It is not even entering the BPM.


    can you please let me know any inputs on how to resolve the issue.


    Regards,

    Rohini

    (0) 
  2. nunu agarwal

    Hi Raghu,

    Thanks for sharing document,
    since i am new to BPM, can you help me with OM here.
    As in which SI I need to import, As far i know SI are all async morover interface pattern is different so how would OM will look like which I need to import in NWDS
    one last  question, do we need to mention the created OM in ICO also?

    Thanks
    Neha

    (0) 
    1. Raghuraman S Post author

      Hello Nunu,

      Good Day!!!

      OM  need to be imported in mapping and can be consumed as an activity.

      And since your using mapping in NWBPM , its not required to be mentioned in ICO.
       

      (0) 
  3. nunu agarwal

    Hi Raghu,

    Thanks for the reply.
    while making OM in ESR which MM should I specify?
    moreover, if you dont mind can I connect you through ur perosnal email id?

    (0) 

Leave a Reply