提交 a672ab71 编写于 作者: tangyaolong's avatar tangyaolong

push

上级 f2367874
......@@ -4,7 +4,6 @@ import cn.ibizlab.core.workflow.domain.WFMember;
import cn.ibizlab.core.workflow.extensions.domain.FlowUser;
import cn.ibizlab.core.workflow.extensions.service.WFCoreService;
import cn.ibizlab.core.workflow.extensions.service.WFModelService;
import cn.ibizlab.util.client.IBZNotifyFeignClient;
import cn.ibizlab.util.service.RemoteService;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
......@@ -13,8 +12,10 @@ import org.flowable.bpmn.model.ExtensionAttribute;
import org.flowable.bpmn.model.ExtensionElement;
import org.flowable.bpmn.model.FormProperty;
import org.flowable.bpmn.model.UserTask;
import org.flowable.common.engine.api.delegate.event.*;
import org.flowable.common.engine.api.delegate.event.AbstractFlowableEventListener;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEventType;
import org.flowable.common.engine.impl.event.FlowableEntityEventImpl;
import org.flowable.engine.TaskService;
import org.flowable.engine.delegate.DelegateExecution;
......@@ -243,10 +244,12 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener {
//会签节点
if(!ObjectUtils.isEmpty(allRolesCnt)){
String userId =null;
String userId = null;
String taskId = null;
for(IdentityLinkEntity link : taskEntity.getIdentityLinks()){
if(IdentityLinkType.CANDIDATE.equalsIgnoreCase(link.getType())){
userId = link.getUserId();
taskId = link.getTaskId();
break;
}
}
......@@ -259,7 +262,9 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener {
if(ObjectUtils.isEmpty(completeRolesCnt) && ObjectUtils.isEmpty(completeRoles)){ //首次提交
event.getExecution().getParent().setVariableLocal("complete_roles_cnt",userRoles.size());
event.getExecution().getParent().setVariableLocal("complete_roles",userRoles);
wfCoreService.ClaimTask(event.getExecution()); //TODO : all|role:any 下,消除其余用户待办
if(wfCoreService.accessCondition(event.getExecution())){
wfCoreService.ClaimTask(taskId,userId); // TODO : ALL|ROLE:ANY 下,消除其余用户待办
}
return;
}
else{
......@@ -275,7 +280,9 @@ public class ProcessInstanceListener extends AbstractFlowableEventListener {
complete_roles.addAll(user_complete_roles);
event.getExecution().getParent().setVariableLocal("complete_roles",complete_roles);
event.getExecution().getParent().setVariableLocal("complete_roles_cnt",complete_roles.size());
wfCoreService.ClaimTask(event.getExecution());
if(wfCoreService.accessCondition(event.getExecution())) {
wfCoreService.ClaimTask(taskId, userId);
}
}
}
}
......
......@@ -1551,10 +1551,9 @@ public class WFCoreService
/**
* role:any 认领当前任务,挂起将role中其他人任务
* @param execution
*/
public void ClaimTask(DelegateExecution execution) {
public void ClaimTask(String taskId,String userId) {
taskService.claim(taskId,userId);
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册