Examples of FlowExecution


Examples of org.springframework.webflow.execution.FlowExecution

    assertEquals("e12345s2", repository.getKey(execution).toString());
    assertEquals("e12345s3", repository.getKey(execution).toString());
  }

  public void testUpdate() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    repository.putFlowExecution(execution);
    execution.getActiveSession().getScope().put("foo", "bar");
    repository.updateFlowExecutionSnapshot(execution);
    FlowExecution execution2 = repository.getFlowExecution(execution.getKey());
    assertEquals("bar", execution2.getActiveSession().getScope().get("foo"));
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    FlowExecution execution2 = repository.getFlowExecution(execution.getKey());
    assertEquals("bar", execution2.getActiveSession().getScope().get("foo"));
  }

  public void testRemove() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    repository.putFlowExecution(execution);
    repository.removeFlowExecutionSnapshot(execution);
    try {
      repository.getFlowExecution(execution.getKey());
      fail("Should have failed");
    } catch (FlowExecutionRestorationFailureException e) {

    }
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    }
  }

  public void testRemoveAll() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    repository.putFlowExecution(execution);
    repository.removeAllFlowExecutionSnapshots(execution);
    try {
      repository.getFlowExecution(execution.getKey());
      fail("Should have failed");
    } catch (FlowExecutionRestorationFailureException e) {

    }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    }

  }

  public void testUpdateNothingToDo() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    repository.updateFlowExecutionSnapshot(execution);
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    FlowExecution execution = executionFactory.createFlowExecution(flow);
    repository.updateFlowExecutionSnapshot(execution);
  }

  public void testRemoveNothingToDo() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    repository.removeFlowExecutionSnapshot(execution);
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    FlowExecution execution = executionFactory.createFlowExecution(flow);
    repository.removeFlowExecutionSnapshot(execution);
  }

  public void testRemoveAllSnapshotsNothingToDo() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    repository.removeAllFlowExecutionSnapshots(execution);
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

    model.setStates(asList(AbstractStateModel.class, end, notReached));

    Flow flow = getFlow(model);
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    FlowExecution execution = factory.createFlowExecution(flow);
    MockExternalContext context = new MockExternalContext();
    MutableAttributeMap<Object> map = new LocalAttributeMap<Object>();
    map.put("foo", "bar");
    map.put("number", "3");
    map.put("required", "9");
    execution.start(map, context);
    FlowExecutionOutcome outcome = execution.getOutcome();
    assertEquals("end", outcome.getId());
    assertEquals("bar", outcome.getOutput().get("foo"));
    assertEquals("bar", outcome.getOutput().get("differentName"));
    assertEquals(new Integer(3), outcome.getOutput().get("number"));
    assertEquals(new Integer(3), outcome.getOutput().get("required"));
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

              "org.springframework.validation.BindingResult.formBean");
          assertNull(result);
        }
      }
    }));
    FlowExecution execution = factory.createFlowExecution(flow);
    FormAction action = (FormAction) flow.getApplicationContext().getBean("formAction");
    assertFalse(((TestBeanValidator) action.getValidator()).getInvoked());
    execution.start(null, new MockExternalContext());
    MockExternalContext context = new MockExternalContext();
    context.setEventId("submit");
    execution.resume(context);
    assertTrue(((TestBeanValidator) action.getValidator()).getInvoked());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

  public FlowExecution restoreExecution(FlowExecutionSnapshot snapshot, String flowId, FlowExecutionKey key,
      MutableAttributeMap<Object> 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<Object> 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
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.