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()); }
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()); }
private List getRuntimeActionsForEvent(ExecutionContext executionContext, String eventType) { List eventRuntimeActions = null; List runtimeActions = executionContext.getProcessInstance().getRuntimeActions(); if (runtimeActions != null) { for (Iterator iter = runtimeActions.iterator(); iter.hasNext();) { RuntimeAction runtimeAction = (RuntimeAction) iter.next(); // if the runtime action is registered on this element and eventType if (equals(runtimeAction.getGraphElement()) && eventType.equals(runtimeAction.getEventType())) { // ... add its action to the list of runtime actions if (eventRuntimeActions == null) eventRuntimeActions = new ArrayList(); eventRuntimeActions.add(runtimeAction.getAction()); } } } return eventRuntimeActions; }
private List getRuntimeActionsForEvent(ExecutionContext executionContext, String eventType) { List eventRuntimeActions = null; List runtimeActions = executionContext.getProcessInstance().getRuntimeActions(); if (runtimeActions != null) { for (Iterator iter = runtimeActions.iterator(); iter.hasNext();) { RuntimeAction runtimeAction = (RuntimeAction) iter.next(); // if the runtime action is registered on this element and eventType if (equals(runtimeAction.getGraphElement()) && eventType.equals(runtimeAction.getEventType())) { // ... add its action to the list of runtime actions if (eventRuntimeActions == null) eventRuntimeActions = new ArrayList(); eventRuntimeActions.add(runtimeAction.getAction()); } } } return eventRuntimeActions; }
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Event)) return false; RuntimeAction other = (RuntimeAction) o; if (id != 0 && id == other.getId()) return true; return eventType.equals(other.getEventType()) && graphElement.equals(other.getGraphElement()) && processInstance.equals(other.getProcessInstance()); }
return false; return result && parent.equals(otherParent);
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof RuntimeAction)) return false; RuntimeAction other = (RuntimeAction) o; if (id != 0 && id == other.getId()) return true; return eventType.equals(other.getEventType()) && graphElement.equals(other.getGraphElement()) && processInstance.equals(other.getProcessInstance()); }
public boolean equals(Object o) { if (o == this) return true; if (!getClass().isInstance(o)) return false; GraphElement other = (GraphElement) o; if (id != 0 && id == other.getId()) return true; GraphElement parent = getParent(); GraphElement otherParent = other.getParent(); boolean result; if (name != null && parent != null) { result = name.equals(other.getName()); } else if (parent instanceof NodeCollection && otherParent instanceof NodeCollection) { NodeCollection nodeCollection = (NodeCollection) parent; int index = nodeCollection.getNodes().indexOf(this); assert index != -1 : nodeCollection.getNodes(); NodeCollection otherNodeCollection = (NodeCollection) otherParent; int otherIndex = otherNodeCollection.getNodes().indexOf(other); result = index == otherIndex; } else { return false; } return result && parent.equals(otherParent); }
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 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; } }
if (parent != null && !equals(parent)) {
public void fireAndPropagateEvent(String eventType, ExecutionContext executionContext) { // check whether the event was fired on this element // or propagated from another element boolean isPropagated = !equals(executionContext.getEventSource()); // execute static actions Event event = getEvent(eventType); if (event != null) { // update the context executionContext.setEvent(event); // execute the static actions specified in the process definition executeActions(event.getActions(), executionContext, isPropagated); } // execute the runtime actions List runtimeActions = getRuntimeActionsForEvent(executionContext, eventType); executeActions(runtimeActions, executionContext, isPropagated); // remove the event from the context executionContext.setEvent(null); // propagate the event to the parent element GraphElement parent = getParent(); if (parent != null) { parent.fireAndPropagateEvent(eventType, executionContext); } }
public void fireAndPropagateEvent(String eventType, ExecutionContext executionContext) { // check whether the event was fired on this element // or propagated from another element boolean isPropagated = !equals(executionContext.getEventSource()); // execute static actions Event event = getEvent(eventType); if (event != null) { // update the context executionContext.setEvent(event); // execute the static actions specified in the process definition executeActions(event.getActions(), executionContext, isPropagated); } // execute the runtime actions List runtimeActions = getRuntimeActionsForEvent(executionContext, eventType); executeActions(runtimeActions, executionContext, isPropagated); // remove the event from the context executionContext.setEvent(null); // propagate the event to the parent element GraphElement parent = getParent(); if (parent != null) { parent.fireAndPropagateEvent(eventType, executionContext); } }
if (parent != null && !equals(parent)) {