|
@@ -212,23 +212,18 @@ public class PreExecutionToolClass<R> {
|
|
|
public int executionNode(BpmRunNodeVo bpmRunNodeVo) {
|
|
|
System.err.println(bpmRunNodeVo.getTaskNodeKey());
|
|
|
System.err.println(bpmRunNodeVo.getNextNodeKey());
|
|
|
- // 任务流程编码
|
|
|
- String taskProcessKey = bpmRunNodeVo.getTaskProcessKey();
|
|
|
- // 任务节点编码
|
|
|
- String taskNodeKey = bpmRunNodeVo.getTaskNodeKey();
|
|
|
-
|
|
|
+ String taskProcessKey = bpmRunNodeVo.getTaskProcessKey(); // 任务流程编码
|
|
|
+ String taskNodeKey = bpmRunNodeVo.getTaskNodeKey(); // 任务节点编码
|
|
|
// 得到当前节点的所有信息-》用于执行节点前后绑定的自动运行的脚本
|
|
|
BpmExecuteNode currentBpmExecuteNode = runBpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(taskProcessKey, taskNodeKey);
|
|
|
- /*
|
|
|
- 执行节点
|
|
|
- 在执行节时得到除当前节点绑定的事件外需要自动执行的脚本(这些自动执行的脚本参数不能确定,无法传递)
|
|
|
- */
|
|
|
+ // 在执行节时得到除当前节点绑定的正常脚本外,有可能会绑定自动执行的脚本(这些自动执行的脚本参数不能确定,无法传递)
|
|
|
BpmExecuteNodeMiddle bpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(taskProcessKey, taskNodeKey);
|
|
|
String script[] = bpmExecuteNodeMiddle.getTaskNodeAroundScriptKey().split(","); // 得到当前节点需要自动执行的脚本
|
|
|
//--- 1️⃣1️⃣1️⃣执行节点前绑定的脚本🚀🚀🚀~!!!
|
|
|
+ System.err.println("--- 1️⃣1️⃣1️⃣执行节点前绑定的脚本🚀🚀🚀~!!!");
|
|
|
if (currentBpmExecuteNode.getTaskNodeBefore().equals("true")) {
|
|
|
// 调用执行脚本接口
|
|
|
- if (script.length != 0 && !script[0].isEmpty()) {
|
|
|
+ if (script != null && script.length != 0 && !script[0].isEmpty()) {
|
|
|
for (int i = 0; i < script.length; i++) {
|
|
|
// 节点执行必要的参数
|
|
|
IScriptEntity iScriptEntity = new IScriptEntity();
|
|
@@ -241,6 +236,7 @@ public class PreExecutionToolClass<R> {
|
|
|
}
|
|
|
}
|
|
|
//--- 2️⃣2️⃣2️⃣执行节点绑定的正常脚本🚀🚀🚀~!!!
|
|
|
+ System.err.println("--- 2️⃣2️⃣2️⃣执行节点绑定的正常脚本🚀🚀🚀~!!!");
|
|
|
IRunBPMEntity iRunBPMEntity = new IRunBPMEntity();
|
|
|
iRunBPMEntity.setImplementationName(bpmRunNodeVo.getImplementationName());
|
|
|
iRunBPMEntity.setExecutionFlowKey(taskProcessKey);
|
|
@@ -249,6 +245,7 @@ public class PreExecutionToolClass<R> {
|
|
|
iRunBPMEntity.setTableName(bpmRunNodeVo.getTableName());
|
|
|
iRunImplementationClass.RunBPMImplementationClassLogicCode(iRunBPMEntity);
|
|
|
//--- 2️⃣⚡️5️⃣ 当节点执行完成后修改节点的状态
|
|
|
+ System.err.println("--- 2️⃣⚡️5️⃣ 当节点执行完成后修改节点的状态");
|
|
|
BpmExecuteNode updateNodeStateEn = new BpmExecuteNode();
|
|
|
updateNodeStateEn.setTaskProcessKey(taskProcessKey);
|
|
|
updateNodeStateEn.setTaskNodeKey(taskNodeKey);
|
|
@@ -256,9 +253,10 @@ public class PreExecutionToolClass<R> {
|
|
|
// 修改当前节点的状态
|
|
|
runBpmExecuteNodeMapper.updateNodeState(updateNodeStateEn);
|
|
|
//--- 3️⃣3️⃣3️⃣执行节点后绑定的脚本🚀🚀🚀~!!!
|
|
|
+ System.err.println("--- 3️⃣3️⃣3️⃣执行节点后绑定的脚本🚀🚀🚀~!!!");
|
|
|
if (currentBpmExecuteNode.getTaskNodeAfter().equals("true")) {
|
|
|
// 调用执行脚本接口
|
|
|
- if (script.length != 0 && !script[0].isEmpty()) {
|
|
|
+ if (script != null && script.length != 0 && !script[0].isEmpty()) {
|
|
|
for (int i = 0; i < script.length; i++) {
|
|
|
// 节点执行必要的参数
|
|
|
IScriptEntity iScriptEntity = new IScriptEntity();
|
|
@@ -272,6 +270,7 @@ public class PreExecutionToolClass<R> {
|
|
|
}
|
|
|
BpmExecuteNode bpmExecuteNode = runBpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(bpmRunNodeVo.getTaskProcessKey(), bpmRunNodeVo.getNextNodeKey());
|
|
|
// 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点
|
|
|
+ System.err.println("--- 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点");
|
|
|
if (bpmExecuteNode.getTaskNodeType().equals("endEvent")) {
|
|
|
// 节点执行必要的参数
|
|
|
IScriptEntity iScriptEntity = new IScriptEntity();
|
|
@@ -296,7 +295,7 @@ public class PreExecutionToolClass<R> {
|
|
|
* 自动执行节点程序自己调用 自动执行节点绑定的脚本。(递归执行)
|
|
|
* !!! 调用自动执行的脚本无法传递除特定参数外的其他用户业务表中的参数
|
|
|
*/
|
|
|
-
|
|
|
+ System.err.println("*** ⤴️🔄♾️❗️校验下一个节点是否需要自动执行");
|
|
|
if (bpmExecuteNode.getTaskNodeExecuteType().equals("true")) { // 当前节点的下一个节点,。。。。。。,,。是自动执行
|
|
|
// 处理数据
|
|
|
BpmRunNodeVo bpmRunNodeVo1 = new BpmRunNodeVo();
|
|
@@ -307,8 +306,6 @@ public class PreExecutionToolClass<R> {
|
|
|
// 当前节点执行的脚本
|
|
|
BpmExecuteNodeMiddle nextBpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(bpmRunNodeVo.getTaskProcessKey(), bpmRunNodeVo.getNextNodeKey());
|
|
|
bpmRunNodeVo1.setImplementationName(nextBpmExecuteNodeMiddle.getTaskArtificialScriptKey());
|
|
|
-
|
|
|
-
|
|
|
BpmExecuteProcess bpmExecuteProcess = new BpmExecuteProcess();
|
|
|
bpmExecuteProcess.setTaskKey(bpmRunNodeVo.getTaskProcessKey());
|
|
|
bpmExecuteProcess.setTaskNodeKey(bpmRunNodeVo.getTaskNodeKey());
|
|
@@ -316,8 +313,7 @@ public class PreExecutionToolClass<R> {
|
|
|
runBpmExecuteProcessMapper.updateProcessNode(bpmExecuteProcess);
|
|
|
this.executionNode(bpmRunNodeVo1);
|
|
|
} else if (bpmExecuteNode.getTaskNodeExecuteType().equals("false")) {
|
|
|
-
|
|
|
-
|
|
|
+ System.err.println("✅✅✅节点执行完成!!!");
|
|
|
BpmExecuteProcess bpmExecuteProcess = new BpmExecuteProcess();
|
|
|
bpmExecuteProcess.setTaskKey(bpmRunNodeVo.getTaskProcessKey());
|
|
|
bpmExecuteProcess.setTaskNodeKey(bpmRunNodeVo.getTaskNodeKey());
|
|
@@ -325,7 +321,6 @@ public class PreExecutionToolClass<R> {
|
|
|
runBpmExecuteProcessMapper.updateProcessNode(bpmExecuteProcess);
|
|
|
return HttpStatus.SUCCESS;
|
|
|
}
|
|
|
-
|
|
|
return HttpStatus.SUCCESS;
|
|
|
}
|
|
|
|