Package org.amplafi.flow

Examples of org.amplafi.flow.FlowManagement


        String nextFlowType2 = flowTestingUtils.addFlowDefinition(newFlowActivity());
        TransitionFlowActivity transitionFlowActivity2 = new TransitionFlowActivity();
        transitionFlowActivity2.setNextFlowType(nextFlowType2);

        String flowTypeName = flowTestingUtils.addFlowDefinition(newFlowActivity(), transitionFlowActivity0, transitionFlowActivity1, transitionFlowActivity2);
        FlowManagement flowManagement = flowTestingUtils.getFlowManager().getFlowManagement();
        FlowState flowState = flowManagement.startFlowState(flowTypeName, true, null, returnToFlowLookupKey);
        flowTestingUtils.advanceToEnd(flowState);
        FlowState nextFlowState = flowManagement.getCurrentFlowState();
        // the alternate condition was not met.
        assertNotNull(nextFlowState);
        assertEquals(nextFlowState.getFlowTypeName(), nextFlowType2);

        flowState = flowManagement.startFlowState(flowTypeName, true, null, returnToFlowLookupKey);
        flowState.setFinishKey(TransitionType.alternate.toString());
        flowTestingUtils.advanceToEnd(flowState);
        nextFlowState = flowManagement.getCurrentFlowState();
        assertNotNull(nextFlowState);
        assertEquals(nextFlowState.getFlowTypeName(), nextFlowType0);

        flowState = flowManagement.startFlowState(flowTypeName, true, null, returnToFlowLookupKey);
        flowState.setFinishKey("foo1");
        flowTestingUtils.advanceToEnd(flowState);
        nextFlowState = flowManagement.getCurrentFlowState();
        assertNotNull(nextFlowState);
        assertEquals(nextFlowState.getFlowTypeName(), nextFlowType1);
    }
View Full Code Here


    public <T> T get(FlowActivityImplementor flowPropertyProvider, FlowPropertyDefinition flowPropertyDefinition) {
        check(flowPropertyDefinition);
        String label = "message:flow.label-cancel";
        String lookupKey =flowPropertyProvider.getProperty(FSRETURN_TO_FLOW);
        if ( lookupKey != null ) {
            FlowManagement flowManagement = flowPropertyProvider.getFlowState().getFlowManagement();
            FlowState flowState = flowManagement.getFlowState(lookupKey);
            if ( flowState != null) {
                label = flowState.getCurrentActivity().getProperty(FSRETURN_TO_TEXT);
                if (isBlank(label)) {
                    // TODO -- how to internationalize?
                    label = "Return to "+flowState.getFlowTitle();
View Full Code Here

     *        flow instance.
     * @return created {@link FlowState}
     */
    @SuppressWarnings("unchecked")
    protected <FS extends FlowState> FS createNewFlow(String spawnFlowTypeName) {
        FlowManagement fm = getFlowManagement();
        FS createdFlowState = (FS) fm.createFlowState(spawnFlowTypeName, getFlowState().getExportedValuesMap(), false);
        return createdFlowState;
    }
View Full Code Here

        }
    }

    // TODO inject....
    protected Log getLog() {
        FlowManagement flowManagement = getFlowManagement();
        return flowManagement != null ? flowManagement.getLog() : LogFactory
                .getLog(this.getClass());
    }
View Full Code Here

TOP

Related Classes of org.amplafi.flow.FlowManagement

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.