AnsweredAssumed Answered

ErrorBoundaryEvent error handling java

Question asked by activ_user on Jul 24, 2015
Latest reply on Jul 29, 2015 by trademak
Hi,

I am new to Activiti and trying to create process contains several service task and user task.

I would like to know if there is possibility in activiti to handle exception occured in my service task and depending on the result execute different user task? It means, if service task (java class implemented JavaDelegate) throw Exception, I would like to handle this exception and execute user task "System error handling" where I'll have two or more choice, first - end of my process, second - for example, retry my service task or any different task. In other case if exception isn't occured, skip "System error handling" and do next task.

In user guide is something like "ErrorBoundaryEvent", I used this boundary event for my service task but isn't working and I don't know why, maybe isn't possible in this case? (my example process diagram and java class below)





public class Example implements JavaDelegate {

    public void execute(DelegateExecution delegateExecution) throws Exception {
        try {
            /**
             *
             * My logic
             *
             */
        } catch(Exception e) {
            throw new BpmnError("Error code", e.getMessage());
        }

    }
}

[img=640x480]http://s8.postimg.org/o8dk6vv7p/diagram.png[/img]

Is it good solution? maybe is there different way to solve this problem?

Thanks for advice.

Outcomes