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