AnsweredAssumed Answered

handling exceptions with activiti agnostic spring beans

Question asked by cirerenat on Dec 16, 2011
Latest reply on Dec 20, 2011 by cirerenat
See the attached flow. Both service tasks updateA and updateB are spring beans and they are called as "expression". They have no knowledge of they're being called from activiti and we want to leave them like that. And this process (svc_persist) is called from a service layer.

// Initialize the execution variables
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processId,vars);
// When process is finished
Map<String, Object> outputVars = runtimeService.getVariables(processInstance.getId());

The issue is handling the exceptions. If an exception thrown from any of the service tasks, the service layer would have no way of dealing with the exception and returning a some how meaningful response to the caller.

In some flows we have tens of service beans calling the activiti agnostic beans. How can I wrap these process flows to have more control over exceptions.

Attachments

Outcomes