use of org.cristalise.kernel.lifecycle.instance.stateMachine.Transition in project kernel by cristal-ise.
the class CompositeActivity method request.
@Override
public String request(AgentPath agent, AgentPath delegator, ItemPath itemPath, int transitionID, String requestData, Object locker) throws AccessRightsException, InvalidTransitionException, InvalidDataException, ObjectNotFoundException, PersistencyException, ObjectAlreadyExistsException, ObjectCannotBeUpdated, CannotManageException, InvalidCollectionModification {
Transition trans = getStateMachine().getTransition(transitionID);
if (trans.isFinishing() && hasActive()) {
if ((Boolean) getBuiltInProperty(ABORTABLE))
abort();
else
throw new InvalidTransitionException("Attempted to finish a composite activity that had active children but was not Abortable");
}
if (getStateMachine().getTransition(transitionID).reinitializes()) {
int preserveState = state;
reinit(getID());
setState(preserveState);
}
if (getChildrenGraphModel().getStartVertex() != null && (getStateMachine().getState(state).equals(getStateMachine().getInitialState()) || getStateMachine().getTransition(transitionID).reinitializes())) {
((WfVertex) getChildrenGraphModel().getStartVertex()).run(agent, itemPath, locker);
}
return super.request(agent, delegator, itemPath, transitionID, requestData, locker);
}
Aggregations