It works now. I've tried several options and finally updated custom workitem handler to not 'abort' or 'complete' workitem when exception happens and signal is sent. In this case the retry may happen in the loop without any limitations. The only question if such approach is correct from JBPM design perspective or not ? In accordance with JBPM documentation it's said that 'abort' or 'complete' should be invoked only after sending signal, but it's not clear whether complete/abort is mandatory in such case or not, and what the impact of not calling them at all. Any hints there ?
When you use the
WorkItemManagerto signal that the work item has been completed or aborted, make sure to do that after you've sent any signals to the process instance. Depending on how you've defined your process, calling
WorkItemManager.abortWorkItem(...)will trigger the completion of the process instance. This is because the these methods trigger the jBPM process engine to continue the process flow.