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) {
|
public static String parseProcessDefinitionKey(String processDefinitionId) {
|
||||||
if (StringUtils.hasText(processDefinitionId)) {
|
if (!StringUtils.hasText(processDefinitionId)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return processDefinitionId.split(":")[0];
|
return processDefinitionId.split(":")[0];
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import org.springframework.context.annotation.Scope;
|
|||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -183,7 +184,9 @@ public class RocketMqBpmActivityEventListener extends AbstractBpmnEventListener<
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, String> header = new HashMap<>();
|
Map<String, String> header = new HashMap<>();
|
||||||
|
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||||
|
}
|
||||||
eventProducer.send(Event.builder()
|
eventProducer.send(Event.builder()
|
||||||
.shardingKey(dto.getProcessInstanceId())
|
.shardingKey(dto.getProcessInstanceId())
|
||||||
.eventCode(eventEnum.getEventCode())
|
.eventCode(eventEnum.getEventCode())
|
||||||
|
|||||||
@ -392,7 +392,9 @@ public class RocketMqMessagePushEventListener extends AbstractBpmnEventListener<
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, String> header = new HashMap<>();
|
Map<String, String> header = new HashMap<>();
|
||||||
|
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||||
|
}
|
||||||
eventProducer.send(Event.builder()
|
eventProducer.send(Event.builder()
|
||||||
.shardingKey(dto.getProcessInstanceId())
|
.shardingKey(dto.getProcessInstanceId())
|
||||||
.eventCode(eventEnum.getEventCode())
|
.eventCode(eventEnum.getEventCode())
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -275,7 +276,9 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, String> header = new HashMap<>();
|
Map<String, String> header = new HashMap<>();
|
||||||
|
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||||
|
}
|
||||||
eventProducer.send(Event.builder()
|
eventProducer.send(Event.builder()
|
||||||
.shardingKey(dto.getProcessInstanceId())
|
.shardingKey(dto.getProcessInstanceId())
|
||||||
.eventCode(eventEnum.getEventCode())
|
.eventCode(eventEnum.getEventCode())
|
||||||
|
|||||||
@ -137,7 +137,9 @@ public class RocketMqBpmnTaskEvent_102_Listener extends AbstractBpmnEventListene
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, String> header = new HashMap<>();
|
Map<String, String> header = new HashMap<>();
|
||||||
|
if (StringUtils.hasText(dto.getProcessDefinitionKey())) {
|
||||||
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
header.put(MQ_OWNERSHIP_PROCESS_DEFINITION_KEY, dto.getProcessDefinitionKey());
|
||||||
|
}
|
||||||
eventProducer.send(Event.builder()
|
eventProducer.send(Event.builder()
|
||||||
.shardingKey(dto.getProcessInstanceId())
|
.shardingKey(dto.getProcessInstanceId())
|
||||||
.eventCode(eventEnum.getEventCode())
|
.eventCode(eventEnum.getEventCode())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user