package net.northking.cctp.flowable;

import net.northking.cctp.flowable.api.implement.service.ImplementProcessService;
import net.northking.cctp.flowable.api.sm.service.StateProcessDefApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class WorkFlowAppRunner implements ApplicationRunner {

    @Autowired
    private StateProcessDefApiService processService;

    @Autowired
    private ImplementProcessService imProcessService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        processService.reloadFinishedCache();
        imProcessService.reloadProcessCache();
    }
}
