update - 完善消息推送事件变量的整合
This commit is contained in:
parent
5eb4fbd5b9
commit
85f24797c3
@ -9,18 +9,10 @@ public interface BpmnConstants {
|
||||
* 引擎自己的隐藏指令
|
||||
*/
|
||||
String FLOWABLE_SKIP_EXPRESSION_ENABLE = "_FLOWABLE_SKIP_EXPRESSION_ENABLED";
|
||||
/**
|
||||
* 指定单位标识
|
||||
*/
|
||||
String INTERNAL_EXECUTIVE_UNIT_ID = "_INTERNAL_EXECUTIVE_UNIT_ID";
|
||||
|
||||
String INTERNAL_INITIATOR = "_INTERNAL_INITIATOR";
|
||||
String INTERNAL_INITIATOR_OU_ID = "_INTERNAL_INITIATOR_OU_ID";
|
||||
String INTERNAL_INITIATOR_OU_NAME = "_INTERNAL_INITIATOR_OU_NAME";
|
||||
String INTERNAL_END_USER_ID = "_INTERNAL_END_USER_ID";
|
||||
String INTERNAL_END_TENANT_ID = "_INTERNAL_END_TENANT_ID";
|
||||
String INTERNAL_END_USER_NAME = "_INTERNAL_END_USER_NAME";
|
||||
String INTERNAL_TASK_COMMENT = "_INTERNAL_CUSTOM_TASK_COMMENT";
|
||||
String INTERNAL_DELETE_PROCESS_FLAG = "_INTERNAL_DELETE_PROCESS_FLAG";
|
||||
String INTERNAL_PROCESS_TYPE_CANCEL = "_INTERNAL_PROCESS_TYPE_CANCEL";
|
||||
String INTERNAL_PROCESS_TYPE_REJECT = "_INTERNAL_PROCESS_TYPE_REJECT";
|
||||
@ -32,9 +24,8 @@ public interface BpmnConstants {
|
||||
// 单任务节点,
|
||||
String INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT = "[_ASSIGNEE_INFO_SNAPSHOT_]";
|
||||
String INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT = "[_ASSIGNEE_LIST_INFO_SNAPSHOT_]";
|
||||
|
||||
String COUNTERSIGN_REMAIN_ASSIGNER_LIST = "COUNTERSIGN_REMAIN_ASSIGNER_LIST";
|
||||
String COUNTERSIGN_ORIGIN_ASSIGNER = "COUNTERSIGN_ORIGIN_ASSIGNER";
|
||||
String COUNTERSIGN_REMAIN_ASSIGNER_LIST = "[_COUNTERSIGN_REMAIN_ASSIGNER_LIST_]";
|
||||
String COUNTERSIGN_ORIGIN_ASSIGNER = "[_COUNTERSIGN_ORIGIN_ASSIGNER_]";
|
||||
|
||||
String PROCESS_PREFIX = "Flowable";
|
||||
String FLOW_NODE_JSON = "jsonValue";
|
||||
|
||||
@ -11,6 +11,7 @@ import cn.axzo.workflow.core.engine.event.MessagePushEvent;
|
||||
import cn.axzo.workflow.core.listener.BpmnMessagePushEventListener;
|
||||
import cn.axzo.workflow.core.service.BpmnProcessInstanceService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.HistoryService;
|
||||
@ -27,7 +28,19 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.BIZ_ORG_RELATION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.COUNTERSIGN_ORIGIN_ASSIGNER;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.COUNTERSIGN_REMAIN_ASSIGNER_LIST;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_TENANT_ID;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_ID;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_NAME;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_CANCEL;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_REJECT;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.VAR_ACTIVITY_NAME;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.VAR_BUSINESS_NAME;
|
||||
@ -59,6 +72,23 @@ public class MessagePushEventListener implements BpmnMessagePushEventListener, O
|
||||
private final BpmnProcessInstanceService processInstanceService;
|
||||
private final HistoryService historyService;
|
||||
|
||||
private static final List<String> REMOVE_KEYS = Lists.newArrayList(
|
||||
INTERNAL_INITIATOR,
|
||||
INTERNAL_END_USER_ID,
|
||||
INTERNAL_END_TENANT_ID,
|
||||
INTERNAL_END_USER_NAME,
|
||||
INTERNAL_DELETE_PROCESS_FLAG,
|
||||
INTERNAL_PROCESS_TYPE_CANCEL,
|
||||
INTERNAL_PROCESS_TYPE_REJECT,
|
||||
INTERNAL_SPECIFY_NEXT_APPROVER,
|
||||
BIZ_ORG_RELATION,
|
||||
INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO,
|
||||
INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT,
|
||||
INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT,
|
||||
COUNTERSIGN_REMAIN_ASSIGNER_LIST,
|
||||
COUNTERSIGN_ORIGIN_ASSIGNER
|
||||
);
|
||||
|
||||
@Override
|
||||
public void onNotice(MessagePushEvent event) {
|
||||
if (Objects.isNull(event.getNoticeConfig()) || !StringUtils.hasLength(event.getNoticeConfig().getNoticeMessageId()) || Objects.isNull(event.getAssigner())) {
|
||||
@ -129,6 +159,10 @@ public class MessagePushEventListener implements BpmnMessagePushEventListener, O
|
||||
variables.put(VAR_TASK_START_TIME, sdf.format(tasks.get(0).getCreateTime()));
|
||||
// TODO 操作类型 同意、驳回、加签、评论、转交等
|
||||
variables.put(VAR_OPERATOR_TYPE, "");
|
||||
|
||||
// 传递业务的参数
|
||||
REMOVE_KEYS.forEach(originVariables::remove);
|
||||
variables.putAll(originVariables);
|
||||
return variables;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user