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

cn.schoolwow.workflow.composite.task.CompleteTaskCompositeBusiness Maven / Gradle / Ivy

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

import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;
import cn.schoolwow.workflow.flow.common.InsertWorkFlowTaskFlow;
import cn.schoolwow.workflow.flow.handler.TransactionTryCatchFinallyHandler;
import cn.schoolwow.workflow.flow.task.complete.*;
import cn.schoolwow.workflow.flow.task.listener.ExecuteAfterCompleteTaskListenerFlow;
import cn.schoolwow.workflow.flow.task.listener.ExecuteAfterTaskCreateListenerFlow;
import cn.schoolwow.workflow.flow.task.listener.ExecuteBeforeCompleteTaskListenerFlow;

public class CompleteTaskCompositeBusiness implements CompositeBusinessFlow {
    @Override
    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
        quickFlowExecutor.next(new CheckCompleteTaskRequestFlow())
                .next(new QueryTaskNextNodeFlow())
                .next(new ExecuteBeforeCompleteTaskListenerFlow())
                .next(new CompositeBusinessFlow() {
                    @Override
                    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
                        quickFlowExecutor.tryCatchFinallyHandler(new TransactionTryCatchFinallyHandler())
                                .next(new UpdateWorkFlowTaskStatusFlow())
                                .next(new UpdateWorkFlowInstanceFlow())
                                .next(new InsertWorkFlowTaskFlow())
                                .next(new AddWorkFlowHistoryFlow());
                    }

                    @Override
                    public String name() {
                        return "完成流程任务-更新数据库记录";
                    }
                })
                .next(new ExecuteAfterTaskCreateListenerFlow())
                .next(new ExecuteAfterCompleteTaskListenerFlow());
    }

    @Override
    public String name() {
        return "完成工作流实例任务";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy