From 3b5aa5aed44d27176cd11a65a73bbfafc4afe275 Mon Sep 17 00:00:00 2001 From: Trung Mai Date: Fri, 5 Jul 2024 21:42:59 +0700 Subject: [PATCH] TE-624: Check null for embedded end connected outer --- .../utils/process/inspector/internal/WorkflowPath.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/process-inspector/src/com/axonivy/utils/process/inspector/internal/WorkflowPath.java b/process-inspector/src/com/axonivy/utils/process/inspector/internal/WorkflowPath.java index 91e7b82..5469df8 100644 --- a/process-inspector/src/com/axonivy/utils/process/inspector/internal/WorkflowPath.java +++ b/process-inspector/src/com/axonivy/utils/process/inspector/internal/WorkflowPath.java @@ -3,6 +3,7 @@ import static com.axonivy.utils.process.inspector.internal.helper.AnalysisPathHelper.getInternalPath; import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; +import static java.util.Optional.ofNullable; import static java.util.stream.Collectors.toMap; import static org.apache.commons.collections4.CollectionUtils.isNotEmpty; import static org.apache.commons.lang3.StringUtils.EMPTY; @@ -418,11 +419,11 @@ private DetectedElement createDetectedTask(TaskAndCaseModifier task, TaskConfig return detectedTask; } - private DetectedElement createDetectedEmbeddedEnd(EmbeddedEnd element, Duration timeUntilStartAt) { String pid = element.getPid().getRawPid(); - String connectedOuterSequenceFlowPid = element.getConnectedOuterSequenceFlow().getPid().getRawPid(); - String elementName = element.getName(); + String elementName = element.getName(); + String connectedOuterSequenceFlowPid = ofNullable(element.getConnectedOuterSequenceFlow()) + .map(it -> it.getPid().getRawPid()).orElse(null); var detectedEmbeddedEnd = new DetectedEmbeddedEnd(pid, elementName, connectedOuterSequenceFlowPid, timeUntilStartAt); return detectedEmbeddedEnd;