summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java19
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java2
3 files changed, 16 insertions, 11 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index cd151bafea..b76cf1eb5f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -111,13 +111,15 @@ public class WorkflowActionBBTasks {
}
int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
- ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence);
-
- execution.setVariable("buildingBlock", ebb);
- currentSequence++;
- execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size());
- execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence);
-
+ boolean completed = false;
+ if (currentSequence < flowsToExecute.size()) {
+ ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence);
+ execution.setVariable("buildingBlock", ebb);
+ execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence + 1);
+ } else {
+ completed = true;
+ }
+ execution.setVariable(COMPLETED, completed);
} catch (Exception e) {
workflowAction.buildAndThrowException(execution, "Internal Error occured during selectBB", e);
}
@@ -425,6 +427,9 @@ public class WorkflowActionBBTasks {
final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE);
int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
logger.debug("Current Sequence: {}", currentSequence);
+ if (currentSequence >= flowsToExecute.size()) {
+ execution.setVariable(COMPLETED, true);
+ }
ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1);
String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName();
if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
index a6e29227a0..a0a47a1d16 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
@@ -31,7 +31,7 @@ import javax.annotation.PostConstruct;
import org.junit.Rule;
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.slf4j.Logger;
@@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
-public class GrpcNettyServer extends BlueprintProcessingServiceImplBase {
+public class GrpcNettyServer extends BluePrintProcessingServiceImplBase {
private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class);
@@ -60,7 +60,7 @@ public class GrpcNettyServer extends BlueprintProcessingServiceImplBase {
@PostConstruct
public void start() throws IOException {
- final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() {
+ final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() {
@Override
public StreamObserver<ExecutionServiceInput> process(
StreamObserver<ExecutionServiceOutput> responseObserver) {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
index 5cd3055b5f..cbb746d514 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
@@ -149,7 +149,7 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
workflowActionBBTasks.selectBB(execution);
boolean success = (boolean) execution.getVariable("completed");
int currentSequence = (int) execution.getVariable("gCurrentSequence");
- assertTrue(success);
+ assertFalse(success);
assertEquals(1, currentSequence);
}