summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorElena Kuleshov <evn@att.com>2019-07-26 02:34:19 -0400
committerElena Kuleshov <evn@att.com>2019-07-26 02:51:35 -0400
commit8ad30f496f930ac942b7fa85cda99da0b4e62494 (patch)
treee8e5119365e97b08f6a153302cf7c6616c423fd3 /bpmn/so-bpmn-tasks/src/main
parent5128f152409017604d97b1e2f711a77a4c3acdf3 (diff)
Use BuildingBlockExecution for PauseForManualTasks
Fix variable settings and execution object usage for manual tasks. Issue-ID: SO-2113 Signed-off-by: Kuleshov, Elena <evn@att.com> Change-Id: I3fa24d70b46658ce5afcdc843d5482e157641112
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/manualhandling/tasks/ManualHandlingTasks.java9
2 files changed, 12 insertions, 4 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
index 775e3213d4..638ecefa49 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java
@@ -22,6 +22,7 @@
package org.onap.so.bpmn.infrastructure.activity;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@@ -99,6 +100,12 @@ public class ExecuteActivity implements JavaDelegate {
variables.put("retryCount", 1);
variables.put("aLaCarte", true);
+ execution.getVariables().forEach((key, value) -> {
+ if (value instanceof Serializable) {
+ variables.put(key, (Serializable) value);
+ }
+ });
+
ProcessInstanceWithVariables buildingBlockResult =
runtimeService.createProcessInstanceByKey("ExecuteBuildingBlock").setVariables(variables)
.executeWithVariablesInReturn();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/manualhandling/tasks/ManualHandlingTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/manualhandling/tasks/ManualHandlingTasks.java
index 17089be571..7e45c3b640 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/manualhandling/tasks/ManualHandlingTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/manualhandling/tasks/ManualHandlingTasks.java
@@ -27,6 +27,7 @@ import org.camunda.bpm.engine.TaskService;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateTask;
import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.ticket.ExternalTicket;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -46,7 +47,7 @@ public class ManualHandlingTasks {
private static final String TASK_TYPE_FALLOUT = "fallout";
public static final String VNF_TYPE = "vnfType";
public static final String SERVICE_TYPE = "serviceType";
- public static final String MSO_REQUEST_ID = "msoRequestId";
+ public static final String MSO_REQUEST_ID = "mso-request-id";
public static final String REQUESTOR_ID = "requestorId";
public static final String ERROR_CODE = "errorCode";
public static final String VALID_RESPONSES = "validResponses";
@@ -120,7 +121,7 @@ public class ManualHandlingTasks {
String originalRequestId = (String) execution.getVariable(MSO_REQUEST_ID);
String originalRequestorId = (String) execution.getVariable(REQUESTOR_ID);
String description = (String) execution.getVariable(DESCRIPTION);
- String timeout = (String) execution.getVariable("taskTimeout");
+ String timeout = "";
String errorSource = "";
String errorCode = "";
String errorMessage = "";
@@ -188,7 +189,7 @@ public class ManualHandlingTasks {
}
- public void createExternalTicket(DelegateExecution execution) {
+ public void createExternalTicket(BuildingBlockExecution execution) {
try {
ExternalTicket ticket = new ExternalTicket();
@@ -218,7 +219,7 @@ public class ManualHandlingTasks {
}
- public void updateRequestDbStatus(DelegateExecution execution, String status) {
+ public void updateRequestDbStatus(BuildingBlockExecution execution, String status) {
try {
String requestId = (String) execution.getVariable(MSO_REQUEST_ID);
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);