提交 2a201452 编写于 作者: zhouweidong's avatar zhouweidong

加签、获取流程参数逻辑优化

上级 6aaf6ad3
...@@ -142,26 +142,13 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener { ...@@ -142,26 +142,13 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener {
// 多实例(会签) // 多实例(会签)
if(event.getType() == FlowableEngineEventType.MULTI_INSTANCE_ACTIVITY_STARTED){ if(event.getType() == FlowableEngineEventType.MULTI_INSTANCE_ACTIVITY_STARTED){
UserTask task = (UserTask) event.getExecution().getCurrentFlowElement(); UserTask task = (UserTask) event.getExecution().getCurrentFlowElement();
List fieldList = task.getExtensionElements().get("field"); String strCandidate = wfCoreService.getParam(task,"form","candidateUsersList");
String strCandidate = ""; if(StringUtils.isEmpty(strCandidate)){
if(!ObjectUtils.isEmpty(fieldList)){ throw new BadRequestAlertException("获取流程用户失败","","");
for (Object field : fieldList) {
if(!ObjectUtils.isEmpty(((ExtensionElement) field).getAttributes())){
List<ExtensionAttribute> attributes = ((ExtensionElement) field).getAttributes().get("name");
if(attributes.size() > 0){
if(attributes.get(0).getValue().equals("candidateUsersList")){
strCandidate = ((ExtensionElement) field).getChildElements().get("string").get(0).getElementText();
break;
}
}
}
}
} }
DelegateExecution execution = event.getExecution(); DelegateExecution execution = event.getExecution();
Set processRoles = new HashSet(); Set processRoles = new HashSet();
Set processUserIds = new HashSet(); Set processUserIds = new HashSet();
LinkedHashMap executionMap = (LinkedHashMap) execution.getVariable("activedata"); LinkedHashMap executionMap = (LinkedHashMap) execution.getVariable("activedata");
String[] groups = strCandidate.split("\\|\\|"); String[] groups = strCandidate.split("\\|\\|");
if (groups.length > 0) { if (groups.length > 0) {
...@@ -203,7 +190,6 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener { ...@@ -203,7 +190,6 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener {
} }
} }
} }
//设置会签用户 //设置会签用户
if(!ObjectUtils.isEmpty(processUserIds)){ if(!ObjectUtils.isEmpty(processUserIds)){
event.getExecution().setVariableLocal("candidateUsersList",processUserIds); event.getExecution().setVariableLocal("candidateUsersList",processUserIds);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册