Merge branch 'feature/countersign_ext' into dev
This commit is contained in:
commit
c8daa07437
@ -191,7 +191,11 @@ public class CustomCountersignUserTaskCmd extends AbstractCommand<Void> implemen
|
|||||||
|
|
||||||
BpmnFlowNodeMode nodeMode = Objects.equals(originalUserTask.getLoopCharacteristics().getCompletionCondition(), AND_SIGN_EXPRESSION) ? BpmnFlowNodeMode.AND : BpmnFlowNodeMode.OR;
|
BpmnFlowNodeMode nodeMode = Objects.equals(originalUserTask.getLoopCharacteristics().getCompletionCondition(), AND_SIGN_EXPRESSION) ? BpmnFlowNodeMode.AND : BpmnFlowNodeMode.OR;
|
||||||
// 创建前加签节点
|
// 创建前加签节点
|
||||||
UserTask newUserTask = CustomBpmnModelHelper.createUserTask(processEngineConfiguration, originalUserTask, originalUserTask.getId() + FORWARD_ACTIVITY_FRAGMENT + forwardCounterSignCount, nodeMode, valuTargetAssigneeList);
|
String newActivityId = originalUserTask.getId();
|
||||||
|
if (newActivityId.contains(FORWARD_ACTIVITY_FRAGMENT)) {
|
||||||
|
newActivityId = newActivityId.substring(0, newActivityId.indexOf(FORWARD_ACTIVITY_FRAGMENT));
|
||||||
|
}
|
||||||
|
UserTask newUserTask = CustomBpmnModelHelper.createUserTask(processEngineConfiguration, originalUserTask, newActivityId + FORWARD_ACTIVITY_FRAGMENT + forwardCounterSignCount, nodeMode, valuTargetAssigneeList);
|
||||||
// 加入模型
|
// 加入模型
|
||||||
process.addFlowElement(newUserTask);
|
process.addFlowElement(newUserTask);
|
||||||
|
|
||||||
@ -204,9 +208,11 @@ public class CustomCountersignUserTaskCmd extends AbstractCommand<Void> implemen
|
|||||||
entity.setOriginalActivityId(originalUserTask.getId());
|
entity.setOriginalActivityId(originalUserTask.getId());
|
||||||
entity.setTargetActivityId(newUserTask.getId());
|
entity.setTargetActivityId(newUserTask.getId());
|
||||||
entity.setCounterSignType(FORWARD_COUNTERSIGN.getType());
|
entity.setCounterSignType(FORWARD_COUNTERSIGN.getType());
|
||||||
|
entity.setTargetNodeMode(nodeMode.getType());
|
||||||
entity.setAssignerList(valuTargetAssigneeList);
|
entity.setAssignerList(valuTargetAssigneeList);
|
||||||
extAxDynamicSignRecordService.saveOrUpdate(entity);
|
extAxDynamicSignRecordService.saveOrUpdate(entity);
|
||||||
|
|
||||||
|
runtimeService.setVariable(processInstance.getId(), FORWARD_COUNTERSIGN_COUNT, forwardCounterSignCount);
|
||||||
runtimeService.createChangeActivityStateBuilder()
|
runtimeService.createChangeActivityStateBuilder()
|
||||||
.processInstanceId(task.getProcessInstanceId())
|
.processInstanceId(task.getProcessInstanceId())
|
||||||
.moveActivityIdTo(task.getTaskDefinitionKey(), newUserTask.getId())
|
.moveActivityIdTo(task.getTaskDefinitionKey(), newUserTask.getId())
|
||||||
|
|||||||
@ -39,12 +39,15 @@ public class ExtAxDynamicSignRecord extends BaseEntity<ExtAxDynamicSignRecord> {
|
|||||||
* 加签目标节点
|
* 加签目标节点
|
||||||
*/
|
*/
|
||||||
private String targetActivityId;
|
private String targetActivityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加签类型,前加签/后加签
|
* 加签类型,前加签/后加签
|
||||||
* {@link BpmnCountersignTypeEnum}
|
* {@link BpmnCountersignTypeEnum}
|
||||||
*/
|
*/
|
||||||
private String counterSignType;
|
private String counterSignType;
|
||||||
|
/**
|
||||||
|
* 目标节点的审批方式(会签、或签、顺序签)
|
||||||
|
*/
|
||||||
|
private String targetNodeMode;
|
||||||
/**
|
/**
|
||||||
* 被加签的审批人
|
* 被加签的审批人
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import org.flowable.spring.SpringProcessEngineConfiguration;
|
|||||||
import org.springframework.context.SmartLifecycle;
|
import org.springframework.context.SmartLifecycle;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -96,6 +97,9 @@ public class RecoverDynamicCounterSignProcess implements SmartLifecycle {
|
|||||||
if (Objects.equals(sign.getCounterSignType(), FORWARD_COUNTERSIGN.getType())) {
|
if (Objects.equals(sign.getCounterSignType(), FORWARD_COUNTERSIGN.getType())) {
|
||||||
UserTask originalUserTask = (UserTask) process.getFlowElement(sign.getOriginalActivityId());
|
UserTask originalUserTask = (UserTask) process.getFlowElement(sign.getOriginalActivityId());
|
||||||
BpmnFlowNodeMode nodeMode = Objects.equals(originalUserTask.getLoopCharacteristics().getCompletionCondition(), AND_SIGN_EXPRESSION) ? BpmnFlowNodeMode.AND : BpmnFlowNodeMode.OR;
|
BpmnFlowNodeMode nodeMode = Objects.equals(originalUserTask.getLoopCharacteristics().getCompletionCondition(), AND_SIGN_EXPRESSION) ? BpmnFlowNodeMode.AND : BpmnFlowNodeMode.OR;
|
||||||
|
if (StringUtils.hasText(sign.getTargetNodeMode())) {
|
||||||
|
nodeMode = BpmnFlowNodeMode.valueOfType(sign.getTargetNodeMode());
|
||||||
|
}
|
||||||
// 创建前加签节点
|
// 创建前加签节点
|
||||||
UserTask newUserTask = CustomBpmnModelHelper.createUserTask(springProcessEngineConfiguration, originalUserTask, sign.getTargetActivityId(), nodeMode, sign.getAssignerList());
|
UserTask newUserTask = CustomBpmnModelHelper.createUserTask(springProcessEngineConfiguration, originalUserTask, sign.getTargetActivityId(), nodeMode, sign.getAssignerList());
|
||||||
process.addFlowElement(newUserTask);
|
process.addFlowElement(newUserTask);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user