summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-07-29 12:38:06 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-29 12:38:06 +0000
commit21efdd9394ac85637eb9e3531e0b78d7f1f09d41 (patch)
tree9d39a45ebed4219be7fc2249584433e6898f1b01 /bpmn
parentc113f6e62d95392435f0194b8677e90f90cde09e (diff)
parenta65e4eddba77eb7c10facf447c1f97beef59bb80 (diff)
Merge "set multi-stage flag in listener to log success"
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java
index 376a27e830..4cde9c1fc8 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java
@@ -22,6 +22,7 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks.listeners;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import org.onap.so.bpmn.common.BBConstants;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.listener.db.PostCompletionRequestsDbListener;
@@ -55,7 +56,7 @@ public class MultiStageSkipListener implements FlowManipulator, PostCompletionRe
@Override
public boolean shouldRunFor(BuildingBlockExecution execution) {
- return (boolean) execution.getVariable(G_MULTI_STAGE_DESIGN);
+ return (boolean) Optional.ofNullable(execution.getVariable(G_MULTI_STAGE_DESIGN)).orElse(false);
}
@Override
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java
index 9e2eac416c..82d610fa97 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java
@@ -77,6 +77,8 @@ public class MultiStageSkipListenerTest {
execution.setVariable("multiStageDesign", false);
assertFalse("should not be triggered", multiStageSkipListener.shouldRunFor(execution));
+ execution.setVariable("multiStageDesign", null);
+ assertFalse("should not be triggered", multiStageSkipListener.shouldRunFor(execution));
}