|
@ -3,6 +3,8 @@ package com.example.demo.controller; |
|
|
import com.example.demo.entity.Holiday; |
|
|
import com.example.demo.entity.Holiday; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
import org.activiti.api.process.model.builders.ProcessPayloadBuilder; |
|
|
|
|
|
import org.activiti.api.process.runtime.ProcessRuntime; |
|
|
import org.activiti.api.task.runtime.TaskRuntime; |
|
|
import org.activiti.api.task.runtime.TaskRuntime; |
|
|
import org.activiti.engine.ProcessEngine; |
|
|
import org.activiti.engine.ProcessEngine; |
|
|
import org.activiti.engine.RepositoryService; |
|
|
import org.activiti.engine.RepositoryService; |
|
@ -38,6 +40,9 @@ public class HolidayController { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private TaskRuntime taskRuntime; |
|
|
private TaskRuntime taskRuntime; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ProcessRuntime processRuntime; |
|
|
|
|
|
|
|
|
@ApiOperation(value = "发布工作流") |
|
|
@ApiOperation(value = "发布工作流") |
|
|
@GetMapping("deploy") |
|
|
@GetMapping("deploy") |
|
|
public void deploy() { |
|
|
public void deploy() { |
|
@ -51,6 +56,7 @@ public class HolidayController { |
|
|
@ApiOperation(value = "启动工作流") |
|
|
@ApiOperation(value = "启动工作流") |
|
|
@GetMapping("start") |
|
|
@GetMapping("start") |
|
|
public void start() { |
|
|
public void start() { |
|
|
|
|
|
processRuntime.start(ProcessPayloadBuilder.start().withProcessDefinitionKey("").build()); |
|
|
RuntimeService runtimeService = processEngine.getRuntimeService(); |
|
|
RuntimeService runtimeService = processEngine.getRuntimeService(); |
|
|
Holiday holiday = new Holiday(); |
|
|
Holiday holiday = new Holiday(); |
|
|
holiday.setNum(7f); |
|
|
holiday.setNum(7f); |
|
|