void setCurrentState(State newState, RequestContext context) { listeners.fireStateEntering(context, newState); FlowSessionImpl session = getActiveSessionInternal(); State previousState = (State) session.getState(); session.setCurrentState(newState); listeners.fireStateEntered(context, previousState); }
private FlowExecutionImplFactory createFlowExecutionFactory(AttributeMap<Object> executionAttributes) { FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory(); executionFactory.setExecutionAttributes(executionAttributes); if (flowExecutionListenerLoader != null) { executionFactory.setExecutionListenerLoader(flowExecutionListenerLoader); } return executionFactory; }
/** * Create a new flow session object. Subclasses can override this to return a special implementation if required. * @param flow the flow that should be associated with the flow session * @param parent the flow session that should be the parent of the newly created flow session (may be null) * @return the newly created flow session */ protected FlowSessionImpl createFlowSession(Flow flow, FlowSessionImpl parent) { return new FlowSessionImpl(flow, parent); }
boolean handleEvent(Event event, RequestControlContext context) { listeners.fireEventSignaled(context, event); return getActiveSessionInternal().getFlow().handleEvent(context); }
/** * Try to handle given exception using execution exception handlers registered at the flow level. Returns null if no * handler handled the exception. * @return true if the exception was handled */ private boolean tryFlowHandlers(FlowExecutionException exception, RequestControlContext context) { return getActiveSessionInternal().getFlow().handleException(exception, context); }
/** * Factory method to create the flow execution factory. Subclasses could override this if they want to use a custom * flow execution factory or custom configuration of the flow execution factory, registering flow execution * listeners for instance. The default implementation just returns a {@link FlowExecutionImplFactory} instance. * @return the flow execution factory */ protected FlowExecutionFactory createFlowExecutionFactory() { return new FlowExecutionImplFactory(); }
public FlowExecutionKey getKey(FlowExecution execution) { if (execution.getKey() == null) { return new SimpleFlowExecutionKey(nextSequence()); } else { // keep the same key return execution.getKey(); } }
public MutableAttributeMap<Object> getConversationScope() { return flowExecution.getConversationScope(); }
/** * Create a flow execution control context. * @param externalContext the external context triggering this request */ protected RequestControlContext createRequestContext(ExternalContext externalContext, MessageContext messageContext) { return new RequestControlContextImpl(this, externalContext, messageContext); }
public MutableAttributeMap<Object> getFlashScope() { return flowExecution.getFlashScope(); }
public void start(Flow flow, MutableAttributeMap<?> input) throws FlowExecutionException { flowExecution.start(flow, input, this); }
public void endActiveFlowSession(String outcome, MutableAttributeMap<Object> output) throws IllegalStateException { flowExecution.endActiveFlowSession(outcome, output, this); }
void setListeners(FlowExecutionListener[] listeners) { this.listeners = new FlowExecutionListeners(listeners); }
public boolean handleEvent(Event event) throws FlowExecutionException { this.currentEvent = event; return flowExecution.handleEvent(event, this); }
public void updateCurrentFlowExecutionSnapshot() { flowExecution.updateCurrentFlowExecutionSnapshot(); }
public boolean execute(Transition transition) { return flowExecution.execute(transition, this); }
public TransitionDefinition getMatchingTransition(String eventId) throws IllegalStateException { return flowExecution.getMatchingTransition(eventId); }
public void removeAllFlowExecutionSnapshots() { flowExecution.removeAllFlowExecutionSnapshots(); }
public void viewRendering(View view) { flowExecution.viewRendering(view, this); }
public void viewRendered(View view, RequestContext context) { listeners.fireViewRendered(context, view); }