From b2773e9b6a9faf327cc3926be0d684d053f547a6 Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Tue, 7 Aug 2018 18:44:39 +0530 Subject: Add xml body for activate on different resource Add xml body for activate on different resource. Change-Id: I9e9ba306dc961fd575a336fcc1fb7a73b49ac6c9 Issue-ID: SO-689 Signed-off-by: subhash kumar singh --- .../scripts/ActivateSDNCNetworkResource.groovy | 139 ++++++++++++++++++++- 1 file changed, 133 insertions(+), 6 deletions(-) (limited to 'bpmn') diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-flows/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy index 69e973d7c3..6ebba419f2 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy @@ -162,8 +162,131 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { //here convert json string to xml string String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(networkInputParametersJson))) // 1. prepare assign topology via SDNC Adapter SUBFLOW call - String sndcTopologyCreateRequest = - """ + + ${MsoUtils.xmlEscape(hdrRequestId)} + ${MsoUtils.xmlEscape(serviceInstanceId)} + ${MsoUtils.xmlEscape(sdnc_svcAction)} + network-topology-operation + sdncCallback + generic-resource + + + + ${MsoUtils.xmlEscape(hdrRequestId)} + ${MsoUtils.xmlEscape(sdnc_requestAction)} + ${MsoUtils.xmlEscape(source)} + + + + + + ${MsoUtils.xmlEscape(serviceInstanceId)} + ${MsoUtils.xmlEscape(serviceType)} + + ${MsoUtils.xmlEscape(serviceModelInvariantUuid)} + ${MsoUtils.xmlEscape(serviceModelUuid)} + ${MsoUtils.xmlEscape(serviceModelVersion)} + ${MsoUtils.xmlEscape(serviceModelName)} + + ${MsoUtils.xmlEscape(serviceInstanceId)} + ${MsoUtils.xmlEscape(globalCustomerId)} + + + + + + ${MsoUtils.xmlEscape(modelInvariantUuid)} + ${MsoUtils.xmlEscape(modelCustomizationUuid)} + ${MsoUtils.xmlEscape(modelUuid)} + ${MsoUtils.xmlEscape(modelVersion)} + ${MsoUtils.xmlEscape(modelName)} + + + + ${MsoUtils.xmlEscape(netowrkInputParameters)} + + + + + + + + + + + + + + + + """.trim() + break + + case ~/^SOTNAttachment$/: + sdncTopologyActivateRequest = + """ + + ${MsoUtils.xmlEscape(hdrRequestId)} + ${MsoUtils.xmlEscape(serviceInstanceId)} + ${MsoUtils.xmlEscape(sdnc_svcAction)} + network-topology-operation + sdncCallback + generic-resource + + + + ${MsoUtils.xmlEscape(hdrRequestId)} + ${MsoUtils.xmlEscape(sdnc_requestAction)} + ${MsoUtils.xmlEscape(source)} + + + + + + ${MsoUtils.xmlEscape(serviceInstanceId)} + ${MsoUtils.xmlEscape(serviceType)} + + ${MsoUtils.xmlEscape(serviceModelInvariantUuid)} + ${MsoUtils.xmlEscape(serviceModelUuid)} + ${MsoUtils.xmlEscape(serviceModelVersion)} + ${MsoUtils.xmlEscape(serviceModelName)} + + ${MsoUtils.xmlEscape(serviceInstanceId)} + ${MsoUtils.xmlEscape(globalCustomerId)} + + + + + + + + ${MsoUtils.xmlEscape(modelInvariantUuid)} + ${MsoUtils.xmlEscape(modelCustomizationUuid)} + ${MsoUtils.xmlEscape(modelUuid)} + ${MsoUtils.xmlEscape(modelVersion)} + ${MsoUtils.xmlEscape(modelName)} + + + + ${MsoUtils.xmlEscape(netowrkInputParameters)} + + + """.trim() + break + + default: + sdncTopologyActivateRequest = + """ @@ -196,6 +319,8 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { ${MsoUtils.xmlEscape(globalCustomerId)} + + ${MsoUtils.xmlEscape(modelInvariantUuid)} ${MsoUtils.xmlEscape(modelCustomizationUuid)} @@ -210,10 +335,12 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor { """.trim() - String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) - msoLogger.debug(sndcTopologyCreateRequesAsString) - execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyCreateRequesAsString) - msoLogger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString) + } + + String sdncTopologyActivateRequesAsString = utils.formatXml(sdncTopologyActivateRequest) + msoLogger.debug(sdncTopologyActivateRequesAsString) + execution.setVariable("sdncAdapterWorkflowRequest", sdncTopologyActivateRequesAsString) + msoLogger.debug("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyActivateRequesAsString) } catch (Exception ex) { String exceptionMessage = " Bpmn error encountered in CreateSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage() -- cgit 1.2.3-korg