/** * Executes the actions contained within this action list. Simply iterates over each action and calls execute. * Action result events are ignored. * @param context the action execution request context */ public void execute(RequestContext context) { for (Action action : actions) { ActionExecutor.execute(action, context); } }
private static Action getTargetAction(Action action) { if (action instanceof AnnotatedAction) { return getTargetAction(((AnnotatedAction) action).getTargetAction()); } else { return action; } } }
public void render() { if (action != null) { ActionExecutor.execute(action, requestContext); } }
/** * Execute the given action. * @param action the action to execute * @param context the flow execution request context * @return result of action execution * @throws ActionExecutionException if the action threw an exception while executing, the orginal exception is * available as the cause if this exception */ public static Event execute(Action action, RequestContext context) throws ActionExecutionException { try { if (logger.isDebugEnabled()) { logger.debug("Executing " + getTargetAction(action)); } Event event = action.execute(context); if (logger.isDebugEnabled()) { logger.debug("Finished executing " + getTargetAction(action) + "; result = " + event); } return event; } catch (ActionExecutionException e) { throw e; } catch (Exception e) { // wrap the exception as an ActionExecutionException throw new ActionExecutionException(context.getActiveFlow().getId(), context.getCurrentState() != null ? context.getCurrentState().getId() : null, action, context.getAttributes(), e); } }
protected Event doExecute(RequestContext context) throws Exception { Object result = expression.getValue(context); if (result instanceof Action) { return ActionExecutor.execute((Action) result, context); } else { if (resultExpression != null) { resultExpression.setValue(context, result); } return resultEventFactory.createResultEvent(this, result, context); } }
private static Action getTargetAction(Action action) { if (action instanceof AnnotatedAction) { return getTargetAction(((AnnotatedAction) action).getTargetAction()); } else { return action; } } }
public boolean test(RequestContext context) { Event result = ActionExecutor.execute(getAction(), context); return result != null && isTrueEvent(result.getId()); }
private static Action getTargetAction(Action action) { if (action instanceof AnnotatedAction) { return getTargetAction(((AnnotatedAction) action).getTargetAction()); } else { return action; } } }
while (it.hasNext()) { Action action = it.next(); Event event = ActionExecutor.execute(action, context); if (event != null) { eventIds[executionCount] = event.getId();
/** * Execute the given action. * @param action the action to execute * @param context the flow execution request context * @return result of action execution * @throws ActionExecutionException if the action threw an exception while executing, the orginal exception is * available as the cause if this exception */ public static Event execute(Action action, RequestContext context) throws ActionExecutionException { try { if (logger.isDebugEnabled()) { logger.debug("Executing " + getTargetAction(action)); } Event event = action.execute(context); if (logger.isDebugEnabled()) { logger.debug("Finished executing " + getTargetAction(action) + "; result = " + event); } return event; } catch (ActionExecutionException e) { throw e; } catch (Exception e) { // wrap the exception as an ActionExecutionException throw new ActionExecutionException(context.getActiveFlow().getId(), context.getCurrentState() != null ? context.getCurrentState().getId() : null, action, context.getAttributes(), e); } }
public void render() { if (action != null) { ActionExecutor.execute(action, requestContext); } }
/** * Execute the given action. * @param action the action to execute * @param context the flow execution request context * @return result of action execution * @throws ActionExecutionException if the action threw an exception while executing, the orginal exception is * available as the cause if this exception */ public static Event execute(Action action, RequestContext context) throws ActionExecutionException { try { if (logger.isDebugEnabled()) { logger.debug("Executing " + getTargetAction(action)); } Event event = action.execute(context); if (logger.isDebugEnabled()) { logger.debug("Finished executing " + getTargetAction(action) + "; result = " + event); } return event; } catch (ActionExecutionException e) { throw e; } catch (Exception e) { // wrap the exception as an ActionExecutionException throw new ActionExecutionException(context.getActiveFlow().getId(), context.getCurrentState() != null ? context.getCurrentState().getId() : null, action, context .getAttributes(), e); } }
public void render() { if (action != null) { ActionExecutor.execute(action, requestContext); } }
/** * Executes the actions contained within this action list. Simply iterates over each action and calls execute. * Action result events are ignored. * @param context the action execution request context */ public void execute(RequestContext context) { for (Action action : actions) { ActionExecutor.execute(action, context); } }
/** * Executes the actions contained within this action list. Simply iterates over each action and calls execute. * Action result events are ignored. * @param context the action execution request context */ public void execute(RequestContext context) { Iterator it = actions.iterator(); while (it.hasNext()) { ActionExecutor.execute((Action) it.next(), context); } }
/** * Specialization of State's <code>doEnter</code> template method that executes behavior specific to this state type * in polymorphic fashion. * <p> * This implementation pops the top (active) flow session off the execution stack, ending it, and resumes control in * the parent flow (if necessary). If the ended session is the root flow, a final response is rendered. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ protected void doEnter(final RequestControlContext context) throws FlowExecutionException { FlowSession activeSession = context.getFlowExecutionContext().getActiveSession(); if (activeSession.isRoot()) { // entire flow execution is ending; issue the final response if (finalResponseAction != null && !context.getExternalContext().isResponseComplete()) { ActionExecutor.execute(finalResponseAction, context); context.getExternalContext().recordResponseComplete(); } context.endActiveFlowSession(getId(), createSessionOutput(context)); } else { // there is a parent flow that will resume (this flow is a subflow) LocalAttributeMap<Object> sessionOutput = createSessionOutput(context); context.endActiveFlowSession(getId(), sessionOutput); } }
protected Event doExecute(RequestContext context) throws Exception { Object result = expression.getValue(context); if (result instanceof Action) { return ActionExecutor.execute((Action) result, context); } else { if (evaluationResultExposer != null) { evaluationResultExposer.exposeResult(result, context); } return resultEventFactory.createResultEvent(this, result, context); } }
protected Event doExecute(RequestContext context) throws Exception { Object result = expression.getValue(context); if (result instanceof Action) { return ActionExecutor.execute((Action) result, context); } else { if (resultExpression != null) { resultExpression.setValue(context, result); } return resultEventFactory.createResultEvent(this, result, context); } }
public boolean test(RequestContext context) { Event result = ActionExecutor.execute(getAction(), context); return result != null && isTrueEvent(result.getId()); }
public boolean test(RequestContext context) { Event result = ActionExecutor.execute(getAction(), context); return result != null && isTrueEvent(result.getId()); }