Update Tasks API with additional fields 67/82467/2
authorElena Kuleshov <evn@att.com>
Fri, 15 Mar 2019 17:08:49 +0000 (13:08 -0400)
committerElena Kuleshov <evn@att.com>
Fri, 15 Mar 2019 17:56:31 +0000 (13:56 -0400)
Update Tasks API with additional fields and new valid response

Change-Id: I39d85ae599f9274373bbcf66dce4752ee75f16ed
Issue-ID: SO-1594
Signed-off-by: Kuleshov, Elena <evn@att.com>
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ManualHandling.groovy
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/TasksHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/TaskList.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tasksbeans/ValidResponses.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java
mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/Camunda/GetTaskVariablesResponse.json

index 8c67a42..cf7290a 100644 (file)
@@ -157,6 +157,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)
@@ -211,6 +213,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()
 
 
index 0a72cf6..98227f8 100644 (file)
@@ -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*"));
index b88521f..ceba65f 100644 (file)
@@ -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.
index c7b4cc0..5c6fd31 100644 (file)
@@ -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);
        
index d5a26d7..6b93008 100644 (file)
         "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",