summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy13
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy46
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn5
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn6
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn2
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java2
10 files changed, 48 insertions, 38 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json
index 1f9a8be5cf..feff0f5fba 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json
@@ -10,5 +10,5 @@
"max-instances": 3,
"availability-zone-count": 5,
"label": "label",
- "initial-count": null
+ "initial-count": 0
} \ No newline at end of file
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy
index f3f8c8bacf..ff7b0a3b6d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy
@@ -117,6 +117,19 @@ public class DoActivateTnNssi extends AbstractServiceTaskProcessor {
}
+ String getOrchStatusBasedOnActionType(String actionType) {
+ String res = "unknown"
+ if (actionType.equals("activate")) {
+ res = "activated"
+ } else if (actionType.equals("deactivate")) {
+ res = "deactivated"
+ } else {
+ logger.error("ERROR: getOrchStatusBasedOnActionType bad actionType= \n" + actionType)
+ }
+
+ return res
+ }
+
void updateAAIOrchStatus(DelegateExecution execution) {
logger.debug("Start updateAAIOrchStatus")
String tnNssiId = execution.getVariable("sliceServiceInstanceId")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy
index f591855b5c..982771f681 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy
@@ -549,7 +549,7 @@ class DoModifyAccessNSSI extends AbstractServiceTaskProcessor {
updateStatus.setResourceTemplateUUID(nsiId)
updateStatus.setResourceInstanceID(nssiId)
updateStatus.setOperType("Modify")
- updateStatus.setProgress(100)
+ updateStatus.setProgress("100")
updateStatus.setStatus("finished")
requestDBUtil.prepareUpdateResourceOperationStatus(execution, updateStatus)
@@ -571,7 +571,7 @@ class DoModifyAccessNSSI extends AbstractServiceTaskProcessor {
updateStatus.setResourceTemplateUUID(nsiId)
updateStatus.setResourceInstanceID(nssiId)
updateStatus.setOperType("Modify")
- updateStatus.setProgress(0)
+ updateStatus.setProgress("0")
updateStatus.setStatus("failed")
requestDBUtil.prepareUpdateResourceOperationStatus(execution, updateStatus)
}
@@ -652,4 +652,4 @@ class DoModifyAccessNSSI extends AbstractServiceTaskProcessor {
logger.debug("Error occured within deleteServiceInstance method: " + e)
}
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy
index 6fdfbe3218..e0df9ea64b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyRanNfNssi.groovy
@@ -29,7 +29,8 @@ import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.core.json.JsonUtils
import com.fasterxml.jackson.databind.ObjectMapper
import com.google.gson.JsonObject
-import java.sql.Timestamp
+import com.google.gson.JsonParser
+import java.time.Instant
import static org.apache.commons.lang3.StringUtils.isBlank
import org.onap.so.bpmn.core.UrnPropertiesReader
@@ -75,7 +76,7 @@ class DoModifyRanNfNssi extends AbstractServiceTaskProcessor {
execution.setVariable("sliceProfile", sliceProfile)
break
case "reconfigure":
- String resourceConfig = execution.getVariable("additionalProperties")
+ String resourceConfig = execution.getVariable("additionalProperties")
execution.setVariable("resourceConfig", resourceConfig)
break
default:
@@ -83,7 +84,7 @@ class DoModifyRanNfNssi extends AbstractServiceTaskProcessor {
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Invalid modify Action : "+modifyAction)
}
}
- List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+ List<String> snssaiList = execution.getVariable("snssaiList")
String sliceProfileId = execution.getVariable("sliceProfileId")
if (isBlank(sliceProfileId) || (snssaiList.empty)) {
msg = "Mandatory fields are empty"
@@ -109,7 +110,7 @@ class DoModifyRanNfNssi extends AbstractServiceTaskProcessor {
logger.debug(Prefix+"createSdnrRequest method start")
String callbackUrl = UrnPropertiesReader.getVariable("mso.workflow.message.endpoint") + "/AsyncSdnrResponse/"+execution.getVariable("msoRequestId")
String modifyAction = execution.getVariable("modifyAction")
- String sdnrRequest = buildSdnrAllocateRequest(execution, modifyAction, "InstantiateRANSlice", callbackUrl)
+ String sdnrRequest = buildSdnrAllocateRequest(execution, modifyAction, "instantiateRANSlice", callbackUrl)
execution.setVariable("createNSSI_sdnrRequest", sdnrRequest)
execution.setVariable("createNSSI_timeout", "PT10M")
execution.setVariable("createNSSI_correlator", execution.getVariable("msoRequestId"))
@@ -123,6 +124,7 @@ class DoModifyRanNfNssi extends AbstractServiceTaskProcessor {
if(status.equalsIgnoreCase("success")) {
String nfIds = jsonUtil.getJsonValue(SDNRResponse, "nfIds")
execution.setVariable("ranNfIdsJson", nfIds)
+ execution.setVariable("ranNfStatus", status)
}else {
String reason = jsonUtil.getJsonValue(SDNRResponse, "reason")
logger.error("received failed status from SDNR "+ reason)
@@ -134,53 +136,47 @@ class DoModifyRanNfNssi extends AbstractServiceTaskProcessor {
private String buildSdnrAllocateRequest(DelegateExecution execution, String action, String rpcName, String callbackUrl) {
String requestId = execution.getVariable("msoRequestId")
- Date date = new Date().getTime()
- Timestamp time = new Timestamp(date)
- String sliceProfileString
+ Instant time = Instant.now()
+ Map<String,Object> sliceProfile = new HashMap<>()
JsonObject response = new JsonObject()
JsonObject body = new JsonObject()
JsonObject input = new JsonObject()
JsonObject commonHeader = new JsonObject()
JsonObject payload = new JsonObject()
JsonObject payloadInput = new JsonObject()
+ JsonParser parser = new JsonParser()
if(action.equals("allocate")) {
- Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("sliceProfile"), Map.class)
+ sliceProfile = objectMapper.readValue(execution.getVariable("sliceProfile"), Map.class)
sliceProfile.put("sliceProfileId", execution.getVariable("sliceProfileId"))
sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSessions"))
sliceProfile.put("uLThptPerSlice", sliceProfile.get("expDataRateUL"))
sliceProfile.put("dLThptPerSlice", sliceProfile.get("expDataRateDL"))
- sliceProfileString = objectMapper.writeValueAsString(sliceProfile)
action = "modify-"+action
payloadInput.add("additionalproperties", new JsonObject())
}else if(action.equals("deallocate")) {
action = "modify-"+action
- Map<String,Object> sliceProfile = new HashMap<>()
sliceProfile.put("sliceProfileId", execution.getVariable("sliceProfileId"))
sliceProfile.put("sNSSAI", execution.getVariable("snssai"))
- sliceProfileString = objectMapper.writeValueAsString(sliceProfile)
payloadInput.add("additionalproperties", new JsonObject())
}else if(action.equals("reconfigure")) {
- Map<String,Object> sliceProfile = new HashMap<>()
sliceProfile.put("sliceProfileId", execution.getVariable("sliceProfileId"))
sliceProfile.put("sNSSAI", execution.getVariable("snssai"))
- sliceProfileString = objectMapper.writeValueAsString(sliceProfile)
JsonObject resourceconfig = new JsonObject()
- resourceconfig.addProperty("resourceConfig", execution.getVariable("resourceConfig"))
+ resourceconfig.add("resourceConfig", (JsonObject) parser.parse(execution.getVariable("resourceConfig")))
payloadInput.add("additionalproperties", resourceconfig)
}
- commonHeader.addProperty("TimeStamp", time.toString())
- commonHeader.addProperty("APIver", "1.0")
- commonHeader.addProperty("RequestID", requestId)
- commonHeader.addProperty("SubRequestID", "1")
- commonHeader.add("RequestTrack", new JsonObject())
- commonHeader.add("Flags", new JsonObject())
- payloadInput.addProperty("sliceProfile", sliceProfileString)
+ commonHeader.addProperty("timestamp", time.toString())
+ commonHeader.addProperty("api-ver", "1.0")
+ commonHeader.addProperty("request-id", requestId)
+ commonHeader.addProperty("sub-request-id", "1")
+ commonHeader.add("flags", new JsonObject())
+ payloadInput.addProperty("sliceProfile", sliceProfile.toString())
payloadInput.addProperty("RANNFNSSIId", execution.getVariable("serviceInstanceID"))
payloadInput.addProperty("callbackURL", callbackUrl)
payload.add("input", payloadInput)
- input.add("CommonHeader", commonHeader)
- input.addProperty("Action", action)
- input.add("Payload", payload)
+ input.add("common-header", commonHeader)
+ input.addProperty("action", action)
+ input.addProperty("payload", payload.toString())
body.add("input", input)
response.add("body", body)
response.addProperty("version", "1.0")
@@ -190,4 +186,4 @@ class DoModifyRanNfNssi extends AbstractServiceTaskProcessor {
return response.toString()
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn
index 51448b027c..eb0c007403 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn
@@ -30,7 +30,7 @@ ex.processJavaException(execution)</bpmn:script>
<bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def runScript = new DoActivateTnNssi()
-runScript.prepareUpdateJobStatus(execution,"finished","100","Activate or Deactivate successfully")</bpmn:script>
+runScript.prepareUpdateJobStatus(execution,"FINISHED","100","Activate or Deactivate successfully")</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" />
<bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_0nhxd67" />
@@ -40,8 +40,9 @@ runScript.prepareUpdateJobStatus(execution,"finished","100","Activate or Deactiv
<bpmn:outgoing>SequenceFlow_0kixzdj</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def actionType = execution.getVariable("actionType")
-execution.setVariable("orchestrationStatus", actionType)
def runScript = new DoActivateTnNssi()
+def orchStatus = runScript.getOrchStatusBasedOnActionType(actionType)
+execution.setVariable("orchestrationStatus", orchStatus)
runScript.updateAAIOrchStatus(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_0kixzdj" sourceRef="ScriptTask_19uxoi8" targetRef="ScriptTask_1ssh2l9" />
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn
index f3bd700d9a..124b75cbe8 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn
@@ -69,7 +69,7 @@ ex.processJavaException(execution)</bpmn:script>
<bpmn:outgoing>SequenceFlow_0t094g7</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def runScript = new TnAllocateNssi()
-runScript.prepareUpdateJobStatus(execution,"progress","10","Allocate TN NSSI started")</bpmn:script>
+runScript.prepareUpdateJobStatus(execution,"INPROGRESS","10","Allocate TN NSSI started")</bpmn:script>
</bpmn:scriptTask>
<bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1ex8ke9" name="Goto OOF TN NSSI Selection">
<bpmn:incoming>SequenceFlow_0jrclmc</bpmn:incoming>
@@ -80,7 +80,7 @@ runScript.prepareUpdateJobStatus(execution,"progress","10","Allocate TN NSSI sta
<bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def runScript = new TnAllocateNssi()
-runScript.prepareUpdateJobStatus(execution,"finished","100","Allocated TN NSSI successfully")</bpmn:script>
+runScript.prepareUpdateJobStatus(execution,"FINISHED","100","Allocated TN NSSI successfully")</bpmn:script>
</bpmn:scriptTask>
<bpmn:callActivity id="CallActivity_1bnkmaz" name="Call Decompose Service" calledElement="DecomposeService">
<bpmn:extensionElements>
@@ -174,7 +174,7 @@ runScript.updateAAIOrchStatus(execution)</bpmn:script>
<bpmn:outgoing>Flow_1853sgs</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def runScript = new TnAllocateNssi()
-runScript.prepareUpdateJobStatus(execution,"finished","100","Allocated TN NSSI successfully")</bpmn:script>
+runScript.prepareUpdateJobStatus(execution,"FINISHED","100","Allocated TN NSSI successfully")</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="Flow_1853sgs" sourceRef="Activity_1mh10j4" targetRef="Activity_124z7q2" />
<bpmn:callActivity id="Activity_187hs2t" name="Handle TN NSSI Selection OOF request" calledElement="DoHandleOofRequest">
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
index de8391428d..1dd362bf4b 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn
@@ -30,7 +30,7 @@ ex.processJavaException(execution)</bpmn:script>
<bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def runScript = new DoDeallocateTnNssi()
-runScript.prepareUpdateJobStatus(execution,"finished","100","Deallocated TN NSSI successfully")</bpmn:script>
+runScript.prepareUpdateJobStatus(execution,"FINISHED","100","Deallocated TN NSSI successfully")</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" />
<bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_0rgeefb" />
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn
index d70bed68cb..2b122fb5e2 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn
@@ -30,7 +30,7 @@ ex.processJavaException(execution)</bpmn:script>
<bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def runScript = new DoActivateTnNssi()
-runScript.prepareUpdateJobStatus(execution,"finished","100","Modified TN NSSI successfully")</bpmn:script>
+runScript.prepareUpdateJobStatus(execution,"FINISHED","100","Modified TN NSSI successfully")</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" />
<bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_0ziz3ti" />
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
index 2119ced951..564ee91fb2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
@@ -84,7 +84,7 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
VnfResourceCustomization vrc = catalogDbClient.findVnfResourceCustomizationInList(customizationUUID,
vnfResourceCustomizations);
if (null != vrc) {
- boolean skipConfigVNF = vrc.isSkipPostInstConf();
+ boolean skipConfigVNF = vrc.isSkipPostInstConf().booleanValue();
currentSequenceSkipCheck(execution, skipConfigVNF);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java
index 6589ae77f5..83f61e3a4f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipConfigVnfListener.java
@@ -34,7 +34,7 @@ public class SkipConfigVnfListener implements FlowManipulator {
if (vnfResourceCustomizations != null && !vnfResourceCustomizations.isEmpty()) {
VnfResourceCustomization vrc =
catalogDbClient.findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations);
- boolean skipConfigVNF = vrc.isSkipPostInstConf();
+ boolean skipConfigVNF = vrc.isSkipPostInstConf().booleanValue();
if (skipConfigVNF) {
execution.setVariable(BBConstants.G_CURRENT_SEQUENCE,
((int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE)) + 1);