cancel
Showing results for 
Search instead for 
Did you mean: 

Using Correlations, Looping at Messages and forcing Serialization

Former Member
0 Kudos

Hello

Question 1) How do I ensure that when a message is sent by the R/3 system it is assigned to an existing instance of a BPM OR if there is none, a new instance is created.

My scenario is as follows:

A) - IDocs are being sent from R/3

B) - IDocs should be sent to the partner's web service sequentially and in the order received - it also has to be real-time (i.e. collect/timewait not an option).

Question 2) Given the above scenario, What are the steps in this BPM? - each IDOC has to be received and appended to the list of IDOCS (if there is no active instance of the BPM a new one should be created). At the same time, the BPM should be looping through the IDOC list and processing accordingly.

The documentation (online and how-to) regarding use of SWF_INB_CONF (new version) is not clear to me. Perhaps someone can provide better insight.

Thank in advance

Sincerely,

NM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Naomi,

To answer your first question, the trick is correlation. A correlation is an identifier that is used to group together logically related messages. In case you want a particular type of messages to be caught by an active BPM, they should be carrying same value for a certain field defined in the correlation editor. In order to collect all idocs of the same type, you can give message type as the correlation indicator while designing the BPM.

For your scenario, your BPM may contain an infinite loop containing receive idoc step , transform step and send step. The loop may have a time based or counter based end condition.

I hope this gives you some clues.

CHEERS

Amit

Former Member
0 Kudos

Thanks Amit... Very useful answer.

So what happens if there is no active BPM - how can I ensure that a new instance is started?

So far my BPM is as you described but the system throws an error upon receipt in the queue. Seems to me the system doesnt know it should start a new instance.

My correlation is the date - thinking is all IDocs received today are processed by the same BPM instance... doesnt seem to be working

BPM:

BLOCK <<

receive idoc (activate corr),

map,

send sync,

send resp asyn

>> ENDBLOCK.

Thanks again.

Sincerely,

NM

Former Member
0 Kudos

Hi Naomi,

<i>So what happens if there is no active BPM - how can I ensure that a new instance is started?</i>

The system automatically starts a new instance when it senses that there is no active bpm. Its surprising that in your case why it is not happening. Are you sure there is no active workflow instance ? (Check this on SWI1 transaction). If yes, is it showing any error? Also please let me know what kind of error are you facing.

CHEERS

Amit

justin_santhanam
Active Contributor
0 Kudos

Naomi,

Run the report RSWF_CRL_MAINTAIN and check is there any existing active correlations.

Best regards,

raj.

Former Member
0 Kudos

Hello Everyone!

Just giving an update and some lessons learned.

My process is now working.

What I did was create a block for correlation purposes only, then I created a loop within the block - this takes care of serialization.

The initial error I was having was because the block on it's own is not enough - neither is the loop on it's own. The former will cause errors in SMQ2 and the latter will create new BPM instances.

In addition, I configured SWF_INB_CONF such that the BPM will use only one configurable queue - which I have maintained. This is optional

Infitnite loops are messy so working on ways to avoid this.

Additional lessons learned (the annoying way)

1) BPM's will disable the start process trigger in your block if the you chose a mode other than 'default'.

2) Using a fork as suggested in other threads on the forum wont work. Cannot have one branch looping through the multi-list and another building the list. Even though this will activate in IR it will error out.

Thats all for now.

Thanks to Amit and everyone else for their insights...

Sincerely,

NM

bhavesh_kantilal
Active Contributor
0 Kudos

The Queue Handling feature introduced from SP 10 is seriosuly scary. I have gone through the how to guide and have been pulluing my hair out to make it work, but no luck.

Have you tried working with the Content Specific Queue etc?

Also, Have a look at the Buffering of your message and the how to guide for that. Also, if you want perfromance you can use the One Configrable Queue option.

Regards

Bhavesh

Former Member
0 Kudos

Hi Naomi,

<i>1) How do I ensure that when a message is sent by the R/3 system it is assigned to an existing instance of a BPM OR if there is none, a new instance is created.</i> - see if in BPM you are collecting the idocs, then you will specify how the BPM should decide to stop collecting it based on some counter value or some timeperiod.....so when this end conditon of BPM is true, BPM will stop collecting idocs and process your idocs........after this if any idoc is received by XI, a new BPM process will be instatiated by XI.......it is done automatically - you dont have to do anything for it..........

<i>2) Given the above scenario, What are the steps in this BPM?</i> your bpm will have a for loop to receve step to receive idoc then after the for loop you will have a transform step to perform mapping and then a send step to send the output file.

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Hi Rajeev...

Thanks for responding.

Unfortunately collect/time wait is not an option - it has to be real-time.

If that was the case, I wont be pulling my hair out.

Sincerely,

NM