Examples of FlowStateLifecycle


Examples of org.amplafi.flow.FlowStateLifecycle

        this.lookupKey = null;
    }

    @Override
    public String begin() {
        FlowStateLifecycle lifecycle = this.getFlowStateLifecycle();
        if ( lifecycle != null ) {
            switch( lifecycle ) {
            case initialized:
                // normal case continue with begin
                break;
            case created:
                // o.k. behavior - not initialized yet so do the initialization.
                this.initializeFlow();
                break;
            case initializing:
                // begin() within an initializing ??? very odd. for now just log and return
                getLog().debug(this+": begin() called but state is "+lifecycle);
                return null;
            case started:
                // double begin() called. slightly bad coding but o.k. otherwise
                return this.getCurrentPage();
            case starting:
                // nested begin()'s also odd but for now just log and return.
                getLog().debug(this+": begin() called but state is "+lifecycle);
                return getCurrentPage();
            default:
                // the flowState has completed -- trying to restart is not supported.
                getLog().debug(this+": begin() called but flow completed already state is "+lifecycle);
                return getCurrentPage();
            }
        }
        this.setFlowLifecycleState(starting);
        FlowStateLifecycle nextFlowLifecycleState = failed;
        try {
            // TODO ... should we just be using next()... seems better.
            selectActivity(0, true);
            nextFlowLifecycleState = started;
        } catch(RuntimeException e) {
View Full Code Here

Examples of org.amplafi.flow.FlowStateLifecycle

     *
     * @see org.amplafi.flow.FlowState#initializeFlow()
     */
    public void initializeFlow() {
        this.setFlowLifecycleState(initializing);
        FlowStateLifecycle nextFlowLifecycleState = initialized;
        try {
            Map<String, FlowPropertyDefinition> propertyDefinitions = this.getFlow().getPropertyDefinitions();
            if (propertyDefinitions != null) {
                Collection<FlowPropertyDefinition> flowPropertyDefinitions = propertyDefinitions.values();
                initializeFlowProperties(this, flowPropertyDefinitions);
View Full Code Here

Examples of org.amplafi.flow.FlowStateLifecycle

    }

    @Override
    public void setFlowLifecycleState(FlowStateLifecycle flowStateLifecycle) {
        if ( this.flowStateLifecycle != flowStateLifecycle) {
            FlowStateLifecycle previousFlowLifecycleState = this.flowStateLifecycle;
            this.flowStateLifecycle = STATE_CHECKER.checkAllowed(this.flowStateLifecycle, flowStateLifecycle);
            this.getFlowManagement().lifecycleChange(this, previousFlowLifecycleState);
        }
    }
View Full Code Here

Examples of org.amplafi.flow.FlowStateLifecycle

        this.lookupKey = null;
    }

    @Override
    public String begin() {
        FlowStateLifecycle lifecycle = this.getFlowStateLifecycle();
        if ( lifecycle != null ) {
            switch( lifecycle ) {
            case initialized:
                // normal case continue with begin
                break;
            case created:
                // o.k. behavior - not initialized yet so do the initialization.
                this.initializeFlow();
                break;
            case initializing:
                // begin() within an initializing ??? very odd. for now just log and return
                getLog().debug(this+": begin() called but state is "+lifecycle);
                return null;
            case started:
                // double begin() called. slightly bad coding but o.k. otherwise
                return this.getCurrentPage();
            case starting:
                // nested begin()'s also odd but for now just log and return.
                getLog().debug(this+": begin() called but state is "+lifecycle);
                return getCurrentPage();
            default:
                // the flowState has completed -- trying to restart is not supported.
                getLog().debug(this+": begin() called but flow completed already state is "+lifecycle);
                return getCurrentPage();
            }
        }
        this.setFlowLifecycleState(starting);
        FlowStateLifecycle nextFlowLifecycleState = failed;
        try {
            // TODO ... should we just be using next()... seems better.
            selectActivity(0, true);
            nextFlowLifecycleState = started;
        } catch(RuntimeException e) {
View Full Code Here

Examples of org.amplafi.flow.FlowStateLifecycle

     *
     * @see org.amplafi.flow.FlowState#initializeFlow()
     */
    public void initializeFlow() {
        this.setFlowLifecycleState(initializing);
        FlowStateLifecycle nextFlowLifecycleState = initialized;
        try {
            Map<String, FlowPropertyDefinition> propertyDefinitions = this.getFlow().getPropertyDefinitions();
            if (propertyDefinitions != null) {
                Collection<FlowPropertyDefinition> flowPropertyDefinitions = propertyDefinitions.values();
                initializeFlowProperties(this, flowPropertyDefinitions);
View Full Code Here

Examples of org.amplafi.flow.FlowStateLifecycle

    }

    @Override
    public void setFlowLifecycleState(FlowStateLifecycle flowStateLifecycle) {
        if ( this.flowStateLifecycle != flowStateLifecycle) {
            FlowStateLifecycle previousFlowLifecycleState = this.flowStateLifecycle;
            this.flowStateLifecycle = STATE_CHECKER.checkAllowed(this.flowStateLifecycle, flowStateLifecycle);
            this.getFlowManagement().lifecycleChange(this, previousFlowLifecycleState);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.