package com.bbd.bpm.listener;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class NormalServiceTask implements JavaDelegate {

    private static final Logger Log = LoggerFactory.getLogger(NormalServiceTask.class);

    private Expression paramOne;

    private Expression paramTwo;

    @Override
    public void execute(DelegateExecution execution)  {
        Log.info("NormalServiceTask 开始执行");
        String value1 = (String) paramOne.getValue(execution);
        System.out.println(value1);

//        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
//
//        Task task = processEngine.getTaskService().createTaskQuery().processInstanceId(execution.getProcessInstanceId()).active().singleResult();
//
//        TaskService taskService = processEngine.getTaskService();
//        taskService.complete(task.getId());

        Log.info("NormalServiceTask 执行结束");


    }


}
