REQ-2596-抄送消息按人员数量分批发送
This commit is contained in:
parent
970e7e58ab
commit
b3b1be05de
@ -161,4 +161,9 @@ public interface BpmnConstants {
|
|||||||
* 审批人数量限制
|
* 审批人数量限制
|
||||||
*/
|
*/
|
||||||
Integer ASSIGNER_LIMIT_NUMBER = 60;
|
Integer ASSIGNER_LIMIT_NUMBER = 60;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抄送MQ消息每批次人员数量
|
||||||
|
*/
|
||||||
|
Integer CARBON_ASSIGNER_BATCH_SIZE = 20;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
import static cn.axzo.workflow.common.constant.BpmnConstants.CARBON_ASSIGNER_BATCH_SIZE;
|
||||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
|
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
|
||||||
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getCarbonCopyConfigs;
|
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getCarbonCopyConfigs;
|
||||||
|
|
||||||
@ -107,11 +108,17 @@ public class EngineCarbonCopyEventListener implements JavaDelegate {
|
|||||||
}
|
}
|
||||||
return conf;
|
return conf;
|
||||||
}).orElse(null);
|
}).orElse(null);
|
||||||
|
//按人员批次发送消息
|
||||||
|
int startIndex = 0, endIndex = Integer.min(startIndex + CARBON_ASSIGNER_BATCH_SIZE, carbonUsers.size());
|
||||||
|
do {
|
||||||
|
List<BpmnTaskDelegateAssigner> bpmnTaskDelegateAssigners = carbonUsers.subList(startIndex, endIndex);
|
||||||
MessagePushEventImpl event = MessagePushEventBuilder.createEvent(MessagePushEventType.CARBON_COPY,
|
MessagePushEventImpl event = MessagePushEventBuilder.createEvent(MessagePushEventType.CARBON_COPY,
|
||||||
carbonUsers, bpmnNoticeConf, execution.getProcessInstanceId(),
|
bpmnTaskDelegateAssigners, bpmnNoticeConf, execution.getProcessInstanceId(),
|
||||||
execution.getTenantId(), getCarbonTaskId(execution));
|
execution.getTenantId(), getCarbonTaskId(execution));
|
||||||
eventDispatcher.dispatchEvent(event, processEngineConfiguration.getEngineCfgKey());
|
eventDispatcher.dispatchEvent(event, processEngineConfiguration.getEngineCfgKey());
|
||||||
|
startIndex = endIndex;
|
||||||
|
endIndex = Integer.min(endIndex + CARBON_ASSIGNER_BATCH_SIZE, carbonUsers.size());
|
||||||
|
} while (startIndex < carbonUsers.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getCarbonTaskId(DelegateExecution execution) {
|
private String getCarbonTaskId(DelegateExecution execution) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user