Browse Source

runtime

master
燕鹏 4 years ago
parent
commit
947dcc68f3
  1. 1
      build.gradle
  2. 6
      src/main/java/com/example/demo/controller/HolidayController.java

1
build.gradle

@ -22,6 +22,7 @@ dependencies {
implementation 'org.activiti:activiti-spring-boot-starter:7.1.0.M3.1'
implementation 'org.activiti:activiti-image-generator:7.1.0.M3.1'
// compile group: 'org.activiti.dependencies', name: 'activiti-dependencies', version: '7.1.0.M3.1', ext: 'pom'
runtimeOnly 'mysql:mysql-connector-java'

6
src/main/java/com/example/demo/controller/HolidayController.java

@ -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);

Loading…
Cancel
Save