update(REQ-2516) - 完善处理事件中没有正确返回 processDefinitionKey 的问题
This commit is contained in:
parent
0aeafbc6c3
commit
a8d947f0f1
@ -36,7 +36,7 @@ public abstract class AbstractBpmnEventListener<T extends OperationContext> impl
|
||||
}
|
||||
|
||||
public static String parseProcessDefinitionKey(String processDefinitionId) {
|
||||
if (StringUtils.hasText(processDefinitionId)) {
|
||||
if (!StringUtils.hasText(processDefinitionId)) {
|
||||
return "";
|
||||
}
|
||||
return processDefinitionId.split(":")[0];
|
||||
|
||||
@ -25,6 +25,7 @@ import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
@ -183,7 +184,9 @@ public class RocketMqBpmActivityEventListener extends AbstractBpmnEventListener<
|
||||
return;
|
||||
}
|
||||
Map<String, String> header = new HashMap<>();
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
}
|
||||
eventProducer.send(Event.builder()
|
||||
.shardingKey(dto.getProcessInstanceId())
|
||||
.eventCode(eventEnum.getEventCode())
|
||||
|
||||
@ -392,7 +392,9 @@ public class RocketMqMessagePushEventListener extends AbstractBpmnEventListener<
|
||||
return;
|
||||
}
|
||||
Map<String, String> header = new HashMap<>();
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
}
|
||||
eventProducer.send(Event.builder()
|
||||
.shardingKey(dto.getProcessInstanceId())
|
||||
.eventCode(eventEnum.getEventCode())
|
||||
|
||||
@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
@ -275,7 +276,9 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
return;
|
||||
}
|
||||
Map<String, String> header = new HashMap<>();
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
}
|
||||
eventProducer.send(Event.builder()
|
||||
.shardingKey(dto.getProcessInstanceId())
|
||||
.eventCode(eventEnum.getEventCode())
|
||||
|
||||
@ -137,7 +137,9 @@ public class RocketMqBpmnTaskEvent_102_Listener extends AbstractBpmnEventListene
|
||||
return;
|
||||
}
|
||||
Map<String, String> header = new HashMap<>();
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||
}
|
||||
eventProducer.send(Event.builder()
|
||||
.shardingKey(dto.getProcessInstanceId())
|
||||
.eventCode(eventEnum.getEventCode())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user