Package org.amplafi.flow

Examples of org.amplafi.flow.FlowState


            return;
        }

        invokeIfNotNull(cycle, getFinishListener(), getEndListener());

        FlowState currentFlowState = getAttachedFlowState();
        try {
            String page = currentFlowState.finishFlow();
            // because the new active flow can be very different
            FlowState newCurrentFlow = getFlowManagement().getCurrentFlowState();
            if ( newCurrentFlow != null ) {
                page = newCurrentFlow.getCurrentPage();
            } else {
                newCurrentFlow = currentFlowState;
            }
            FlowWebUtils.activatePageIfNotNull(cycle, page, newCurrentFlow);
        } catch (FlowValidationException flowValidationException) {
View Full Code Here


    /**
     * @param cycle
     * @param flowTransition
     */
    private void onAltFinish(IRequestCycle cycle, FlowTransition flowTransition) {
        FlowState attachedFlow = getAttachedFlowState();
        /// HACK should be calling flowTransition.getFlowLauncher()
        if (flowTransition.isMorphingFlow()) {
            String nextFlow = flowTransition.getNextFlowType();
            String page = attachedFlow.morphFlow(nextFlow, flowTransition.getInitialValues());
            FlowWebUtils.activatePageIfNotNull(cycle, page, attachedFlow);
        } else {
            attachedFlow.setFinishKey(flowTransition.getMapKey());
            onFinish(cycle);
        }
    }
View Full Code Here

    }

    public void onCancel(IRequestCycle cycle) {
        invokeIfNotNull(cycle, getCancelListener(), getEndListener());

        FlowState currentFlowState = getAttachedFlowState();
        String page = currentFlowState.cancelFlow();
        FlowWebUtils.activatePageIfNotNull(cycle, page, currentFlowState);
    }
View Full Code Here

        FlowWebUtils.activatePageIfNotNull(cycle, page, currentFlowState);
    }

    public void onPrevious(IRequestCycle cycle) {
        invokeIfNotNull(cycle, getPreviousListener());
        FlowState currentFlowState = getAttachedFlowState();
        FlowActivity previous = currentFlowState.previous();
        String page = previous.getPageName();
        FlowWebUtils.activatePageIfNotNull(cycle, page, currentFlowState);
    }
View Full Code Here

            return;
        }

        invokeIfNotNull(cycle, getNextListener());

        FlowState currentFlowState = getAttachedFlowState();
        FlowValidationResult result = currentFlowState.getCurrentActivityFlowValidationResult();
        if (result.isValid()) {
            FlowActivity next = currentFlowState.next();
            if(next != null){
                // HACK : TO KOSTYA : add more details here! How do you know that there is not another error that you are now hiding?
                // Please check this again : Some ideas for you to investigate ( and fix! )  - does this relate to the next FA being invisible?
                // The Next button should not be visible if there is no next FA... Please investigate further.
                // A Comment like :"for some reason can be null when using transition" - is marginally useful add as many details as you can when you have to put in a HACK
View Full Code Here

     * @param cycle
     */
    public void onUpdate(IRequestCycle cycle) {
        invokeIfNotNull(cycle, getUpdateListener());

        FlowState currentFlowState = getAttachedFlowState();
        FlowValidationResult result = currentFlowState.getCurrentActivityFlowValidationResult();
        if (result.isValid()) {
            String page = currentFlowState.getCurrentPage();
            FlowWebUtils.activatePageIfNotNull(cycle, page, currentFlowState);
        } else {
            getFlowResultHandler().handleFlowResult(result, this);
        }
    }
View Full Code Here

    public String dropFlowState(FlowState flow) {
        return this.dropFlowStateByLookupKey(flow.getLookupKey());
    }

    public String getCurrentPage() {
        FlowState flow = getCurrentFlowState();
        if (flow != null ) {
            return flow.getCurrentPage();
        } else {
            return null;
        }
    }
View Full Code Here

    }
    /**
     * @see org.amplafi.flow.FlowManagement#getCurrentActivity()
     */
    public FlowActivity getCurrentActivity() {
        FlowState current = getCurrentFlowState();
        if ( current != null ) {
            return current.getCurrentActivity();
        } else {
            return null;
        }
    }
View Full Code Here

     * @see org.amplafi.flow.FlowManagement#transitionToFlowState(FlowState, String)
     */
    @SuppressWarnings("unchecked")
    @Override
    public FlowState transitionToFlowState(FlowState flowState, String key) {
        FlowState nextFlowState = null;
        Map<String, FlowTransition> transitions = flowState.getProperty(key, Map.class);
        String finishKey = flowState.getFinishKey();
        if ( isNotEmpty(transitions) && isNotBlank(finishKey)) {
            FlowTransition flowTransition = transitions.get(finishKey);
            if ( flowTransition != null ) {
View Full Code Here

    protected Map<String, String> initReturnToFlow(Map<String, String> initialFlowState, Object returnToFlow) {
        if ( returnToFlow != null) {
            String returnToFlowLookupKey = null;
            if ( returnToFlow instanceof Boolean) {
                if ( ((Boolean)returnToFlow).booleanValue()) {
                    FlowState currentFlowState = getCurrentFlowState();
                    if ( currentFlowState != null) {
                        returnToFlowLookupKey = currentFlowState.getLookupKey();
                    }
                }
            } else if ( returnToFlow instanceof FlowState) {
                returnToFlowLookupKey = ((FlowState)returnToFlow).getLookupKey();
            } else {
View Full Code Here

TOP

Related Classes of org.amplafi.flow.FlowState

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.