Package org.amplafi.flow

Examples of org.amplafi.flow.FlowActivity


     * @see org.amplafi.flow.FlowState#isFinishable()
     */
    @Override
    public boolean isFinishable() {
        if ( !isCompleted()) {
            FlowActivity currentActivity = this.getCurrentActivity();
            // may not have been started
            if ((currentActivity != null && currentActivity.isFinishingActivity()) || !hasVisibleNext()) {
                // explicitly able to finish.
                // or last visible step, which must always be able to finish.
                return true;
            } else {
                // all remaining activities claim they have valid data.
View Full Code Here


    @Deprecated
    public Long getLong(String key) {
        return getRawLong(null, key);
    }
    public FlowValidationResult getCurrentActivityFlowValidationResult(FlowActivityPhase flowActivityPhase, FlowStepDirection flowStepDirection) {
        FlowActivity currentActivity = this.getCurrentActivity();
        if (currentActivity == null) {
            return null;
        } else {
            if (FlowActivityPhase.advance == flowActivityPhase && flowStepDirection == FlowStepDirection.forward) {
                // TODO temp hack
                return currentActivity.getFlowValidationResult();
            } else {
                return currentActivity.getFlowValidationResult(flowActivityPhase, flowStepDirection);
            }
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public <T> T getProperty(String key, Class<? extends T> expected) {
        if (isActive()) {
            FlowActivity currentActivity = getCurrentActivity();
            return currentActivity.getProperty(key, expected);
        } else {
            FlowPropertyDefinition flowPropertyDefinition = getFlowPropertyDefinitionWithCreate(key, expected, null);
            return (T) getPropertyWithDefinition(this, flowPropertyDefinition);
        }
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    @Override
    public <T> void setProperty(String key, T value) {
        if (isActive()) {
            FlowActivity currentActivity = getCurrentActivity();
            currentActivity.setProperty(key, value);
        } else {
            Class<T> expected = (Class<T>) (value == null?null:value.getClass());
            FlowPropertyDefinitionImplementor flowPropertyDefinition = getFlowPropertyDefinitionWithCreate(key, expected, value);
            setPropertyWithDefinition(null, flowPropertyDefinition, value);
        }
View Full Code Here

            }
            int activity = flow.getCurrentActivityIndex();
            String blockName = FlowWebUtils.getBlockName(activity);
            IComponent comp = getComponentSafe(blockName);
            if(comp==null) {
                FlowActivity flowActivity = flow.getCurrentActivity();
                if(flowActivity == null){
                    String message = getStartErrorMessage(flow) + "' but current activity (#" + activity + ") is null. Flow state: " + flow.getFlowStateLifecycle() + "; Values: " + flow.getFlowValuesMap() ;
                    throw new IllegalStateException(message);
                } else {
                    String message = getStartErrorMessage(flow) + "' but there is no component named '" + blockName + "'. This should be the block containing the FlowActivity named '" + flowActivity.getFlowPropertyProviderName() + "' (activity #" + activity + ") ";
                    if ( flowActivity.isInvisible() ) {
                        throw new IllegalStateException(message+" -- this is an invisible activity");
                    } else {
                        throw new IllegalStateException(message+" -- flow activity claims it is supposed to be visible. Are you sure this flow is defined on this page?");
                    }
                }
View Full Code Here

            return attachedFlowState.getVisibleActivities();
        }
    }

    public String getActivityTitle() {
        FlowActivity flowActivity = getCurrentActivity();
        String title = flowActivity.getActivityTitle();
        if (title==null) {
            title = getUnnamedActivity();
        }
        return processLabel(title, null);
    }
View Full Code Here

    /**
     *
     * @return true if the current activity is disabled.
     */
    public boolean isActivityDisabled() {
        FlowActivity currentActivity = getCurrentActivity();
        // TODO: isActivatable() is always false because when the flow advances it does not set to true.
        return currentActivity == null || !currentActivity.isActivatable();
    }
View Full Code Here

        }

        FlowState currentFlow = getAttachedFlowState();
        int activityToGo = getActivityToGo();
        try {
            FlowActivity next = currentFlow.selectVisibleActivity(activityToGo);
            String page = next.getPageName();
            if (page!=null) {
                getPage().getRequestCycle().activate(page);
            } else {
                updateComponents(findComponentsToUpdate(getUpdateComponents()));
            }
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.