All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.workflow.composite.definition.DeployWorkFlowCompositeBusiness Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package cn.schoolwow.workflow.composite.definition;

import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;
import cn.schoolwow.workflow.flow.definition.deploy.ParseInputStreamFlow;
import cn.schoolwow.workflow.flow.definition.deploy.check.CheckDeployWorkArrayFlow;
import cn.schoolwow.workflow.flow.definition.deploy.check.CheckWorkFlowDeployExistFlow;
import cn.schoolwow.workflow.flow.definition.deploy.insert.InsertWorkFlowDefinitionFlow;
import cn.schoolwow.workflow.flow.definition.deploy.insert.InsertWorkFlowJumpFlow;
import cn.schoolwow.workflow.flow.definition.deploy.insert.InsertWorkFlowNodeFlow;
import cn.schoolwow.workflow.flow.handler.TransactionTryCatchFinallyHandler;

public class DeployWorkFlowCompositeBusiness implements CompositeBusinessFlow {
    @Override
    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
        quickFlowExecutor.next(new CheckWorkFlowDeployExistFlow())
                .next(new ParseInputStreamFlow())
                .next(new CheckDeployWorkArrayFlow())
                .next(new CompositeBusinessFlow() {
                    @Override
                    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
                        quickFlowExecutor.tryCatchFinallyHandler(new TransactionTryCatchFinallyHandler())
                                .next(new InsertWorkFlowDefinitionFlow())
                                .next(new InsertWorkFlowNodeFlow())
                                .next(new InsertWorkFlowJumpFlow());
                    }

                    @Override
                    public String name() {
                        return "部署工作流-插入数据库记录";
                    }
                });
    }

    @Override
    public String name() {
        return "部署工作流";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy