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());
}