aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-09-24 14:57:51 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-09-24 17:24:25 -0400
commit4891eedd15cff1e582d052843eb8c11a14c5d836 (patch)
tree5f014cdd42f99eef78bd7cd4d3eae80be8d32a02 /bpmn/so-bpmn-tasks/src/main
parent96231b3365d378a86b71d93b8a7d64aef8be531c (diff)
Update Resume Logic and Add Workflow Listeners
Updated with the error log messages Changed the code to do string compare for eventName update workflowaction to only persist if not resume Issue-ID: SO-2363 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I139f2427ae0f0253a15cc51003318686568cb514
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java10
2 files changed, 11 insertions, 14 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java
index e809ecd0ae..206942fcb1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java
@@ -20,27 +20,14 @@
package org.onap.so.bpmn.infrastructure.workflow.tasks;
-import java.util.ArrayList;
-import java.util.List;
-import org.camunda.bpm.engine.delegate.BpmnError;
-import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.workflow.context.WorkflowCallbackResponse;
-import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder;
import org.onap.so.bpmn.core.WorkflowException;
-import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
-import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
-import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
-import org.onap.so.serviceinstancebeans.RequestReferences;
-import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class FlowCompletionTasks {
@@ -50,7 +37,9 @@ public class FlowCompletionTasks {
@Autowired
private RequestsDbClient requestDbclient;
+
public void updateRequestDbStatus(BuildingBlockExecution execution) {
+
try {
String requestId = execution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId();
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index 1f07166b60..11c6455474 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -197,7 +197,9 @@ public class WorkflowAction {
suppressRollback = false;
}
execution.setVariable("suppressRollback", suppressRollback);
+ boolean isResume = false;
if (isUriResume(uri)) {
+ isResume = true;
logger.debug("replacing URI {}", uri);
uri = bbInputSetupUtils.loadOriginalInfraActiveRequestById(requestId).getRequestUrl();
logger.debug("for RESUME with original value {}", uri);
@@ -225,6 +227,12 @@ public class WorkflowAction {
if (flowsToExecute == null) {
buildAndThrowException(execution, "Could not resume Macro flow. Error loading execution path.");
}
+ } else if (aLaCarte && isResume) {
+ flowsToExecute = bbInputSetupUtils.loadOriginalFlowExecutionPath(requestId);
+ if (flowsToExecute == null) {
+ buildAndThrowException(execution,
+ "Could not resume request with request Id: " + requestId + ". No flowsToExecute was found");
+ }
} else {
if (aLaCarte) {
if (orchFlows == null || orchFlows.isEmpty()) {
@@ -387,7 +395,7 @@ public class WorkflowAction {
flowNames.add(ebb.getBuildingBlock().getBpmnFlowName());
}
- if (!aLaCarte) {
+ if (!isResume) {
bbInputSetupUtils.persistFlowExecutionPath(requestId, flowsToExecute);
}
execution.setVariable("flowNames", flowNames);