diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2017-09-21 12:06:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-21 12:06:16 +0000 |
commit | 0dd633787da1a13862973d80914e793bcbfb3e80 (patch) | |
tree | 507f614fdf69a98933be9b1b8d59b42f2732d394 /bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp | |
parent | 154c70a5939f5510f236013f650306c23c06e9e5 (diff) | |
parent | 5f44ddccb4ffcd5e7899e63994e1049e842b6fee (diff) |
Merge "Add preprocess for NS Create"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy | 66 |
1 files changed, 19 insertions, 47 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy index 2029d15d5c..d5c6a88c4c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy @@ -58,55 +58,27 @@ public class CreateGenericE2EServiceInstance extends AbstractServiceTaskProcesso * generate the operation id
*/
public void preProcessRequest (Execution execution) {
- /* def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("DEBUG", " *** preProcessRequest() *** ", isDebugEnabled)
- try {
-
- String siRequest = execution.getVariable("bpmnRequest")
- utils.logAudit(siRequest)
-
- String requestId = execution.getVariable("mso-request-id")
- execution.setVariable("msoRequestId", requestId)
- utils.log("DEBUG", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
-
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
- if (isBlank(serviceInstanceId)) {
- serviceInstanceId = UUID.randomUUID().toString()
- }
- utils.log("DEBUG", "Generated new Service Instance:" + serviceInstanceId, isDebugEnabled)
- serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
- execution.setVariable("serviceInstanceId", serviceInstanceId)
-
+ try {
+ String globalSubscriberId = execution.getVariable("globalSubscriberId")
+ utils.log("DEBUG", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
+ String serviceType = execution.getVariable("serviceType")
+ utils.log("DEBUG", "serviceType:" + serviceType, isDebugEnabled)
+ String serviceId = execution.getVariable("serviceId")
+ utils.log("DEBUG", "serviceId:" + serviceId, isDebugEnabled)
String operationId = execution.getVariable("operationId")
- if (isBlank(operationId)) {
- operationId = UUID.randomUUID().toString()
- }
- utils.log("DEBUG", "Generated new Service Instance Operation:" + operationId, isDebugEnabled)
- serviceInstanceId = UriUtils.encode(operationId,"UTF-8")
- execution.setVariable("operationId", operationId)
- //subscriberInfo, TBD , there is no globalSubscriberId in R1 for E2E Service.
- //requestInfo TBD , there is no requestDetails for R1 E2E service
-
- //TBD need to insert operationInfo to RequestDb
-
- //set service Instance Name
- execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "service.name"))
- execution.setVariable("serviceDescription", jsonUtil.getJsonValue(siRequest, "service.description"))
- execution.setVariable("templateId", jsonUtil.getJsonValue(siRequest, "service.templateId"))
-
- //serviceParamters
- String serviceParamters = jsonUtil.getJsonValue(siRequest, "service.parameters")
- if (isBlank(serviceParamters)) {
- msg = "Input service paramters is null"
- utils.log("DEBUG", msg, isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- } else
- {
- execution.setVariable("serviceParamters", serviceParamters)
- }
-
- utils.log("DEBUG", "service parameters:" + serviceParamters, isDebugEnabled)
+ utils.log("DEBUG", "serviceType:" + serviceType, isDebugEnabled)
+ String nodeTemplateUUID = execution.getVariable("nodeTemplateUUID")
+ utils.log("DEBUG", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
+ String siRequest = execution.getVariable("nodeParamters")
+ utils.log("DEBUG", "Input Request:" + siRequest, isDebugEnabled)
+ String nsOperationKey = "{\"globalSubscriberId\":" + globalSubscriberId + ",\"serviceType:\""
+ + serviceType + ",\"serviceId\":" + serviceId + ",\"operationId\":" + operationId
+ +",\"nodeTemplateUUID\":" + nodeTemplateUUID + "}";
+ execution.setVariable("nsOperationKey", nsOperationKey);
+
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
@@ -114,7 +86,7 @@ public class CreateGenericE2EServiceInstance extends AbstractServiceTaskProcesso utils.log("DEBUG", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)*/
+ utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
|