Merge branch 'feature/REQ-1309' into dev

This commit is contained in:
wangli 2023-10-11 20:09:28 +08:00
commit 95e17faee6
4 changed files with 30 additions and 2 deletions

View File

@ -2,7 +2,8 @@
## 1. Flowable 官网文档
[点击打开](https://www.flowable.com/open-source)
- [商业版](https://www.flowable.com/)
- [开源版](https://www.flowable.com/open-source)
## 2. Flowable 相关表结构说明
> Flowable的数据库名称以ACT_开头。第二部分是表用例的两个字符的标识。

View File

@ -36,6 +36,15 @@
<scope>provided</scope>
</dependency>
<!-- 引入 Flowable JSON Convertor
但前端的功能不兼容改工具类,估移除
-->
<!--<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-json-converter</artifactId>
<version>${flowable.version}</version>
</dependency>-->
<!-- 引入 BPMN 引擎 -->
<dependency>
<groupId>org.flowable</groupId>

View File

@ -1,10 +1,17 @@
package cn.axzo.workflow.server.controller.web;
import cn.axzo.framework.jackson.utility.JSON;
import cn.axzo.workflow.common.model.response.bpmn.process.ProcessNodeDetailVO;
import cn.axzo.workflow.core.service.BpmnProcessInstanceService;
import cn.axzo.workflow.core.service.support.FlowNodeForecastService;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.editor.language.json.converter.BpmnJsonConverter;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@ -30,6 +37,10 @@ public class TestController {
private FlowNodeForecastService forecastService;
@Autowired
private BpmnProcessInstanceService instanceService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private RepositoryService repositoryService;
@GetMapping("/test")
public void test(@RequestParam String processInstanceId) {
List<FlowElement> flowElements = forecastService.performProcessForecasting(processInstanceId, null);
@ -42,4 +53,12 @@ public class TestController {
System.out.println("detailVOS = " + detailVOS);
}
@GetMapping("/test3")
public String test3(@RequestParam String processInstanceId) {
ProcessInstance instance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId)
.includeProcessVariables().singleResult();
BpmnModel bpmnModel = repositoryService.getBpmnModel(instance.getProcessDefinitionId());
ObjectNode jsonNodes = new BpmnJsonConverter().convertToJson(bpmnModel);
return JSON.toJSONString(jsonNodes);
}
}

View File

@ -142,7 +142,6 @@ public class BpmnProcessInstanceController implements ProcessInstanceApi {
@Override
public CommonResponse<List<ProcessNodeDetailVO>> processInstanceNodeForecast(@NotBlank(message = "流程实例 ID 不能为空") @RequestParam String processInstanceId,
@Nullable String tenantId) {
// return success(bpmnProcessInstanceService.getProcessNodes(processInstanceId, tenantId));
return success(bpmnProcessInstanceService.getProcessInstanceNodeForecast(processInstanceId, tenantId));
}