Package org.amplafi.flow

Examples of org.amplafi.flow.FlowImplementor


    /**
     * @see org.amplafi.flow.FlowManager#getInstanceFromDefinition(java.lang.String)
     */
    @Override
    public FlowImplementor getInstanceFromDefinition(String flowTypeName) {
        FlowImplementor definition = flowDefinitionsManager.getFlowDefinition(flowTypeName);
        if (definition == null) {
            throw new IllegalArgumentException(flowTypeName + ": definition does not exist");
        }
        FlowImplementor inst = definition.createInstance();
        return inst;
    }
View Full Code Here


    @Override
    public FlowImplementor getFlowDefinition(String flowTypeName) {
        if ( flowTypeName == null) {
            throw new IllegalArgumentException("null flowTypeName");
        }
        FlowImplementor flow = this.getFlowDefinitions().get(flowTypeName);
        if (flow==null) {
            throw new FlowValidationException("flow.definition-not-found", new MissingRequiredTracking(flowTypeName));
        }
        return flow;
    }
View Full Code Here

     * 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

        IComponent component = createMock(IComponent.class);
        expect(component.getSpecification()).andReturn(compSpec);

        trainUsingMemoryLocation(compSpec);

        FlowImplementor flow = createSimpleFlow(type);
        trainGetFlowForComponent(type, flow, delegate);
        trainParser(delegate);
        Locale locale = null;
        IRequestCycle cycle = createMock(IRequestCycle.class);
View Full Code Here

        IComponent component = createMock(IComponent.class);
        expect(component.getSpecification()).andReturn(compSpec);
        expect(component.getNamespace()).andReturn(null).anyTimes();
        expect(component.getLocation()).andReturn(null);
        FlowImplementor flow = createFlow2(componentName, 1);
        trainGetFlowForComponent(componentName, flow, delegate);
        trainParser(delegate);
        IRequestCycle cycle = createMock(IRequestCycle.class);
        csr.resolve(cycle, null, componentName, null);
        expect(csr.getSpecification()).andReturn(compSpec);
View Full Code Here

        IComponent component = createMock(IComponent.class);
        expect(component.getSpecification()).andReturn(compSpec);
        expect(component.getNamespace()).andReturn(null).anyTimes();
        expect(component.getLocation()).andReturn(null);
        FlowImplementor flow = createFlowWithProperties(componentName);
        trainGetFlowForComponent(componentName, flow, delegate);
        trainParser(delegate);
        IRequestCycle cycle = createMock(IRequestCycle.class);
        csr.resolve(cycle, null, componentName, null);
        expect(csr.getSpecification()).andReturn(compSpec);
View Full Code Here

        }
        replay(templateParser);
    }

    private FlowImplementor createFlowWithProperties(String componentName) {
        FlowImplementor flow = createFlow2(componentName, 1);
        FlowPropertyDefinitionImpl globalDef = new FlowPropertyDefinitionImpl("globaldef1");
        globalDef.setUiComponentParameterName("componentGlobaldef1");
        flow.addPropertyDefinitions(globalDef);
        FlowPropertyDefinitionImpl globalOverlap = new FlowPropertyDefinitionImpl("overlap");
        globalOverlap.setUiComponentParameterName("globalOverlapParameter");
        flow.addPropertyDefinitions(globalOverlap);
        FlowPropertyDefinitionImpl overlap  = new FlowPropertyDefinitionImpl("overlap");
        overlap.setUiComponentParameterName("componentOverlapParameter");
        ((FlowActivityImplementor)flow.getActivity(0)).addPropertyDefinitions(overlap);
        return 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.FlowImplementor

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.