cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding collecting messages until you get particular payload

madhusudana_reddy2
Contributor
0 Kudos

Hi All,

I am having below requirement,

I am getting several messages from source, i need to collect all the messages, until i get TRAILER message

Condition is " COLLECT THE PAYLOAD UNTILL YOU GET DTS IN PAYLOAD(TRAILER)". so we need to collect header message and data messages untill you get trailer message.

message1(Header message which contains DHS)like below

20090604034447338isc DHS64 500d3100033d705050258002f86300

message2(data message which contains DDS) like below

20090604034447338isc DDS64 50031s000337050502580d0286300

20090604034447338isc DDS64 5003100033705050d25800286300

Message3(data message) like below

20090604034447338isc DDS64 500310003370505025800286300

20090604034447338isc DDS64 500310003370505025800286300

20090604034447338isc DDS64 5003100033d7050502580f0286300

Message4(trailer which contains DTS) like below

20090604034447338isc DTS64 500310003370505025800286300

So 4th message contains 3 charcters DTS, now i need to end the collecting messages in loop and need to send the collected messages to target.

Presently i am using PI7.1 which contains some patters to use as XPath for end condition purpose. I am using Contains Patter(CP) in loop end condition. according to my understanding the collection in loop has to end when it find DTS in message. but it is not working. Please share you ideas whether Contains Patterns suitable for my requirement

or not and is there any other better approach for this requirement?

Thanks & Regards,

Madhusudhan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can try with following approach:

1. Define A Data type with Additional Filed at last named Trailer.

2. Call a Message Mapping outside the BPM before message enter BPM.

3. Set The value of this field to 1 when DTS received in last string.

4. This field value will be used in BPM to stop collecting messages in BPM.

Hence an Additional Mapping before BPM + standard BPM Collect Pattern ( Payload Dependent) should work for your scenario.

Please try.

Regards,

Anurag Garg

prasannakrishna_mynam
Contributor
0 Kudos

Hello,

Try with this CP apprach with wild card,

'DTS ' - followed and preceded by any characcter string (or)

'#DTS++#'- follwed by space and two digits and space

refer the follwoing for further help

Regards,

Prasanna

madhusudana_reddy2
Contributor
0 Kudos

Hi,

Thanks for your valuable reply,

As you told i implemeted the logic for loop end condition like below

Value CP 'DTS'

Value is condition variable in xpath according to PI7.1.

Now according to above xpath, if DTS found in payload at any place. The loop has to end, but now even there is no DTS in payload the loop is getting complete and messages are going to target.

Thanks,

Madhu

Edited by: Madhusudana Reddy on Aug 5, 2009 9:13 PM

Edited by: Madhusudana Reddy on Aug 5, 2009 9:24 PM

Edited by: Madhusudana Reddy on Aug 5, 2009 9:25 PM

prasannakrishna_mynam
Contributor
0 Kudos

Hi,

It is working ok if i test the CP functionality in Report program with these expressions 'DTS' and '#DTS#**', try with the later part.

Regards,

Prasanna

madhusudana_reddy2
Contributor
0 Kudos

Hi Prasannakrishna,

Now it is working fine with !(Value CP 'DTS')

thanks all.

Madhu