Examples of FlowImpl


Examples of org.amplafi.flow.impl.FlowImpl

        assertFalse(fs.hasVisiblePrevious());
    }

    @Test(enabled=TEST_ENABLED)
    public void testInitialValuesOnFlow() {
        FlowImplementor flow = new FlowImpl(FLOW_TYPE);
        FlowPropertyDefinitionImpl globalDef = new FlowPropertyDefinitionImpl(PROPERTY1);
        globalDef.setInitial(INITIAL_VALUE);
        flow.addPropertyDefinitions(globalDef);
        FlowPropertyDefinitionImpl globalDef1 = new FlowPropertyDefinitionImpl(PROPERTY2);
        globalDef1.setInitial(INITIAL_VALUE);
        flow.addPropertyDefinitions(globalDef1);
        // activity #0
        FlowActivityImpl activity = new FlowActivityImpl();
        flow.addActivity(activity);
        // activity #1
        activity = new FlowActivityImpl();
        flow.addActivity(activity);
        // activity #2
        activity = new FlowActivityImpl();
        FlowPropertyDefinitionImpl localDef1 = new FlowPropertyDefinitionImpl(PROPERTY1);
        activity.addPropertyDefinitions(localDef1);
        flow.addActivity(activity);
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowTranslatorResolver().resolveFlow(flow);

        flowTestingUtils.getFlowDefinitionsManager().addDefinition(FLOW_TYPE, flow);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
View Full Code Here

Examples of org.amplafi.flow.impl.FlowImpl

    @Test(enabled=TEST_ENABLED)
    public void testConversion() {
        String returnToFlowLookupKey = null;
        Map<String, String> initialFlowState = new HashMap<String, String>();
        FlowImplementor flow = new FlowImpl(FLOW_TYPE);
        FlowPropertyDefinitionImpl definition = new FlowPropertyDefinitionImpl("foo", Long.class);
        flow.addPropertyDefinitions(definition);
        FlowActivityImpl fa1 = new FlowActivityImpl();
        flow.addActivity(fa1);
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowTranslatorResolver().resolve(fa1);
        flowTestingUtils.getFlowDefinitionsManager().addDefinition(FLOW_TYPE, flow);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        FlowState flowState = flowManagement.startFlowState(FLOW_TYPE, true, initialFlowState, returnToFlowLookupKey);
View Full Code Here

Examples of org.amplafi.flow.impl.FlowImpl

    private static final String FLOW_TYPE_2 = "ftype2";
    private static final String FLOW_TYPE_3 = "ftype3";
    private static final boolean TEST_ENABLED = true;
    @Test(enabled=TEST_ENABLED)
    public void testSimpleFlowTransitionMapChecking() {
        FlowImpl flow = new FlowImpl(FLOW_TYPE_1);
        FlowActivityImpl fa1 = new FlowActivityImpl().initInvisible(false);
        FlowPropertyDefinitionImplementor definition = fa1.getFlowPropertyDefinition(FSFLOW_TRANSITIONS);
        assertNull(definition);
        flow.addActivity(fa1);
        definition = fa1.getFlowPropertyDefinition(FSFLOW_TRANSITIONS);
        assertNotNull(definition);
        String returnToFlowLookupKey = null;
        definition.setFlowPropertyValueProvider(new AddToMapFlowPropertyValueProvider<FlowPropertyProvider, String,FlowTransition>(new FlowTransition("foo", FLOW_TYPE_2, "foo", TransitionType.alternate, null)));
        FlowManagement baseFlowManagement = getFlowManagement(flow);
View Full Code Here

Examples of org.amplafi.flow.impl.FlowImpl

     * check to make sure the flow returns to the original flow
     * check to make sure the altered value is returned to
     */
    @Test(enabled=TEST_ENABLED)
    public void testReturnToFlow() {
        FlowImpl mainFlow = new FlowImpl(FLOW_TYPE_1);
        String defaultAfterPage1 = "default-after-page-for-"+FLOW_TYPE_1;
        String defaultPage1 = "page-of-"+FLOW_TYPE_1;
        mainFlow.setPageName(defaultPage1);
        mainFlow.setDefaultAfterPage(defaultAfterPage1);
        FlowActivityImpl fa1 = new FlowActivityImpl().initInvisible(false);
        FlowPropertyDefinitionImpl copiedBackProperty = new FlowPropertyDefinitionImpl("copiedBackProperty").initAccess(PropertyScope.flowLocal, PropertyUsage.io);
        fa1.addPropertyDefinition(copiedBackProperty);
        mainFlow.addActivity(fa1);

        FlowImpl subFlow = new FlowImpl(FLOW_TYPE_2);
        String defaultAfterPage2 = "default-after-page-for-"+FLOW_TYPE_2;
        String defaultPage2 = "page-of-"+FLOW_TYPE_2;
        subFlow.setPageName(defaultPage2);
        subFlow.setDefaultAfterPage(defaultAfterPage2);
        FlowActivityImpl fa2_1 = new FlowActivityImpl().initInvisible(false);
        fa2_1.addPropertyDefinition(copiedBackProperty.clone());
        subFlow.addActivity(fa2_1);
        subFlow.addActivity(new TransitionFlowActivity());

        FlowImpl continuedFlow = new FlowImpl(FLOW_TYPE_3);
        String defaultAfterPage3 = "default-after-page-for-"+FLOW_TYPE_3;
        String defaultPage3 = "page-of-"+FLOW_TYPE_3;
        continuedFlow.setPageName(defaultPage3);
        continuedFlow.setDefaultAfterPage(defaultAfterPage3);
        FlowActivityImpl fa3_1 = new FlowActivityImpl().initInvisible(false);
        continuedFlow.addActivity(fa3_1);

        Object returnToFlowLookupKey = true;
        FlowManagement baseFlowManagement = getFlowManagement(mainFlow, subFlow, continuedFlow);
        FlowState flowState1 = baseFlowManagement.startFlowState(FLOW_TYPE_1, true, null, returnToFlowLookupKey);
        assertEquals(flowState1.getCurrentPage(), defaultPage1);
View Full Code Here

Examples of org.apache.axis2.description.FlowImpl

     * @return Returns Flow.
     * @throws DeploymentException <code>DeploymentException</code>
     */
    protected Flow processFlow(OMElement flowelement, ParameterInclude parent)
            throws DeploymentException {
        Flow flow = new FlowImpl();

        if (flowelement == null) {
            return flow;
        }

        Iterator handlers = flowelement.getChildrenWithName(new QName(TAG_HANDLER));

        while (handlers.hasNext()) {
            OMElement handlerElement = (OMElement) handlers.next();

            flow.addHandler(processHandler(handlerElement, parent));
        }

        return flow;
    }
View Full Code Here

Examples of org.apache.axis2.description.FlowImpl

    protected void setUp() throws Exception {
    }


    public void testFailureAtServerRequestFlow() throws Exception {
        Flow flow = new FlowImpl();
        Utils.addHandler(flow,
                new SpeakingHandler(),
                PhaseMetadata.PHASE_POLICY_DETERMINATION);
        Utils.addHandler(flow,
                new SpeakingHandler(),
View Full Code Here

Examples of org.apache.axis2.description.FlowImpl

     * @param flowelement       <code>OMElement</code>
     * @return
     * @throws DeploymentException  <code>DeploymentException</code>
     */
    protected Flow processFlow(OMElement flowelement, ParameterInclude parent) throws DeploymentException {
        Flow flow = new FlowImpl();
        if(flowelement == null){
            return flow;
        }
        Iterator handlers = flowelement.getChildrenWithName(
                new QName(HANDERST));
        while (handlers.hasNext()) {
            OMElement  handlerElement =  (OMElement)handlers.next();
            flow.addHandler(processHandler(handlerElement,parent));
        }
        return flow;
    }
View Full Code Here

Examples of org.apache.axis2.description.FlowImpl

     * @return
     * @throws DeploymentException  <code>DeploymentException</code>
     */
    protected Flow processFlow(OMElement flowelement, ParameterInclude parent)
            throws DeploymentException {
        Flow flow = new FlowImpl();
        if(flowelement == null){
            return flow;
        }
        Iterator handlers = flowelement.getChildrenWithName(
                new QName(HANDERST));
        while (handlers.hasNext()) {
            OMElement  handlerElement =  (OMElement)handlers.next();
            flow.addHandler(processHandler(handlerElement,parent));
        }
        return flow;
    }
View Full Code Here

Examples of org.apache.axis2.description.FlowImpl

    protected void setUp() throws Exception {
    }


    public void testFailureAtServerRequestFlow() throws Exception {
        Flow flow = new FlowImpl();
        Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
        Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
        Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
        Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
        Utils.addHandler(flow, culprit,PhaseMetadata.PHASE_POLICY_DETERMINATION);
View Full Code Here

Examples of org.apache.axis2.description.FlowImpl

    protected void setUp() throws Exception {
    }


    public void testFailureAtServerRequestFlow() throws Exception {
        Flow flow = new FlowImpl();
        Utils.addHandler(flow,
                new SpeakingHandler(),
                PhaseMetadata.PHASE_POLICY_DETERMINATION);
        Utils.addHandler(flow,
                new SpeakingHandler(),
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.