cancel
Showing results for 
Search instead for 
Did you mean: 

RuntimeException when call Activiti exist

bapu
Champ in-the-making
Champ in-the-making
I am trying to throw RuntimeException to the calling program (Test) from a JavaDelegate. This works fine if the workflow is a single workflow.  But if the workflow includes 'Call Activiti', Runtime Exception never gets propagated to Calling Program (Test). 

Here i have

Start - > Service Task 1 -> Call Activiti -> Service Task2 - > end.

'Service Task2' throws runtime exception, but exception never makes to my Test that starts the workflow.

Any ideas?

Thanks,
Bapu
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Check the BPMN error event mechanism. Regular Java exceptions have no meaning in bpmn context.

bapu
Champ in-the-making
Champ in-the-making
Thanks!
How come runtime exception gets propagated to caller (test) when the exception is thrown form the first 'Service Task 1' , i.e. the task before the call activiti task.

thanks,
bapu

frederikherema1
Star Contributor
Star Contributor
Because the process is driven (executed) by the callign thread, and it gets the exceptions (after they are handled internally) as immediate feedback. So when no exceptions occur when calling, you can be sure the process ran successfully until the next wait-state/process-end or async activity.