JBoss Community

Re: cancel and error end activity throws exception in subprocess [jBPM 4.4]

created by saig0 in jBPM - View the full discussion

One solution is to change the behavior of class ExecutionImpl to this:

 

 

 

protected void checkActive()
    {
        if (!isActive())
        {
            throw new JbpmException(toString() + " is not active: " + state);
        }
        else if (this.subProcessInstance != null && !isSubProcessEnded())
        {
            throw new JbpmException(toString() + " has running subprocess: "
                    + this.subProcessInstance.toString() + " in state " + this.subProcessInstance.getState());
        }
    }
 
 
    private boolean isSubProcessEnded()
    {
        List<String> endStates = new ArrayList<String>();
        endStates.add(Execution.STATE_ENDED);
        endStates.add("cancel");
        endStates.add("error");
        return endStates.contains(this.subProcessInstance.getState());
    }
 

Reply to this message by going to Community

Start a new discussion in jBPM at Community