package org.openecomp.mso.bpmn.infrastructure.scripts
+import org.codehaus.jackson.map.ObjectMapper
import org.openecomp.mso.bpmn.infrastructure.properties.BPMNProperties
import java.util.ArrayList
execution.setVariable("sequencedResourceList", sequencedResourceList)
utils.log("INFO", "sequencedResourceList: " + sequencedResourceList, isDebugEnabled)
utils.log("INFO", "======== COMPLETED sequenceResoure Process ======== ", isDebugEnabled)
- }
+ }
+
+ public prepareServiceTopologyRequest(DelegateExecution execution) {
+
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ utils.log("INFO", "======== Start prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+
+ String serviceDecompose = execution.getVariable("serviceDecomposition")
+
+ execution.setVariable("operationType", "create")
+ execution.setVariable("resourceType", "")
+
+ String serviceInvariantUuid = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelInvariantUuid")
+ String serviceUuid = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelUuid")
+ String serviceModelName = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelName")
+
+ execution.setVariable("modelInvariantUuid", serviceInvariantUuid)
+ execution.setVariable("modelUuid", serviceUuid)
+ execution.setVariable("serviceModelName", serviceModelName)
+
+ utils.log("INFO", "======== End prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+ }
public void getCurrentResoure(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String serviceType = execution.getVariable("serviceType")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
- String operationType = execution.getVariable("operationType")
+ String operationType = "createInstance"
resourceInput.setGlobalSubscriberId(globalSubscriberId)
resourceInput.setServiceType(serviceType)
resourceInput.setServiceInstanceId(serviceInstanceId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String serviceType = execution.getVariable("serviceType")
ResourceInput resourceInput = execution.getVariable("resourceInput")
- String requestAction = resourceInput.getOperationType()
+
+ // requestAction is action, not opertiontype
+ //String requestAction = resourceInput.getOperationType()
+ String requestAction = "createInstance"
JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceInput.getResourceModelInfo().getModelUuid(), requestAction)
String recipeURL = BPMNProperties.getProperty("bpelURL", "http://mso:8080") + resourceRecipe.getString("orchestrationUri")
int recipeTimeOut = resourceRecipe.getInt("recipeTimeout")