Examples of FlowExecution


Examples of org.springframework.webflow.execution.FlowExecution

        state3.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state4-end")));
        return parent;
    }
   
    private FlowExecution newMockExecution(final Flow flow) {
        final FlowExecution execution = mock(FlowExecution.class);
        when(execution.getDefinition()).thenReturn(flow);
        return execution;
    }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

  public FlowExecution restoreExecution(FlowExecutionSnapshot snapshot, String flowId, FlowExecutionKey key,
      MutableAttributeMap conversationScope, FlowExecutionKeyFactory keyFactory)
      throws FlowExecutionRestorationFailureException {
    SimpleFlowExecutionSnapshot snapshotImpl = (SimpleFlowExecutionSnapshot) snapshot;
    FlowDefinition def = flowDefinitionLocator.getFlowDefinition(flowId);
    FlowExecution execution = snapshotImpl.getFlowExecution();
    flowExecutionFactory.restoreFlowExecution(execution, def, key, conversationScope, flowDefinitionLocator);
    return execution;
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

  public FlowExecution restoreExecution(FlowExecutionSnapshot snapshot, String flowId, FlowExecutionKey key,
      MutableAttributeMap conversationScope, FlowExecutionKeyFactory keyFactory)
      throws FlowExecutionRestorationFailureException {
    SerializedFlowExecutionSnapshot snapshotImpl = (SerializedFlowExecutionSnapshot) snapshot;
    FlowDefinition def = flowDefinitionLocator.getFlowDefinition(flowId);
    FlowExecution execution;
    try {
      execution = snapshotImpl.unmarshal(def.getClassLoader());
    } catch (SnapshotUnmarshalException e) {
      throw new FlowExecutionRestorationFailureException(key, e);
    }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

      if (logger.isDebugEnabled()) {
        logger.debug("Launching new execution of flow '" + flowId + "' with input " + input);
      }
      ExternalContextHolder.setExternalContext(context);
      FlowDefinition flowDefinition = definitionLocator.getFlowDefinition(flowId);
      FlowExecution flowExecution = executionFactory.createFlowExecution(flowDefinition);
      flowExecution.start(input, context);
      if (!flowExecution.hasEnded()) {
        executionRepository.putFlowExecution(flowExecution);
        return createPausedResult(flowExecution);
      } else {
        return createEndResult(flowExecution);
      }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

      ExternalContextHolder.setExternalContext(context);
      FlowExecutionKey key = executionRepository.parseFlowExecutionKey(flowExecutionKey);
      FlowExecutionLock lock = executionRepository.getLock(key);
      lock.lock();
      try {
        FlowExecution flowExecution = executionRepository.getFlowExecution(key);
        flowExecution.resume(context);
        if (!flowExecution.hasEnded()) {
          executionRepository.putFlowExecution(flowExecution);
          return createPausedResult(flowExecution);
        } else {
          executionRepository.removeFlowExecution(flowExecution);
          return createEndResult(flowExecution);
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

        assertTrue(context.getFlashScope().get("rootCauseException") instanceof TestException);
      }
    };
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue("Should have ended", !execution.isActive());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

  public void testStateExceptionHandlingTransitionNoSuchState() {
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have failed no such state");
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    } catch (IllegalArgumentException e) {
    }
  }

  public void testStateExceptionHandlingRethrow() {
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have rethrown");
    } catch (FlowExecutionException e) {
      // expected
    }
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

      public Flow createFlow() throws FlowBuilderException {
        return Flow.create(getContext().getFlowId(), getContext().getFlowAttributes());
      }
    };
    Flow flow = new FlowAssembler(builder, new MockFlowBuilderContext("flow")).assembleFlow();
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue(execution.isActive());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    flowDefinition = new Flow("flow");
    new EndState(flowDefinition, "end");
  }

  public void testCreate() {
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertSame(flowDefinition, execution.getDefinition());
    assertFalse(execution.hasStarted());
    assertFalse(execution.isActive());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.