Event myEvent = new MyEvent(); Node node = ....; node.fireEvent(myEvent);
public Transition addLeavingTransition(Transition leavingTransition) { // since the decision node evaluates transition conditions, // the condition of the leaving transition will always be met. // hence the condition enforcement can be disabled safely leavingTransition.setConditionEnforced(false); return super.addLeavingTransition(leavingTransition); }
public GraphElement getParent() { if (from != null && to != null) { if (from.equals(to)) return from.getParent(); for (GraphElement fromParent = from; fromParent != null; fromParent = fromParent.getParent()) { for (GraphElement toParent = to; toParent != null; toParent = toParent.getParent()) { if (fromParent.equals(toParent)) return fromParent; } } } return processDefinition; } }
/** @deprecated no use for this method */ public String getNameExt() { String name = getName(); if (name == null) name = "#anonymous" + getNodeType(); return name; }
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Event)) return false; Event other = (Event) o; if (id != 0 && id == other.getId()) return true; return eventType.equals(other.getEventType()) && graphElement.equals(other.getGraphElement()); }
void fireSuperStateLeaveEvents(ExecutionContext executionContext) { // optimisation: check if there is a candidate superstate to be left if (executionContext.getTransitionSource().getSuperState() != null) { // collect all the superstates being left List leavingSuperStates = collectAllSuperStates(executionContext.getTransitionSource(), to); // fire a node-leave event for all superstates being left fireSuperStateEvents(leavingSuperStates, Event.EVENTTYPE_SUPERSTATE_LEAVE, executionContext); } }
public void setStartState(StartState startState) { if (this.startState != startState && this.startState != null) { removeNode(this.startState); } this.startState = startState; if (startState != null) { addNode(startState); } }
/** * creates a runtime action. Look up the event with * {@link GraphElement#getEvent(String)} and the action with * {@link ProcessDefinition#getAction(String)}. You can only lookup named * actions easily. */ public RuntimeAction(Event event, Action action) { this.graphElement = event.getGraphElement(); this.eventType = event.getEventType(); this.action = action; }
/** * called by the implementation of this node to continue execution over the default * transition. */ public void leave(ExecutionContext executionContext) { leave(executionContext, getDefaultLeavingTransition()); }
@Override void process() throws Exception { initProcessAndTask(context); action.execute(context); } }.run();
/** * checks for the presence of a leaving transition with the given name. the leaving * transitions of the supernode are taken into account as well. * * @return true if this node has a leaving transition with the given name, false otherwise. */ public boolean hasLeavingTransition(String transitionName) { return getLeavingTransition(transitionName) != null; }
/** * the slash separated name that includes all the superstate names. */ public String getFullyQualifiedName() { return superState != null ? superState.getFullyQualifiedName() + '/' + name : name; }
public GraphElement getParent() { if (from != null && to != null) { if (from.equals(to)) return from.getParent(); for (GraphElement fromParent = from; fromParent != null; fromParent = fromParent.getParent()) { for (GraphElement toParent = to; toParent != null; toParent = toParent.getParent()) { if (fromParent.equals(toParent)) return fromParent; } } } return processDefinition; } }
public Transition addLeavingTransition(Transition leavingTransition) { // since the decision node evaluates transition conditions, // the condition of the leaving transition will always be met. // hence the condition enforcement can be disabled safely leavingTransition.setConditionEnforced(false); return super.addLeavingTransition(leavingTransition); }
public void setStartState(StartState startState) { if (this.startState != startState && this.startState != null) { removeNode(this.startState); } this.startState = startState; if (startState != null) { addNode(startState); } }