Looping task in conjunction with a signal event

Hi all,

I am new to the BPMN world. I am trying to model a process where data from a file/s has to be uploaded to a temp table and if any errors are found in the data, the error data has to be uploaded to a table. There could be more than one file so the process should go through all files available and any error records found should be inserted to a error table.

I am attempting model the above as follows. I put a loop and raise a signal that would be caught by the event subprocess. Please let me know your thoughts.

Hi,

A few alternate suggestions…

A signal is usually used to notify one or more process instance. In your case you are not notifying other instances so a signal is probably inappropriate.

Given you have an error condition, consider using a catch error event on the upload task to route to your error handler.

An event driven subprocess works, but could be overkill in this simple use case…

regards

Rob

1 Like

Thank you, will keep your suggestion in mind. Other than that the other parts makes sense I assume. Like for instance should I use a sequential multi instance subprocess instead of the loop considering the use case? I ask this because the number of files is unknown,could be one,zero or n.

Hi,
IMHO there’s not much difference between a loop or sequential multi-instance. Id use a loop if I want to terminate the loop on a condition. If I have a list or set of items, I tend to use a sequential multi-instance…

regards

Rob

1 Like

Hi Rob, Me again. If i am not mistaken the error boundary event is interrupting according to the spec.

Moreover according to the spec ,

When an error event is caught, the activity on which the boundary event is defined is destroyed, also destroying all current executions therein (e.g., concurrent activities, nested subprocesses, etc.). Process execution continues following the outgoing sequence flow of the boundary event.

May be I did not mention this but the use case for this process is that if there is error data that error data should be stored. The loop should go on to process the remaining records if any. So am not sure the error event will work for this use case.

Hi,

Heres an expanded model of how Ive interpreted your use case…

If the insert record code fails, it could throw a BpmnError. This will be caught and route the process instance to the log task. Hence this failed row will be logged, but subsequent records (and files) will continue to be processed…

regards

Rob

Thanks a lot Rob!