Package org.amplafi.flow

Examples of org.amplafi.flow.FlowValidationResult


            } else {
                newCurrentFlow = currentFlowState;
            }
            FlowWebUtils.activatePageIfNotNull(cycle, page, newCurrentFlow);
        } catch (FlowValidationException flowValidationException) {
            FlowValidationResult result = flowValidationException.getFlowValidationResult();
            getFlowResultHandler().handleFlowResult(result, this);
        }
    }
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.
View Full Code Here

     */
    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

     *
     * @param verifyValues if true check the flow to validate the {@link FlowActivityPhase#finish} properties.
     * @return the next flowState 'this' FlowActivities believe should be run.
     */
    protected FlowState finishFlowActivities(boolean verifyValues) {
        FlowValidationResult flowValidationResult = null;
        if (verifyValues) {
            flowValidationResult = getFullFlowValidationResult(FlowActivityPhase.finish, FlowStepDirection.forward);
        }
        FlowValidationException.valid(flowValidationResult);
        FlowState currentNextFlowState = getFlowManagement().transitionToFlowState(this, FSFLOW_TRANSITIONS);
View Full Code Here

        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;
        do {
            if(this.isActive()) {
                FlowValidationResult flowValidationResult;
                // call passivate even if just returning to the current
                // activity. but not if we are going back to a previous step
                flowValidationResult = this.passivate(verifyValues, flowStepDirection);
                if ( !flowValidationResult.isValid()) {
                    activateFlowActivity(getCurrentActivity(), FlowStepDirection.inPlace);
                    throw new FlowValidationException(getCurrentActivity(), flowValidationResult);
                }
            }
            this.setCurrentActivityIndex(next);
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");
        }
View Full Code Here

    protected String completeFlow(FlowStateLifecycle nextFlowLifecycleState) {
        String pageName = null;
        if (!isCompleted()) {
            FlowState continueWithFlow = null;
            boolean verifyValues = nextFlowLifecycleState.isVerifyValues();
            FlowValidationResult flowValidationResult = passivate(verifyValues, FlowStepDirection.inPlace);

            if (verifyValues) {
                FlowValidationException.valid(flowValidationResult);
                saveChanges();
            }
View Full Code Here

        }
        return pageName;
    }

    public FlowValidationResult getFullFlowValidationResult(FlowActivityPhase flowActivityPhase, FlowStepDirection flowStepDirection) {
        FlowValidationResult flowValidationResult = new ReportAllValidationResult();
        // TODO : need to account for properties that earlier activities will create the property required by a later property.
        // we should look for PropertyUsage.create (and equivalents )
        for(FlowActivity flowActivity: this.getActivities()) {
            FlowValidationResult flowActivityValidationResult  = flowActivity.getFlowValidationResult(flowActivityPhase, flowStepDirection);
            flowValidationResult.merge(flowActivityValidationResult);
        }
        return flowValidationResult;
    }
View Full Code Here

    /**
     * @see org.amplafi.flow.FlowState#getFinishFlowValidationResult()
     */
    @Override
    public FlowValidationResult getFinishFlowValidationResult() {
        FlowValidationResult flowValidationResult = getCurrentActivityFlowValidationResult();
        if ( flowValidationResult == null || flowValidationResult.isValid()) {
            flowValidationResult = getFullFlowValidationResult(FlowActivityPhase.finish, FlowStepDirection.forward);
            if ( flowValidationResult == null || flowValidationResult.isValid()) {
                flowValidationResult = getFullFlowValidationResult(FlowActivityPhase.saveChanges, FlowStepDirection.forward);
            }
        }
        return flowValidationResult;
    }
View Full Code Here

    @Override
    public Map<String, FlowValidationResult> getFlowValidationResults(FlowActivityPhase flowActivityPhase, FlowStepDirection flowStepDirection) {
        Map<String, FlowValidationResult> result = new LinkedHashMap<String, FlowValidationResult>();
        for (FlowActivity activity : this.getActivities()) {
            FlowValidationResult flowValidationResult = activity.getFlowValidationResult(flowActivityPhase, flowStepDirection);
            if (!flowValidationResult.isValid()) {
                result.put(activity.getFlowPropertyProviderName(), flowValidationResult);
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.amplafi.flow.FlowValidationResult

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.