update service query 45/112745/1
authorzm330 <zhangminyj@chinamobile.com>
Wed, 16 Sep 2020 12:23:59 +0000 (20:23 +0800)
committerzm330 <zhangminyj@chinamobile.com>
Wed, 16 Sep 2020 12:24:11 +0000 (20:24 +0800)
Issue-ID: SO-2963

Signed-off-by: zm330 <zhangminyj@chinamobile.com>
Change-Id: I7489dd5b02fa19b25eec0162dd239c1d40e943d3

adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateCommunicationService.groovy

index 305d52a..89fd9a0 100644 (file)
@@ -37,10 +37,11 @@ public class QueryServiceMacroHolder extends CatalogQuery {
             + "\t\t\"modelUuid\"          : <SERVICE_MODEL_UUID>,\n"
             + "\t\t\"modelInvariantUuid\" : <SERVICE_MODEL_INVARIANT_ID>,\n"
             + "\t\t\"modelVersion\"       : <SERVICE_MODEL_VERSION>\n" + "\t},\n"
-            + "\t\"serviceType\"        : <SERVICE_TYPE>,\n" + "\t\"serviceRole\"        : <SERVICE_ROLE>,\n"
-            + "\t\"environmentContext\" : <ENVIRONMENT_CONTEXT>,\n" + "\t\"resourceOrder\"      : <RESOURCE_ORDER>,\n"
-            + "\t\"workloadContext\"    : <WORKLOAD_CONTEXT>,\n" + "<_SERVICEVNFS_>,\n" + "<_SERVICENETWORKS_>,\n"
-            + "<_SERVICEINFO_>,\n" + "<_SERVICEPROXY_>,\n" + "<_SERVICEALLOTTEDRESOURCES_>\n" + "\t}}";
+            + "\t\"serviceCategory\"    : <SERVICE_CATEGORY>,\n" + "\t\"serviceType\"        : <SERVICE_TYPE>,\n"
+            + "\t\"serviceRole\"        : <SERVICE_ROLE>,\n" + "\t\"environmentContext\" : <ENVIRONMENT_CONTEXT>,\n"
+            + "\t\"resourceOrder\"      : <RESOURCE_ORDER>,\n" + "\t\"workloadContext\"    : <WORKLOAD_CONTEXT>,\n"
+            + "<_SERVICEVNFS_>,\n" + "<_SERVICENETWORKS_>,\n" + "<_SERVICEINFO_>,\n" + "<_SERVICEPROXY_>,\n"
+            + "<_SERVICEALLOTTEDRESOURCES_>\n" + "\t}}";
 
     public QueryServiceMacroHolder() {
         super();
@@ -80,6 +81,7 @@ public class QueryServiceMacroHolder extends CatalogQuery {
         put(valueMap, "SERVICE_MODEL_VERSION", service.getModelVersion());
         put(valueMap, "SERVICE_TYPE", service.getServiceType());
         put(valueMap, "SERVICE_ROLE", service.getServiceRole());
+        put(valueMap, "SERVICE_CATEGORY", service.getCategory());
         put(valueMap, "ENVIRONMENT_CONTEXT", service.getEnvironmentContext());
         put(valueMap, "WORKLOAD_CONTEXT", service.getWorkloadContext());
         put(valueMap, "RESOURCE_ORDER", service.getResourceOrder());
index 12cd0dd..f8eafe7 100644 (file)
@@ -184,7 +184,7 @@ class CreateCommunicationService extends AbstractServiceTaskProcessor {
         logger.debug(Prefix + "prepareInitOperationStatus Start")
 
         String serviceId = execution.getVariable("serviceInstanceId")
-        // 生成 operationId
+        //operationId is generated
         String operationId = execution.getVariable("operationId")
         logger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
 
@@ -370,20 +370,23 @@ class CreateCommunicationService extends AbstractServiceTaskProcessor {
 
 
             for (String e2eInput in e2eInputs) {
-                if (jsonUtil.getJsonValue(e2eInput, "type") == "integer") {
+                key = jsonUtil.getJsonValue(e2eInput, "name")
+                String type = jsonUtil.getJsonValue(e2eInput, "type")
+                if (type == "integer") {
                     def temp
-                    key = jsonUtil.getJsonValue(e2eInput, "name")
                     value = csInputMap.containsKey(key) ? csInputMap.getOrDefault(key, 0) : (isBlank(temp = jsonUtil.getJsonValue(e2eInput, "default")) ? 0 : temp)
 
                     e2eInputMap.put(key, value as Integer)
-                } else {
-                    e2eInputMap.put(key = jsonUtil.getJsonValue(e2eInput, "name"), csInputMap.containsKey(key)
+                } else if(type == "string") {
+                    e2eInputMap.put(key, csInputMap.containsKey(key)
                             ? csInputMap.getOrDefault(key, null) : (jsonUtil.getJsonValue(e2eInput, "default")))
+
                 }
             }
 
+            //TODO
             e2eInputMap.put("sNSSAI", execution.getVariable("sNSSAI_id"))
-           e2eInputMap.put("sST", execution.getVariable("csServiceType"))
+               e2eInputMap.put("sST", execution.getVariable("csServiceType"))
             execution.setVariable("e2eInputMap", e2eInputMap)
             execution.setVariable("e2eServiceType", e2eServiceDecomposition.getServiceType())
             execution.setVariable("e2eModelInvariantUuid", e2eServiceDecomposition.getModelInfo().getModelInvariantUuid())
index 26dcaa7..7cdb084 100644 (file)
@@ -158,11 +158,11 @@ class DoCreateCommunicationService extends AbstractServiceTaskProcessor{
             String sNSSAI_id = generateNSSAI(serviceInstanceId)
 
             execution.setVariable("sNSSAI_id", sNSSAI_id)
-            // 创建service
+            // create communication service
             String serviceInstanceName = execution.getVariable("serviceInstanceName")
             String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
             String csServiceType = execution.getVariable("csServiceType")
-            String aaiServiceRole = "communication-service" //待确定
+            String aaiServiceRole = "communication-service"
 
             String oStatus = "processing"
             String uuiRequest = execution.getVariable("uuiRequest")