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

cn.schoolwow.data.thread.flow.work.ExecuteLoopWorkFlow Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package cn.schoolwow.data.thread.flow.work;

import cn.schoolwow.data.thread.domain.DataThreadProgress;
import cn.schoolwow.data.thread.flow.handler.WorkTryCatchFinallyHandler;
import cn.schoolwow.data.thread.work.loop.LoopDataThreadHandler;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.quickflow.flow.FunctionFlow;

import java.util.concurrent.ThreadPoolExecutor;

public class ExecuteLoopWorkFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) flowContext.checkData("threadPoolExecutor");
        int startIndex = (int) flowContext.checkData("startIndex");
        int endIndex = (int) flowContext.checkData("endIndex");
        LoopDataThreadHandler loopDataThreadHandler = (LoopDataThreadHandler) flowContext.checkData("loopDataThreadHandler");
        DataThreadProgress dataThreadProgress = (DataThreadProgress) flowContext.checkData("dataThreadProgress");

        dataThreadProgress.total = endIndex-startIndex+1;
        dataThreadProgress.type = "Loop";

        for(int i=startIndex;i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy