origam.com

End of iteration in for-each block due to error

Hello,

Is there a way how to disable ending of iteration in for-each block of workflow? My use case is that I iterate over data set and inner task may fail due to unsufficient stock on warehouse for example. But I still want to iterate over rest of them.

Any ideas?

It’s an exception and Origam doesn’t support exception handling in workflow yet.

So from my point of view I would think of one of the following ideas:
a) try to avoid exception, so that e.g. stock unavailability wouldn’t cause exception, but return e.g. some value, and the current iteration would be ended based on that returned value
b) sometimes the iteration can be transfromed into workqueues and asynchronous porcessing. Each iteration only create one work queue entry with automatic processing. The one-iteration logic is moved to work queue cmd. This approach is sometimes even better, becouse it is done in smaller transaction, but sometimes it isn’t feasible.
c) create a request to Origam to support exceptions in workflows.

1 Like

The most reasonable solution for my use case is variant b). Work queue gives me everything I need to accomplish it and moreover asynchronous approach is way more suitable. I think WF for-each block can stay as it is, since Work Queue is made for this.

Thank you for your ideas Vašek :slight_smile: