package com.mortals.flowable.listener;

import lombok.extern.apachecommons.CommonsLog;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.engine.FormService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
import org.flowable.engine.delegate.event.FlowableProcessStartedEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author: zxfei
 * @date: 2021/8/10 7:23
 * @description:
 **/
@Component
@CommonsLog
public class ProcessInstanceStartListener extends AbstractFlowableEngineEventListener {
    @Autowired
    private TaskService taskService;
    @Autowired
    private FormService formService;
    @Autowired
    private RuntimeService runtimeService;


    @Override
    protected void processStarted(FlowableProcessStartedEvent event) {

        log.info("流程开始监听器……");

        super.processStarted(event);
    }


    @Override
    protected void taskCompleted(FlowableEngineEntityEvent event) {
        log.info("进入taskCompleted监听器……");
        super.taskCompleted(event);
    }

    @Override
    public void onEvent(FlowableEvent flowableEvent) {
        log.info("进入taskCompleted监听器--onEvent……");
        super.onEvent(flowableEvent);
    }

}