cancel
Showing results for 
Search instead for 
Did you mean: 

Aggregator pattern

former_member186851
Active Contributor
0 Kudos

Dear Scn users. 

I just tried a aggregator pattern of collecting messages based on common Id.And also collecting only messages on count.

Below is my pattern

I am confued like what condition I should give in correlation condition to collect the messages.

I tried by giving condition like this

 

Class="12"

My requirement is  to collect the messages having class 12

And only 3 messages.

How to give condition for correlation and how to increment the count based on this condition

Please help me on this

Thanks & Regards

Raghuram S

SAP PO consultant.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Manish and Siddhant,

I completed the pattern.

I just moved counter and IME out of the loop,Its working Fine.

Thanks a lot for the support.:)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

There are couple of ways of doing it

If you are using 731 SP06 OR higher you can use condtiional start(Both Intermediate and start event share same trigger but intermediate event gets preference). Keep on adding 1 to the counter field which is in the main document. In the correlation condition use expression as class=12.Before intermediate event use a exclusive choice decision box to either go to intermediate msg or invoke the service.

So first time message comes counter will be 1 and the exclusive chice will direct to intermediate msg, second time since the intermediate event is waiting so will get pref, so will get invoked and that can increment till next time when counter =3 which the exclusive choice will direct to service and not intermediate msg any more.

Thanks

Manish

former_member186851
Active Contributor
0 Kudos

Hello Manish,

I just changed the pattern as you told.I bought the counter at first and then the loop.

Now the process instance is only one,but no message is coming out of BPM.

where elst I could be wrong?

Former Member
0 Kudos

HI Sri,

Difficult to say what is happening but one thing is if you have put a conditional start then it will take preference and you will not see a process, so pl make sure your correlation condition is good, time being put your correlation condition in case of intermediate message as false and trigger your process.

Thanks

Former Member
0 Kudos

Hi,

you have to do things

1)Whenever u recieve an item u append a counter(field) by 1, which can be a field in your document or u can append every item to a itemlist.

2)In your correlation condtion put one more condition that counter =3 or size = 3 in addition to class=12.

Thanks

Manish

former_member186851
Active Contributor
0 Kudos

Hello Manish.

Thanks a lot..

I used 3 data Object.

Count-I intialised this with zero at the start event.

then in the Count event I am just adding it with 1,to increment the count value

Class-am just assigning a value 12 to it.(In Intermediate Step)

ClassNo-Am getting the first value from queue.(In Intermediate Step)

and in the correlation condition of intermediate message I am defining as

Class=ClassNo

When I trigger the message,its always taking second value,I mean if the second value is 12 ,3 messages are appended and sent.

Where I am wrong.

Can you please help me on this..

Thanks.

former_member191643
Active Contributor
0 Kudos

Your are initializing the counter in start and incrementing the value in the intermediate step. It will obviously give you the incremented value in the next step.

former_member186851
Active Contributor
0 Kudos

Hello siddhant,

thanks,

then can you can please tell me what condition I should give to collect only 3 messages of the particular class

former_member191643
Active Contributor
0 Kudos

After initializing the counter, use a mapping activity to increment the counter.

After this, use an exclusive choice to check if the value has reached 3. The branches coming out of the exclusive choice: there will be 2 possibilities. either the counter has reached 3 or it has not. if the counter has not reached 3, then connect the branch out of the exclusive choice back to the incrementing step.

if the value has reaached 3, then give the normal flow. Will look something like this:

The condition evaluation of the exclusive choice will be like this:

I really hope i am making some sense.

/Sid

former_member186851
Active Contributor
0 Kudos

Hello Siddhant,

But how to collect the messages based on the condition?