aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-03-19 17:18:12 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-19 17:18:12 +0000
commit9cd51d70010f2e8154c26326a4457bf00bbd10aa (patch)
tree3d223de17cb7b769a7fa079bc448accd12b69e18
parent7165480eab5d69d047aaa8f58bc67c3ce4289b1e (diff)
parent2f2a07e0e5cd5f8ecc5a3fed71f296cb3896809a (diff)
Merge "Update Tasks API with additional fields"
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ManualHandling.groovy4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/TaskList.java52
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/ValidResponses.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/Camunda/GetTaskVariablesResponse.json8
6 files changed, 70 insertions, 3 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ManualHandling.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ManualHandling.groovy
index d5e88a8868..27fe33f5ea 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ManualHandling.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ManualHandling.groovy
@@ -158,6 +158,8 @@ public class ManualHandling extends AbstractServiceTaskProcessor {
taskVariables.put("buildingBlockName", buildingBlockName)
taskVariables.put("buildingBlockStep", buildingBlockStep)
taskVariables.put("validResponses", validResponses)
+ taskVariables.put("description", "")
+ taskVariables.put("timeout", "")
TaskService taskService = execution.getProcessEngineServices().getTaskService()
Task manualTask = taskService.newTask(taskId)
@@ -212,6 +214,8 @@ public class ManualHandling extends AbstractServiceTaskProcessor {
taskVariables.put("buildingBlockName", buildingBlockName)
taskVariables.put("buildingBlockStep", buildingBlockStep)
taskVariables.put("validResponses", validResponses)
+ taskVariables.put("description", "")
+ taskVariables.put("timeout", "")
TaskService taskService = execution.getProcessEngineServices().getTaskService()
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
index e35572598c..b7bd28f45f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
@@ -294,7 +294,9 @@ public class TasksHandler {
taskList.setErrorCode(getOptVariableValue(variables, "errorCode"));
taskList.setErrorMessage(getOptVariableValue(variables, "errorMessage"));
taskList.setBuildingBlockName(getOptVariableValue(variables, "buildingBlockName"));
- taskList.setBuildingBlockStep(getOptVariableValue(variables, "buildingBlockStep"));
+ taskList.setBuildingBlockStep(getOptVariableValue(variables, "buildingBlockStep"));
+ taskList.setDescription(getOptVariableValue(variables, "description"));
+ taskList.setTimeout(getOptVariableValue(variables, "timeout"));
String validResponses = getOptVariableValue(variables, "validResponses").toLowerCase();
List<String> items = Arrays.asList(validResponses.split("\\s*,\\s*"));
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/TaskList.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/TaskList.java
index b88521f813..ceba65fa97 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/TaskList.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/TaskList.java
@@ -36,7 +36,9 @@ public class TaskList {
protected String errorCode;
protected String errorMessage;
protected String buildingBlockName;
- protected String buildingBlockStep;
+ protected String buildingBlockStep;
+ protected String description;
+ protected String timeout;
protected List<String> validResponses;
/**
@@ -302,6 +304,54 @@ public class TaskList {
public void setBuildingBlockStep(String value) {
this.buildingBlockStep = value;
}
+
+ /**
+ * Gets the value of the description property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDescription(String value) {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the timeout property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTimeout() {
+ return timeout;
+ }
+
+ /**
+ * Sets the value of the timeout property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTimeout(String value) {
+ this.timeout = value;
+ }
/**
* Gets the value of the validResponses property.
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/ValidResponses.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/ValidResponses.java
index 977e7c4f2e..18fc7f9739 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/ValidResponses.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/ValidResponses.java
@@ -38,7 +38,8 @@ public enum ValidResponses {
abort,
skip,
retry,
- manual
+ manual,
+ resume
;
public String value() {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java
index c7b4cc0574..5c6fd31422 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java
@@ -89,6 +89,8 @@ public class TasksHandlerTest extends BaseTest{
taskList1.setOriginalRequestorId("VID");
taskList1.setSubscriptionServiceType("PORT-MIRROR");
taskList1.setTaskId("b5fa707a-f55a-11e7-a796-005056856d52");
+ taskList1.setDescription("test task");
+ taskList1.setTimeout("PT3000S");
taskList1.setValidResponses(validEntries);
taskList.add(taskList1);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/Camunda/GetTaskVariablesResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/Camunda/GetTaskVariablesResponse.json
index d5a26d714c..6b930089a3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/Camunda/GetTaskVariablesResponse.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/Camunda/GetTaskVariablesResponse.json
@@ -101,6 +101,14 @@
"type": "String",
"value": "Configurationactivate SDNO Post-Check",
"valueInfo": {}
+ },"description": {
+ "type": "String",
+ "value": "test task",
+ "valueInfo": {}
+ },"timeout": {
+ "type": "String",
+ "value": "PT3000S",
+ "valueInfo": {}
},"type": {
"type": "String",
"value": "fallout",