Aggregator Pattern in NWBPM
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:
Output:
Below is the MT type for Output
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
Inbound Interface to send message to NWBPM.Here the pattern should be XI 3.0 Stateless and Refering to Input Message type
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
Inbound Interface to send message from PI to File system Refering to Output Message type
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.
Below is the pattern for collecting based on count and correlaction.
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.
In the output mapping start Event Incoming message is mapped to the Input data artifact as shown below
And count is intialised with the value of zero
And product is assigned with the product Brand(based on which messages will be collected)-correlation.
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.
Here I selected Sampletimer as interface which is not going to impact anything.And in the Output mapping Count is incremented using add Function
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 assignment
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.
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.
Mapping Event(Automated Activity):
In mapping event,the mapping program as interface is selected.
1.From Input artifact to the input of the mapping in the input mapping tab
2.From output of the mapping to the output artifact in the output mapping tab
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
And in the input mapping ,from the output artifact message is passed to the interface.
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.
Integration Directory Objects:
In ID 2 Icos need to be configured.
One for sending message to BPM
Below is the Soap receiver channel to send message to BPM
In second ICO,message is sent from BPM to PI to IFile interface.
Testing:
I am sending 6 messages corresponding to 2 different product brands,3 are correlated collected as shown below
Good one. Thanks for sharing
Hi Raghu,
very well explained. Thanks!!!
Regards,
Rashmi Joshi
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.
Hello Pavan,
Did you maintaing proper Endpoint and channel with XI 3.0 protocol?
Hi Raghu,
I have maintained the correct endpoint in BPM receiver channel. Channel status also good. Attaching the screen shots.
Hello Pavan,
Did you maintaing Local Provider System for Operation mapping in the NWBPM process?
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
Hello Rohini,
check the channel protocol and are using any mapping?
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
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.
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?