Say if we have a while loop in BPEL
<while>...<while>
Is it possible to terminate it if it does not complete within 10s?
No, while activities cannot declare a timeout. What you could do instead is:
<pick>
activity within the loop and add an <onAlarm>
element which waits for 10 seconds. But does not make sure that any processing of message must not take longer than 10 seconds.<scope>
with <wait>
to your loop and add the processing to an eventhandler with an onAlarm element that starts immediately. If I'm not mistaken, the event handler is terminated along with the scope. This happens when the wait activity returns, so actually all activities in the event handler should be terminated as well. I never tried this, so I'm not sure if this works.