'How can I throw exception in subprocess in Drools jbpm?

I have several custom WorkItemHandlers, and handle the exception by using handleException(e);

public abstract class AbstractItemHandler extends AbstractLogOrThrowWorkItemHandler implements WorkItemHandler

But I found a very strange thing, if the custom WorkItemHandler is in subprocess, there will be no exception when calling kieSession.startProcess(MAIN_PROCESS_ID, processMap).

It works when there is only one process(bpmn). But when there are more bpmn files, I found the ProcessInstance is return abnormal state.

    Assert.assertEquals(ProcessInstance.STATE_ABORTED, processInstance.getState());


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source