cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing of time taken by a while loop in bpm

Former Member
0 Kudos

Hi ,

I have a busniess process ,and my receive step is defined in a while loop.

so it starts with a while loop.

I want to keep a condition on the while loop that it should receive the messages only for a period of 1 hour ,and if it exceeds this period it should end up the process triggeringa mail.

I mean to say if there are 12 records to be processed through the while loop ...and if I receive only 11 records ..it will be waiting for that final record in an infinite loop ..so I dont want that ...instead if the total no of records are reached then it should move forward ..If it is waiting for the missing records for an hour ..I should stop the process and trigger a mail to the queue monitor saying that record is missing...I have finished the process without this processing time condition successfully..

I am new to XI and I dont have any idea on how to capture this processing time of while loop.

can some one please help me out in this issue...

Thank you in advance...

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Even that does not work LATHIKA...

i wanted an alert only when total no of records is not reached..but here even if total records are there ..it is triggering an alert..which I dont want..

Former Member
0 Kudos

Raju,

You could deploy the Block step with a deadline Branch were you could define the time limit as 1hr and place the while loop inside one of the branch. add the logic of trigerring mail inside the Deadline branch.

Now Block step will take care of the time period and it will trigger the mail, since it starts only when you receive the first message.

Let me know if you have any doubts futher.

Regards,

Yuva

Former Member
0 Kudos

hi raju,

as u said u have already done a part of the scenario...like waiting for a specific number of messages, so for the other requirement u can insert a deadline branch and give 1 hr as ur deadline duration.

for triggering a mail indicating hw many msges have been collected by that time: u can use a counter (container operation) after receive step that counts the number of messages and as the deadline is reached trigger an alert that is sent thru mail indicating the number of messages.

[reward if helpful]

regards,

latika.

Former Member
0 Kudos

Hi Lathika,

The thing is the two things are parallel...if the total no of records are reached ..then it should ga ahead ..and move out of the while loop to other steps..

it is not that even if all the records are reached it should wait for one hour...it is only when there are some misiing records we are giving the max time limit as 1 hour...with in this one hour if the count is not matching with teh total no of records ..then it should end up the process in the while loop itself triggering a mail...

Hope it is clear now..if you have any things to be clarified..pla let me know ...I shall reply back..

Former Member
0 Kudos

hi raju,

for this use fork. give the end condition as counter = 12. necessary number of branches = 2. increment this counter each time a message is received by placin it after the receive step. in other branch of the fork have a block containing the deadline branch waiting for 1 hr. as soon as the deadline is reached cancel the process/trigger alert etc by using control step.

[reward if helpful]

regards,

latika.

Former Member
0 Kudos

Hi Yuvraj/Lathika,

Thanks for the help...I think your suggestions should work...

Can I go ahead like this..I have already finished my exrlir part i.e comparing counter with the total number of records in the while loop which is working perfectly..so I need not worry about that and my while loop only allows the total number of records..

so in this while loop

1.I will keep a fork...in one of the branches I shall keep existing process..(i.e capturing of records ..and adding the counter.

2.In the second branch I shall keep a block ..containg dead line branch for one hour..

so if the no of records reached then ...it will come out of while loop...

if it is there in the while loop for one hour ..then it will trigger the mail..

am I correct..plz correct if I am wrong...

Former Member
0 Kudos

hi raju,

there is no need to keep the while loop... the end condition of the fork is the one that controls the number of messages collected and u cant escape it since if 12 messages are collected u dnt want to wait for one hr and continue. therefore u cant skip mentioning the end condition. the while loop is a redundant step in this.

so fork shud be ur 1st step.

[reward if helpful]

regards,

latika.

Former Member
0 Kudos

Hi Latika,

Yeah I understand we can go with fork but why I am going with this is ,I have already designed a Payload dependent loop ,by using while loop.so it makes my job simple ...

Now I am converting it to time dependent loop,so only the final question I have is...In the time dependent loop documentation ..they have taken it as infinite loop and only kept the time limit in the deadline branch...so when the deadline reaches they trigger something.

If you go to the documentation of time dependent loop(http://help.sap.com/saphelp_erp2005vp/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm) ..they took the infinite loop...in this loop if I mention the counter ..and if this record count triggers before the time limit...it should come out of the block...would it work this way ?

Thanks a lot...

Former Member
0 Kudos

hi raju,

if u are planning to jus change the condition in loop from 1 to 12 i dont think its goin to wrk coz even if it collects 12 messages the block will trigger alert after an hr... which is not ur original requirement rite?

so go with fork because u want "only one branch that is completed earlier" to decide the process further.. the solution i mentioned earlier.

[reward if helpful]

regards,

latika.

Former Member
0 Kudos
Former Member
0 Kudos

hi

could please elabarate and write to krushi.sakriya@logicacmg.com.

so i can have a look regarding this....

regards,

KRUSHI

Former Member
0 Kudos

Hi Raju,

Just put a wait step in that loop ...after the wait step(set the timer as per req)....the processing will end the loop

Regards,

Sushil.