package com.zcc.acvitivi;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import java.util.List;
/**
* 完成当前任务
*/
public class ActivitiCompleteTask {
/*public static void main(String[] args) {
//创建流程引擎配置类
ProcessEngineConfiguration processEngineConfiguration=
ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
//流程引擎对象
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
//获取taskService
TaskService taskService = processEngine.getTaskService();
//处理当前任务(要先查询当前用户下的任务id)
taskService.complete("2505");
System.out.println("当前用户完成了当前任务");
}*/
/*public static void main(String[] args) {
//创建流程引擎配置类
ProcessEngineConfiguration processEngineConfiguration=
ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
//流程引擎对象
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
//获取taskService
TaskService taskService = processEngine.getTaskService();
//处理当前任务(要先查询当前用户下的任务id)
taskService.complete("5002");
System.out.println("当前用户完成了当前任务");
}*/
//7502
public static void main(String[] args) {
//创建流程引擎配置类
ProcessEngineConfiguration processEngineConfiguration=
ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
//流程引擎对象
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
//获取taskService
TaskService taskService = processEngine.getTaskService();
//处理当前任务(要先查询当前用户下的任务id)
taskService.complete("7502");
System.out.println("当前用户完成了当前任务");
}
}