Package org.amplafi.flow.impl

Examples of org.amplafi.flow.impl.FlowImpl


     * Test to see that serialization/deserialization of enum's
     */
    @Test(enabled=TEST_ENABLED)
    public void testEnumHandling() {
        Map<String, String> initialFlowState = FlowUtils.INSTANCE.createState("foo", SampleEnum.EXTERNAL);
        FlowImplementor flow = new FlowImpl(FLOW_TYPE);
        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl("foo", SampleEnum.class);
        flow.addPropertyDefinitions(definition);
        FlowActivityImpl fa1 = new FlowActivityImpl().initInvisible(false);
        definition = new FlowPropertyDefinitionImpl("fa1fp", SampleEnum.class).initInitial(SampleEnum.EMAIL.name());
        fa1.addPropertyDefinitions(definition);
        flow.addActivity(fa1);
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowTranslatorResolver().resolveFlow(flow);
        flowTestingUtils.getFlowDefinitionsManager().addDefinition(FLOW_TYPE, flow);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        String returnToFlowLookupKey = null;
View Full Code Here


     * @return a new T
     */
    public <T extends FlowActivityImplementor> T initActivity(Class<T> clazz, FlowState state)  {
        try {
            T activity = clazz.newInstance();
            FlowImpl flow = new FlowImpl();
            flow.addActivity(activity);
            if (state!=null) {
                flow.setFlowState(state);
            }
            return activity;
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
View Full Code Here

     */
    public <T extends FlowActivityImplementor> T initActivity(Class<T> clazz) {
        return initActivity(clazz, null);
    }
    public String addFlowDefinition(String flowTypeName, FlowActivityImplementor... activities) {
        final FlowImplementor def = new FlowImpl(flowTypeName, activities);
        getFlowDefinitionsManager().addDefinitions(def);
        return flowTypeName;
    }
View Full Code Here

        final FlowImplementor def = new FlowImpl(flowTypeName, activities);
        getFlowDefinitionsManager().addDefinitions(def);
        return flowTypeName;
    }
    public FlowManager programFlowManager(String flowTypeName, FlowActivityImplementor... activities) {
        final FlowImplementor def = new FlowImpl(flowTypeName, activities);
        getFlowTranslatorResolver().resolveFlow(def);
        EasyMock.expect(getFlowManager().getFlowDefinition(flowTypeName)).andReturn(def).anyTimes();
        EasyMock.expect(getFlowManager().isFlowDefined(flowTypeName)).andReturn(true).anyTimes();
        EasyMock.expect(getFlowManager().getInstanceFromDefinition(flowTypeName)).andAnswer(new IAnswer<FlowImplementor>() {
            @Override
            public FlowImplementor answer() {
                return def.createInstance();
            }
        }).anyTimes();
        return getFlowManager();
    }
View Full Code Here

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();

        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));

        FlowActivityImpl fa4 = createFA("FA-4");
        FlowActivityImpl fa5 = createFA("FA-5");
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(MORPHED_FLOW, fa2,fa4,fa5));
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();

        FlowState flowState = flowManagement.startFlowState(FIRST_FLOW, true, null, false);
        assertEquals(flowState.getFlow().getFlowPropertyProviderName(), FIRST_FLOW);
        assertEquals(flowState.getCurrentActivityByName(), "FA-1");
View Full Code Here

        fa1.addPropertyDefinitions(morphFlowFPD);

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();

        FlowStateImplementor flowState = flowManagement.startFlowState(FIRST_FLOW, true, null, false);
        assertEquals(flowState.getFlow().getFlowPropertyProviderName(), FIRST_FLOW);
        assertEquals(flowState.getCurrentActivity().getFlowPropertyProviderName(), "FA-1");
View Full Code Here

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");

        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));

        FlowActivityImpl fa4 = createFA("FA-4");
        FlowActivityImpl fa5 = createFA("FA-5");
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(MORPHED_FLOW, fa4, fa5));

        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        FlowState flowState = flowManagement.startFlowState(FIRST_FLOW, true, null, false);
        assertEquals(flowState.getFlow().getFlowPropertyProviderName(), FIRST_FLOW);
        assertEquals(flowState.getCurrentActivity().getFlowPropertyProviderName(), "FA-1");
View Full Code Here

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");

        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));

        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(MORPHED_FLOW, fa3, fa2, fa1));

        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();

        FlowState flowState = flowManagement.startFlowState(FIRST_FLOW, true, null, false);
        assertEquals(flowState.getFlow().getFlowPropertyProviderName(), FIRST_FLOW);
View Full Code Here

        ((FlowActivityImplementor)flow.getActivity(0)).addPropertyDefinitions(overlap);
        return flow;
    }

    private FlowImplementor createSimpleFlow(String flowTypeName) {
        FlowImplementor simple = new FlowImpl(flowTypeName);
        return simple;
    }
View Full Code Here

        FlowImplementor simple = new FlowImpl(flowTypeName);
        return simple;
    }

    private FlowImplementor createFlow2(String flowTypeName, int size) {
        FlowImplementor simple = new FlowImpl(flowTypeName);

        for (int i = 0; i < size; i++) {
            FlowActivityImpl activity = new FlowActivityImpl();
            activity.setComponentName("comp#"+i);
            simple.addActivity(activity);
        }
        return simple;
    }
View Full Code Here

TOP

Related Classes of org.amplafi.flow.impl.FlowImpl

Copyright © 2018 www.massapicom. 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.