private void writeEvent(Element eventElement, Event event) { eventElement.addAttribute("type", event.getEventType()); if (event.hasActions()) { for (Iterator actionIter = event.getActions().iterator(); actionIter.hasNext();) { Action action = (Action) actionIter.next(); writeAction(eventElement, action); } } }
private void writeEvent(Element eventElement, Event event) { eventElement.addAttribute("type", event.getEventType()); if (event.hasActions()) { for (Iterator actionIter = event.getActions().iterator(); actionIter.hasNext();) { Action action = (Action) actionIter.next(); writeAction(eventElement, action); } } }
/** * Process events defined in the pageflow. * * @param type one of: "process-validations", "update-model-values", * "invoke-application", "render-response" */ public void processEvents(String type) { Event event = getNode().getEvent(type); if (event!=null) { for ( Action action: (List<Action>) event.getActions() ) { try { action.execute( ExecutionContext.currentExecutionContext() ); } catch (Exception e) { throw new RuntimeException(e); } } } }
private void writeTransition(Element transitionElement, Transition transition) { if (transition.getTo() != null) { transitionElement.addAttribute("to", transition.getTo().getName()); } if (transition.getName() != null) { transitionElement.addAttribute("name", transition.getName()); } Event transitionEvent = transition.getEvent(Event.EVENTTYPE_TRANSITION); if (transitionEvent != null && transitionEvent.hasActions()) { writeActions(transitionElement, transitionEvent.getActions()); } }
private void writeTransition(Element transitionElement, Transition transition) { if (transition.getTo() != null) { transitionElement.addAttribute("to", transition.getTo().getName()); } if (transition.getName() != null) { transitionElement.addAttribute("name", transition.getName()); } Event transitionEvent = transition.getEvent(Event.EVENTTYPE_TRANSITION); if (transitionEvent != null && transitionEvent.hasActions()) { writeActions(transitionElement, transitionEvent.getActions()); } }
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); } }