on 11-16-2006 2:04 AM
Based on sap's documentation, loop in bpm works as While, Can anybody explain how to exit a loop in bpm similar to break statement in While loop? Is cancel the right step to use? will it cause potential issues then terminte the bpm normally(Stop)?
Thanks,
Hi,
The "cancel process" option of the control step abruptly terminates the entire process and sets the status to "logically deleted" as per the documentation. Moorthy - if you have found a way to limit the scope of the control step to a block please advise - it does not work for me nor to I see any option for it (I am on SP16 so maybe it is in later SP).
Anyway - when a bpm completes normally the status is set to "completed".
I would suggest that the use of the "cancel process" in a control step is an extreme reaction to a catastrophic failure in your BPM that is unrecoverable. Not the situation that you have. Surely you can make use of local variables, switch statements and loop control to define the proper logical path through your BPM without resorting to canceling the process.
Anyway - the short answer to your original question is this - There is nothing similar to a break statement in a loop control. Cancel process (or cancel step) is not the right way to terminate a loop or step in normal behaviour. It will most likely NOT cause any problems and it WILL terminate the BPM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On the assumption that your "break" condition occurrs in the middle of the processing that you are doing in the loop and is not something that you can simply add to the loop condition, and that the condition to cause your "break" is not actually an exception, you could simply just keep processing in another branch of your switch and set a loop terminator condition in the "break" branch which you then add to your loop conditions.
example:
loop while x == 'y' {
if (a==b) then x = 'n' // effective break
else {
continue processing
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
The break I want is an normal exit, not an exception, basically I used an switch inside my loop, in otherwise branch, I do nothing and want to continue looping, in the first branch(equal to if statement), I want to exit the loop and go to the end of bpm(exit), so to rephrase my question, is it same to use control to cancel bpm than normally end the bpm(stop)? will it affect the send step before the control to cancel bpm?
Thanks,
Hi,
Adding to moorthy's answer, Control Step is the answer to the Break in a LOOP.
When you need to break out of a loop, use the Control Step and throw an Exception or Alert or Exit the process.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can think of using Control Step to terminate the process, or come out from the loop with exception.
For this check out this-http://help.sap.com/saphelp_nw2004s/helpdata/en/bb/e1283f2bbad036e10000000a114084/content.htm
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.