|
@@ -2,26 +2,22 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.u
|
|
|
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
-import cn.hutool.core.map.MapUtil;
|
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy;
|
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum;
|
|
|
import org.flowable.bpmn.model.BpmnModel;
|
|
|
import org.flowable.engine.delegate.DelegateExecution;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.HashSet;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
-import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet;
|
|
|
-
|
|
|
/**
|
|
|
* 表单内用户字段 {@link BpmTaskCandidateUserStrategy} 实现类
|
|
|
*
|
|
|
* @author jason
|
|
|
*/
|
|
|
@Component
|
|
|
-public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidateStrategy {
|
|
|
+public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidateStrategy {
|
|
|
|
|
|
@Override
|
|
|
public BpmTaskCandidateStrategyEnum getStrategy() {
|
|
@@ -35,7 +31,7 @@ public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidate
|
|
|
|
|
|
@Override
|
|
|
public Set<Long> calculateUsersByTask(DelegateExecution execution, String param) {
|
|
|
- Object result = execution.getVariable(param);
|
|
|
+ Object result = execution.getVariable(param);
|
|
|
return Convert.toSet(Long.class, result);
|
|
|
}
|
|
|
|
|
@@ -43,8 +39,8 @@ public class BpmTaskCandidateUserFieldOnFormStrategy implements BpmTaskCandidate
|
|
|
public Set<Long> calculateUsersByActivity(BpmnModel bpmnModel, String activityId,
|
|
|
String param, Long startUserId, String processDefinitionId,
|
|
|
Map<String, Object> processVariables) {
|
|
|
- Long result = MapUtil.getLong(processVariables, param);
|
|
|
- return result != null ? asSet(result) : new HashSet<>();
|
|
|
+ Object result = processVariables == null ? null : processVariables.get(param);
|
|
|
+ return Convert.toSet(Long.class, result);
|
|
|
}
|
|
|
|
|
|
}
|