Examples of startFlowState()


Examples of org.amplafi.flow.FlowManagement.startFlowState()

    private FlowStateImpl newFlowState() {
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        String flowTypeName = flowTestingUtils.addFlowDefinition(new FlowActivityImpl());
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        FlowStateImpl flowState = flowManagement.startFlowState(flowTypeName, true, null, null);
        flowState.finishFlow();
        return flowState;
    }
    private JSONWriter getJsonWriter() {
        MapJsonRenderer mapJsonRenderer = new MapJsonRenderer();
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

            flowTestingUtils.addFlowDefinition(flowTypeName, flowActivity);
        }


        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        FlowState flowState = flowManagement.startFlowState(flowTypeName, true, initialFlowState, null);

        // now make sure that only the properties allowed to be set externally are set.
        for (PropertyScope propertyScope: PropertyScope.values()) {
            for(PropertyUsage propertyUsage: PropertyUsage.values()) {
                String name= propertyScope+"_"+propertyUsage;
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

            }
        }

        // now as part of a running flow
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        FlowStateImpl flowStateImpl = flowManagement.startFlowState(flowTypeName, true, null, null);
        FlowActivityImpl flowActivity = flowStateImpl.getCurrentActivity();
        for(FlowPropertyProvider flowPropertyProvider: new FlowPropertyProvider[] {flowActivity, flowStateImpl.getFlow()}) {
            namespace = flowLocalProperty.getNamespaceKey(flowStateImpl, flowPropertyProvider);
            assertEquals(namespace, flowStateImpl.getLookupKey());
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

        flowActivity2.addPropertyDefinitions(globalProperty);

        String flowTypeName = flowTestingUtils.addFlowDefinition(flowActivity0, flowActivity1, flowActivity2);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        Map<String, String> initialFlowState = FlowUtils.INSTANCE.createState(propertyName, "true");
        FlowState flowState = flowManagement.startFlowState(flowTypeName, false, initialFlowState , null);
        assertNotNull(flowState);
        // expect null because
        Boolean propertyValue = flowState.getProperty(propertyName, Boolean.class);
        assertNull(propertyValue, "flowState="+flowState+" propertyValue="+propertyValue);
        flowState.next();
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

        flowActivity2.addPropertyDefinitions(globalProperty);

        String flowTypeName = flowTestingUtils.addFlowDefinition(flowActivity0, flowActivity1, flowActivity2);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        Map<String, String> initialFlowState = FlowUtils.INSTANCE.createState(propertyName, "maybe");
        FlowState flowState = flowManagement.startFlowState(flowTypeName, false, initialFlowState , null);
        assertNotNull(flowState);
        String propertyValue = flowState.getProperty(propertyName, String.class);
        assertEquals("true",propertyValue, "flowState="+flowState+" propertyValue="+propertyValue);
        flowState.next();
        propertyValue = flowState.getProperty(propertyName, String.class);
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowTranslatorResolver().resolveFlow(flow);
        flowTestingUtils.getFlowDefinitionsManager().addDefinition(FLOW_TYPE, flow);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        String returnToFlowLookupKey = null;
        FlowState flowState = flowManagement.startFlowState(FLOW_TYPE, true, initialFlowState, returnToFlowLookupKey);
        SampleEnum type =flowState.getCurrentActivity().getProperty("foo");
        assertEquals(type, SampleEnum.EXTERNAL, "(looking for property 'foo') FlowState="+flowState);
        type =flowState.getProperty("fa1fp", SampleEnum.class);
        assertEquals(type, SampleEnum.EMAIL);
    }
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

        flowActivity0.setFlowPropertyProviderName("activity0");
        flowActivity0.addPropertyDefinitions(flowLocalProperty);
        String flowTypeName = flowTestingUtils.addFlowDefinition(flowActivity0);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        Map<String, String> initialFlowState = FlowUtils.INSTANCE.createState(propertyName, "maybe");
        FlowState flowState = flowManagement.startFlowState(flowTypeName, false, initialFlowState , null);
        assertNotNull(flowState);
        Boolean propertyValue = flowState.getProperty(propertyName, Boolean.class);
        assertEquals(Boolean.TRUE,propertyValue, "flowState="+flowState+" propertyValue="+propertyValue);
    }
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

        TransitionFlowActivity transitionFlowActivity = new TransitionFlowActivity();
        transitionFlowActivity.setTransitionType(TransitionType.alternate);
        transitionFlowActivity.setNextFlowType(nextFlowType);
        String flowTypeName = flowTestingUtils.addFlowDefinition(newFlowActivity(), transitionFlowActivity);
        FlowManagement flowManagement = flowTestingUtils.getFlowManager().getFlowManagement();
        FlowStateImplementor flowState = flowManagement.startFlowState(flowTypeName, true, null, returnToFlowLookupKey);
        flowTestingUtils.advanceToEnd(flowState);
        FlowState nextFlowState = flowManagement.getCurrentFlowState();
        // the alternate condition was not met.
        assertNull(nextFlowState);
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

        flowTestingUtils.advanceToEnd(flowState);
        FlowState nextFlowState = flowManagement.getCurrentFlowState();
        // the alternate condition was not met.
        assertNull(nextFlowState);

        flowState = flowManagement.startFlowState(flowTypeName, true, null, returnToFlowLookupKey);
        flowState.setFinishKey(TransitionType.alternate.toString());
        // make sure cache can't help 'cheat'
        flowState.clearCache();
        flowTestingUtils.advanceToEnd(flowState);
        nextFlowState = flowManagement.getCurrentFlowState();
View Full Code Here

Examples of org.amplafi.flow.FlowManagement.startFlowState()

        String nextFlowType = flowTestingUtils.addFlowDefinition(newFlowActivity());
        TransitionFlowActivity transitionFlowActivity = new TransitionFlowActivity();
        transitionFlowActivity.setNextFlowType(nextFlowType);
        String flowTypeName = flowTestingUtils.addFlowDefinition(newFlowActivity(), transitionFlowActivity);
        FlowManagement flowManagement = flowTestingUtils.getFlowManager().getFlowManagement();
        FlowState flowState = flowManagement.startFlowState(flowTypeName, true, null, returnToFlowLookupKey);
        flowTestingUtils.advanceToEnd(flowState);
        FlowState nextFlowState = flowManagement.getCurrentFlowState();
        assertNotNull(nextFlowState);
        assertEquals(nextFlowState.getFlowTypeName(), nextFlowType);
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.