Package org.amplafi.flow

Examples of org.amplafi.flow.FlowActivity


    }

    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


        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
                // which should be labeled a HACK ( so we can grep for HACK markers in the code ).
                // P.S. this is what I do all the time... constant cleaning it seems :-)
                String page = next.getPageName();
                FlowWebUtils.activatePageIfNotNull(cycle, page, currentFlowState);
            }
        } else {
            getFlowResultHandler().handleFlowResult(result, this);
        }
View Full Code Here

    }

    @Override
    public void refresh() {
        int activityIndex = flowState.getCurrentActivityIndex();
        FlowActivity flowActivity = getActivity(activityIndex);
        if ( flowActivity != null ) {
            flowActivity.refresh();
        }
    }
View Full Code Here

                initializeFlowProperties(this, flowPropertyDefinitions);
            }

            int size = this.size();
            for (int i = 0; i < size; i++) {
                FlowActivity activity = getActivity(i);
                activity.initializeFlow();
                LapTimer.sLap(activity.getFlowPropertyProviderFullName(), ".initializeFlow() completed");
            }
        } catch(RuntimeException e) {
            nextFlowLifecycleState = failed;
            throw e;
        } finally {
View Full Code Here

        return this.getCurrentPage();
    }

    private FlowActivityImplementor getTargetFAInNextFlow(FlowActivityImplementor currentFAInOriginalFlow,
            List<FlowActivityImplementor> originalFAs, List<FlowActivityImplementor> nextFAs) {
        FlowActivity flowActivity = this.getActivity(currentFAInOriginalFlow.getFlowPropertyProviderName());
        if ( flowActivity != null ) {
            // cool .. exact match on the names.
            return (FlowActivityImplementor) flowActivity;
        }
        // find the first FlowActivity that is after all the flowActivities with the same names
        // as FlowActivities in the previous flow.to find the same approximate spot in the the new flow.
        int newCurrentIndex = this.getCurrentActivityIndex();
        for (int prevIndex = 0; prevIndex < originalFAs.size(); prevIndex++) {
            FlowActivity originalFA = originalFAs.get(prevIndex);
            if ( isEqualTo(originalFA, currentFAInOriginalFlow)) {
                break;
            }
            for(int nextIndex = newCurrentIndex; nextIndex < nextFAs.size(); nextIndex++) {
                FlowActivity nextFA = nextFAs.get(nextIndex);
                if(isEqualTo(originalFA, nextFA)) {
                    newCurrentIndex = nextIndex+1;
                }
            }
        }
View Full Code Here

        }
        FlowValidationException.valid(flowValidationResult);
        FlowState currentNextFlowState = getFlowManagement().transitionToFlowState(this, FSFLOW_TRANSITIONS);
        int size = this.size();
        for (int i = 0; i < size; i++) {
            FlowActivity activity = getActivity(i);
            FlowState returned = activity.finishFlow(currentNextFlowState);
            // activity.refresh(); -- commented out because saves default values back to the flowState
            // avoids lose track of FlowState if another FA later in the Flow
            // definition returns a null. ( this means that a FA cannot override a previous decision ).
            if (returned != null && currentNextFlowState != returned) {
                currentNextFlowState = returned;
View Full Code Here

            return null;
        }
        // used to help determine if the flow is not altering which FlowActivity is current. ( refresh case )
        int originalIndex = getCurrentActivityIndex();
        int next = newActivity;
        FlowActivity currentActivity;
        // if true, currentActivity indicated that it has finished processing and the FlowState should immediately advanced. Used primarily for invisible FlowActivities.
        boolean lastFlowActivityActivateAutoFinished;
        FlowStepDirection flowStepDirection = FlowStepDirection.get(originalIndex, newActivity);
        // based on the flowStepDirection. if true, then there another FlowActivity in the same direction as the current flowActivity
        boolean canContinue;
View Full Code Here

     */
    @Override
    public void saveChanges() {
        LapTimer.sLap(this.getActiveFlowLabel()," beginning saveChanges()");
        for (int i = 0; i < this.size(); i++) {
            FlowActivity flowActivity = getActivity(i);
            FlowValidationResult flowActivityValidationResult  = flowActivity.getFlowValidationResult(FlowActivityPhase.saveChanges, FlowStepDirection.forward);
            FlowValidationException.valid(flowActivityValidationResult);
            flowActivity.saveChanges();
            // activity.refresh(); -- commented out because saves default values back to the flowState
            LapTimer.sLap(flowActivity.getFlowPropertyProviderFullName(), ".saveChanges() completed");
        }
        LapTimer.sLap(this.getActiveFlowLabel()," end saveChanges()");
    }
View Full Code Here

        }
    }

    @Override
    public FlowValidationResult passivate(boolean verifyValues, FlowStepDirection flowStepDirection) {
        FlowActivity currentActivity = getCurrentActivity();
        if ( currentActivity != null ) {
            currentActivity.refresh();
            return currentActivity.passivate(verifyValues, flowStepDirection);
        }
        return null;
    }
View Full Code Here

            return this.getAfterPage();
        }
        String pageName = getProperty(FSPAGE_NAME);
        if (isBlank(pageName)) {
            if (isActive()) {
                FlowActivity flowActivity = getCurrentActivity();
                pageName = flowActivity.getPageName();
            }
            if (isBlank(pageName)) {
                pageName = this.getFlow().getPageName();
            }
        }
View Full Code Here

TOP

Related Classes of org.amplafi.flow.FlowActivity

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.