Discussion:
[jboss-user] [jBPM] - how to stop business process in case of exception
diomede illuzzi
2013-06-26 14:54:57 UTC
Permalink
diomede illuzzi [https://community.jboss.org/people/medello] created the discussion

"how to stop business process in case of exception"

To view the discussion, visit: https://community.jboss.org/message/825026#825026

--------------------------------------------------------------
I setup a business process which includes a custom workItem; I want the business process to sop when a particular condition occurs, so in this case I call the abortWorkItem method, whose implementation is very simple (ksession is an instance variable set while registering the wotkitem

public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
        ksession.abortProcessInstance(workItem.getProcessInstanceId());
            }

Everything works fine if I start the process from a standalone client, but when I start it from the jbpm console, I have no way to set there the ksession, so an exception is raised; so my question is: how to stop the processInstance when it was started through the console?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/825026#825026]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-07-09 08:30:04 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: how to stop business process in case of exception"

To view the discussion, visit: https://community.jboss.org/message/827051#827051

--------------------------------------------------------------
what version of jbpm do you use? In 5.4 you can set ksession on workitem handler using configuration file, see details http://docs.jboss.org/jbpm/v5.4/userguide/ch.console.html#d0e4698 here check the SessionTemplate section.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/827051#827051]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...