diff options
author | Elaine_Han <elaine.hanyulian@huawei.com> | 2018-07-18 16:11:05 +0800 |
---|---|---|
committer | Elaine_Han <elaine.hanyulian@huawei.com> | 2018-07-18 16:29:53 +0800 |
commit | 3316e6a1a839e8bb33654ab86641b7ab8b7181d3 (patch) | |
tree | ef6225645acd2a49f3a582ef6f455140937502db /bpmn/MSOInfrastructureBPMN/src/main | |
parent | b4861ac967c62f67d5a57919d07bf969ef416e03 (diff) |
inherit SOTN codes for CCVPN Services
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa60000000
Issue-ID: SO-683
Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main')
6 files changed, 1340 insertions, 54 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateActivateSDNCResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateActivateSDNCResource.groovy new file mode 100644 index 0000000000..e5f52a7406 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateActivateSDNCResource.groovy @@ -0,0 +1,425 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - SO + * ================================================================================ + * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.scripts + +import org.json.JSONObject +import org.json.XML; + +import static org.apache.commons.lang3.StringUtils.*; +import groovy.xml.XmlUtil +import groovy.json.* +import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil +import org.openecomp.mso.bpmn.common.recipe.ResourceInput; +import org.openecomp.mso.bpmn.common.resource.ResourceRequestBuilder +import org.openecomp.mso.bpmn.core.WorkflowException +import org.openecomp.mso.bpmn.core.json.JsonUtils +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder +import org.openecomp.mso.rest.APIResponse +import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils +import org.openecomp.mso.bpmn.infrastructure.workflow.service.ServicePluginFactory +import java.util.UUID; + +import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.apache.commons.lang3.* +import org.apache.commons.codec.binary.Base64; +import org.springframework.web.util.UriUtils +import org.openecomp.mso.rest.RESTClient +import org.openecomp.mso.rest.RESTConfig + +/** + * This groovy class supports the <class>CreateActivateSDNCResource.bpmn</class> process. + * flow for SDNC Network Resource Create + */ +public class CreateActivateSDNCResource extends AbstractServiceTaskProcessor { + + String Prefix="CRESDNCRES_" + + ExceptionUtil exceptionUtil = new ExceptionUtil() + + JsonUtils jsonUtil = new JsonUtils() + + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + + public void preProcessRequest(DelegateExecution execution){ + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started preProcessRequest *****", isDebugEnabled) + try { + + //get bpmn inputs from resource request. + String requestId = execution.getVariable("mso-request-id") + String requestAction = execution.getVariable("requestAction") + utils.log("INFO","The requestAction is: " + requestAction, isDebugEnabled) + String recipeParamsFromRequest = execution.getVariable("recipeParams") + utils.log("INFO","The recipeParams is: " + recipeParamsFromRequest, isDebugEnabled) + String resourceInput = execution.getVariable("resourceInput") + utils.log("INFO","The resourceInput is: " + resourceInput, isDebugEnabled) + //Get ResourceInput Object + ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class) + execution.setVariable(Prefix + "resourceInput", resourceInputObj) + + //Deal with recipeParams + String recipeParamsFromWf = execution.getVariable("recipeParamXsd") + String resourceName = resourceInputObj.getResourceInstanceName() + //For sdnc requestAction default is "createNetworkInstance" + String operationType = "Network" + String apiType = "network" + if(!StringUtils.isBlank(recipeParamsFromRequest)){ + //the operationType from worflow(first node) is second priority. + operationType = jsonUtil.getJsonValue(recipeParamsFromRequest, "operationType") + apiType = jsonUtil.getJsonValue(recipeParamsFromRequest, "apiType") + } + if(!StringUtils.isBlank(recipeParamsFromWf)){ + //the operationType from worflow(first node) is highest priority. + operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType") + apiType = jsonUtil.getJsonValue(recipeParamsFromRequest, "apiType") + } + + execution.setVariable(Prefix + "operationType", operationType) + execution.setVariable(Prefix + "apiType", apiType) + execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId()) + execution.setVariable("mso-request-id", requestId) + execution.setVariable("mso-service-instance-id", resourceInputObj.getServiceInstanceId()) + //TODO Here build networkrequest + + } catch (BpmnError e) { + throw e; + } catch (Exception ex){ + String msg = "Exception in preProcessRequest " + ex.getMessage() + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + String customizeResourceParam(String netowrkInputParametersJson) { + List<Map<String, Object>> paramList = new ArrayList(); + JSONObject jsonObject = new JSONObject(netowrkInputParametersJson); + Iterator iterator = jsonObject.keys(); + while (iterator.hasNext()) { + String key = iterator.next(); + HashMap<String, String> hashMap = new HashMap(); + hashMap.put("name", key); + hashMap.put("value", jsonObject.get(key)) + paramList.add(hashMap) + } + Map<String, List<Map<String, Object>>> paramMap = new HashMap(); + paramMap.put("param", paramList); + + return new JSONObject(paramMap).toString(); + } + + public void prepareSDNCRequest (DelegateExecution execution) { + String svcAction = "create" + prepareSDNCRequestReq(execution, svcAction, "") + } + + + public void prepareSDNCActivateRequest (DelegateExecution execution) { + String svcAction = "activate" + String sndcResourceId = execution.getVariable(Prefix + "sdncResourceId") + prepareSDNCRequestReq(execution, svcAction, sndcResourceId) + } + /** + * Pre Process the BPMN Flow Request + * Inclouds: + * generate the nsOperationKey + * generate the nsParameters + */ + public void prepareSDNCRequestReq (DelegateExecution execution, String svcAction, String sdncResourceId) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started prepareSDNCRequest *****", isDebugEnabled) + + try { + // get variables + String operationType = execution.getVariable(Prefix + "operationType") + String sdnc_apiType = execution.getVariable(Prefix + "apiType") + String sdnc_svcAction = svcAction + String sdnc_requestAction = StringUtils.capitalize(sdnc_svcAction) + operationType +"Instance" + + String sdncCallback = execution.getVariable("URN_mso_workflow_sdncadapter_callback") + String createNetworkInput = execution.getVariable(Prefix + "networkRequest") + + String hdrRequestId = execution.getVariable("mso-request-id") + String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") + String source = execution.getVariable("source") + String sdnc_service_id = execution.getVariable(Prefix + "sdncServiceId") + ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput") + String serviceType = resourceInputObj.getServiceType() + String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid() + String serviceModelUuid = resourceInputObj.getServiceModelInfo().getModelUuid() + String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion() + String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName() + String globalCustomerId = resourceInputObj.getGlobalSubscriberId() + String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid(); + String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String modelUuid = resourceInputObj.getResourceModelInfo().getModelUuid() + String modelName = resourceInputObj.getResourceModelInfo().getModelName() + String modelVersion = resourceInputObj.getResourceModelInfo().getModelVersion() + String resourceInputPrameters = resourceInputObj.getResourceParameters() + String netowrkInputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs") + //here convert json string to xml string + String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(netowrkInputParametersJson))) + + // 1. prepare assign topology via SDNC Adapter SUBFLOW call + String sndcTopologyCreateRequest = + """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1" + xmlns:sdncadapter="http://org.openecomp.mso/workflow/sdnc/adapter/schema/v1" + xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"> + <sdncadapter:RequestHeader> + <sdncadapter:RequestId>${hdrRequestId}</sdncadapter:RequestId> + <sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId> + <sdncadapter:SvcAction>${sdnc_svcAction}</sdncadapter:SvcAction> + <sdncadapter:SvcOperation>${sdnc_apiType}-topology-operation</sdncadapter:SvcOperation> + <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> + <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> + </sdncadapter:RequestHeader> + <sdncadapterworkflow:SDNCRequestData> + <request-information> + <request-id>${hdrRequestId}</request-id> + <request-action>${sdnc_requestAction}</request-action> + <source>${source}</source> + <notification-url></notification-url> + <order-number></order-number> + <order-version></order-version> + </request-information> + <service-information> + <service-id>${serviceInstanceId}</service-id> + <subscription-service-type>${serviceType}</subscription-service-type> + <onap-model-information> + <model-invariant-uuid>${serviceModelInvariantUuid}</model-invariant-uuid> + <model-uuid>${serviceModelUuid}</model-uuid> + <model-version>${serviceModelVersion}</model-version> + <model-name>${serviceModelName}</model-name> + </onap-model-information> + <service-instance-id>${serviceInstanceId}</service-instance-id> + <global-customer-id>${globalCustomerId}</global-customer-id> + </service-information> + <${sdnc_apiType}-information> + <${sdnc_apiType}-id>${sdncResourceId}</${sdnc_apiType}-id> + <onap-model-information> + <model-invariant-uuid>${modelInvariantUuid}</model-invariant-uuid> + <model-customization-uuid>${modelCustomizationUuid}</model-customization-uuid> + <model-uuid>${modelUuid}</model-uuid> + <model-version>${modelVersion}</model-version> + <model-name>${modelName}</model-name> + </onap-model-information> + </${sdnc_apiType}-information> + <${sdnc_apiType}-request-input> + <${sdnc_apiType}-input-parameters>${netowrkInputParameters}</${sdnc_apiType}-input-parameters> + </${sdnc_apiType}-request-input> + </sdncadapterworkflow:SDNCRequestData> + </aetgt:SDNCAdapterWorkflowRequest>""".trim() + + String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) + utils.logAudit(sndcTopologyCreateRequesAsString) + execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyCreateRequesAsString) + utils.log("INFO","sdncAdapterWorkflowRequest :" + sndcTopologyCreateRequesAsString, isDebugEnabled) + utils.log("DEBUG","sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString, isDebugEnabled) + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in CreateSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage() + utils.log("DEBUG", exceptionMessage, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + + } + utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled) + } + + private void setProgressUpdateVariables(DelegateExecution execution, String body) { + def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint") + execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) + execution.setVariable("CVFMI_updateResOperStatusRequest", body) + } + + public void prepareUpdateBeforeCreateSDNCResource(DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started prepareUpdateBeforeCreateSDNCResource *****", isDebugEnabled) + + ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput") + String operType = resourceInputObj.getOperationType() + String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String ServiceInstanceId = resourceInputObj.getServiceInstanceId() + String operationId = resourceInputObj.getOperationId() + String modelName = resourceInputObj.getResourceModelInfo().getModelName() + String progress = "20" + String status = "processing" + String statusDescription = "Create " + modelName + + execution.getVariable("operationId") + + String body = """ + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:ns="http://org.openecomp.mso/requestsdb"> + <soapenv:Header/> + <soapenv:Body> + <ns:updateResourceOperationStatus> + <operType>${operType}</operType> + <operationId>${operationId}</operationId> + <progress>${progress}</progress> + <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID> + <serviceId>${ServiceInstanceId}</serviceId> + <status>${status}</status> + <statusDescription>${statusDescription}</statusDescription> + </ns:updateResourceOperationStatus> + </soapenv:Body> + </soapenv:Envelope>"""; + + setProgressUpdateVariables(execution, body) + utils.log("INFO"," ***** End prepareUpdateBeforeCreateSDNCResource *****", isDebugEnabled) + } + + public void postCreateSDNC(DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + ServicePluginFactory.getInstance().test() + utils.log("INFO"," ***** Started postCreateSDNC *****", isDebugEnabled) + String sdnc_apiType = execution.getVariable(Prefix + "apiType") + String sdncAdapterResponse = execution.getVariable("sdncAdapterResponse") + utils.log("INFO","sdncAdapterResponse for create:" + sdncAdapterResponse , isDebugEnabled) + sdncAdapterResponse = sdncAdapterResponse.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", "") + sdncAdapterResponse = sdncAdapterResponse.replaceAll('tag0:', '').replaceAll(':tag0', '') + utils.log("INFO","sdncAdapterResponse for create after replace:" + sdncAdapterResponse , isDebugEnabled) + //if it is vnf we need to query the vnf-id,if it is network , we need to query the network-id + String sdncRespData = utils.getNodeText1(sdncAdapterResponse, "RequestData") + utils.log("INFO","sdncRespData:" + sdncRespData , isDebugEnabled) + String objectKey = "/" + sdnc_apiType + "/" + String objectDataKey = "/" + sdnc_apiType + "-data/" + String objectPath = utils.getNodeText1(sdncRespData, "object-path") + + String resourceObjId = objectPath.substring(objectPath.indexOf(objectKey) + objectKey.length(), objectPath.indexOf(objectDataKey)) + utils.log("INFO", "resourceObjId:" + resourceObjId, isDebugEnabled) + execution.setVariable(Prefix + "sdncResourceId", resourceObjId) + + utils.log("INFO"," ***** End postCreateSDNC *****", isDebugEnabled) + + } + + public void postActivateSDNC(DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started postActivateSDNC *****", isDebugEnabled) + String sdncAdapterResponse = execution.getVariable("sdncAdapterResponse") + utils.log("INFO","sdncAdapterResponse for activate:" + sdncAdapterResponse , isDebugEnabled) + utils.log("INFO"," ***** End postActivateSDNC *****", isDebugEnabled) + } + + public void prepareUpdateAfterCreateSDNCResource(DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started prepareUpdateAfterCreateSDNCResource *****", isDebugEnabled) + ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput") + String operType = resourceInputObj.getOperationType() + String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String ServiceInstanceId = resourceInputObj.getServiceInstanceId() + String modelName = resourceInputObj.getResourceModelInfo().getModelName() + String operationId = resourceInputObj.getOperationId() + String progress = "50" + String status = "processing" + String statusDescription = "Instantiate " + modelName + + execution.getVariable("operationId") + + String body = """ + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:ns="http://org.openecomp.mso/requestsdb"> + <soapenv:Header/> + <soapenv:Body> + <ns:updateResourceOperationStatus> + <operType>${operType}</operType> + <operationId>${operationId}</operationId> + <progress>${progress}</progress> + <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID> + <serviceId>${ServiceInstanceId}</serviceId> + <status>${status}</status> + <statusDescription>${statusDescription}</statusDescription> + </ns:updateResourceOperationStatus> + </soapenv:Body> + </soapenv:Envelope>"""; + + setProgressUpdateVariables(execution, body) + utils.log("INFO"," ***** End prepareUpdateAfterCreateSDNCResource *****", isDebugEnabled) + } + + public void prepareUpdateAfterActivateSDNCResource(DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started prepareUpdateAfterActivateSDNCResource *****", isDebugEnabled) + ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput") + String operType = resourceInputObj.getOperationType() + String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String ServiceInstanceId = resourceInputObj.getServiceInstanceId() + String modelName = resourceInputObj.getResourceModelInfo().getModelName() + String operationId = resourceInputObj.getOperationId() + String progress = "100" + String status = "finished" + String statusDescription = "Instantiate " + modelName + " finished" + + execution.getVariable("operationId") + + String body = """ + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:ns="http://org.openecomp.mso/requestsdb"> + <soapenv:Header/> + <soapenv:Body> + <ns:updateResourceOperationStatus> + <operType>${operType}</operType> + <operationId>${operationId}</operationId> + <progress>${progress}</progress> + <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID> + <serviceId>${ServiceInstanceId}</serviceId> + <status>${status}</status> + <statusDescription>${statusDescription}</statusDescription> + </ns:updateResourceOperationStatus> + </soapenv:Body> + </soapenv:Envelope>"""; + + setProgressUpdateVariables(execution, body) + utils.log("INFO"," ***** End prepareUpdateAfterActivateSDNCResource *****", isDebugEnabled) + } + + public void postCreateSDNCCall(DelegateExecution execution){ + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started prepareSDNCRequest *****", isDebugEnabled) + String responseCode = execution.getVariable(Prefix + "sdncCreateReturnCode") + String responseObj = execution.getVariable(Prefix + "SuccessIndicator") + + utils.log("INFO","response from sdnc, response code :" + responseCode + " response object :" + responseObj, isDebugEnabled) + utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled) + } + + public void sendSyncResponse (DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled) + + try { + String operationStatus = "finished" + // RESTResponse for main flow + String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim() + utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled) + sendWorkflowResponse(execution, 202, resourceOperationResp) + execution.setVariable("sentSyncResponse", true) + + } catch (Exception ex) { + String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage() + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled) + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy index 73d51c99b0..eaec39b5fd 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy @@ -46,6 +46,7 @@ import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.rest.APIResponse; import org.openecomp.mso.rest.RESTClient import org.openecomp.mso.rest.RESTConfig +import org.openecomp.mso.bpmn.infrastructure.workflow.service.ServicePluginFactory import java.util.List; import java.util.UUID; @@ -221,8 +222,20 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { } } + public void doServicePreOperation(DelegateExecution execution){ + //we need a service plugin platform here. + ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") + String uuiRequest = execution.getVariable("uuiRequest") + String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest); + execution.setVariable("uuiRequest", newUuiRequest) + } + public void doServiceHoming(DelegateExecution execution) { - //Now Homing is not clear. So to be implemented. + //we need a service plugin platform here. + ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") + String uuiRequest = execution.getVariable("uuiRequest") + String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest); + execution.setVariable("uuiRequest", newUuiRequest) } public void postProcessAAIGET(DelegateExecution execution) { diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/ServicePluginFactory.java new file mode 100644 index 0000000000..344d8cd4fa --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/ServicePluginFactory.java @@ -0,0 +1,443 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.service; + +import java.io.IOException; +import java.net.SocketTimeoutException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.http.HttpResponse; +import org.apache.http.ParseException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; +import org.camunda.bpm.engine.runtime.Execution; +import org.openecomp.mso.bpmn.core.PropertyConfiguration; +import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition; +import org.openecomp.mso.bpmn.core.json.JsonUtils; +import org.openecomp.mso.logger.MessageEnum; +import org.openecomp.mso.logger.MsoLogger; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +public class ServicePluginFactory { + + // SOTN calculate route + public static final String OOF_Default_EndPoint = "http://192.168.1.223:8443/oof/sotncalc"; + + public static final String Third_SP_Default_EndPoint = "http://192.168.1.223:8443/sp/resourcemgr/querytps"; + + private static final int DEFAULT_TIME_OUT = 60000; + + static JsonUtils jsonUtil = new JsonUtils(); + + private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA); + + private static ServicePluginFactory instance; + + + public static synchronized ServicePluginFactory getInstance() { + if (null == instance) { + instance = new ServicePluginFactory(); + } + return instance; + } + + private ServicePluginFactory() { + + } + + public String test() + { + return ""; + } + + private String getThirdSPEndPoint(){ + Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties"); + if (properties != null) { + String thirdSPEndPoint = properties.get("third-sp-endpoint"); + if(null != thirdSPEndPoint && !thirdSPEndPoint.isEmpty()){ + return thirdSPEndPoint; + } + } + return Third_SP_Default_EndPoint; + } + + private String getOOFCalcEndPoint(){ + Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties"); + if (properties != null) { + String oofCalcEndPoint = properties.get("oof-calc-endpoint"); + if(null != oofCalcEndPoint && !oofCalcEndPoint.isEmpty()){ + return oofCalcEndPoint; + } + } + return OOF_Default_EndPoint; + } + + + public String preProcessService(ServiceDecomposition serviceDecomposition, String uuiRequest) { + + // now only for sotn + if (isSOTN(serviceDecomposition, uuiRequest)) { + // We Need to query the terminalpoint of the VPN by site location + // info + return preProcessSOTNService(serviceDecomposition, uuiRequest); + } + return uuiRequest; + } + + public String doServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) { + // now only for sotn + if (isSOTN(serviceDecomposition, uuiRequest)) { + return doSOTNServiceHoming(serviceDecomposition, uuiRequest); + } + return uuiRequest; + } + + private boolean isSOTN(ServiceDecomposition serviceDecomposition, String uuiRequest) { + // there should be a register platform , we check it very simple here. + return uuiRequest.contains("clientSignal") && uuiRequest.contains("vpnType"); + } + + private String preProcessSOTNService(ServiceDecomposition serviceDecomposition, String uuiRequest) { + Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class); + Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service"); + Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters"); + Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs"); + List<Object> resources = (List<Object>) serviceParametersObject.get("resources"); + // This is a logic for demo , it could not be finalized to community. + String srcLocation = ""; + String dstLocation = ""; + String srcClientSignal = ""; + String dstClientSignal = ""; + // support R2 uuiReq and R1 uuiReq + // logic for R2 uuiRequest params in service level + for (Entry<String, Object> entry : serviceRequestInputs.entrySet()) { + if (entry.getKey().toLowerCase().contains("location")) { + if ("".equals(srcLocation)) { + srcLocation = (String) entry.getValue(); + } else if ("".equals(dstLocation)) { + dstLocation = (String) entry.getValue(); + } + } + if (entry.getKey().toLowerCase().contains("clientsignal")) { + if ("".equals(srcClientSignal)) { + srcClientSignal = (String) entry.getValue(); + } else if ("".equals(dstClientSignal)) { + dstClientSignal = (String) entry.getValue(); + } + } + } + + // logic for R1 uuiRequest, params in resource level + for (Object resource : resources) { + Map<String, Object> resourceObject = (Map<String, Object>) resource; + Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters"); + Map<String, Object> resourceRequestInputs = (Map<String, Object>) resourceParametersObject + .get("requestInputs"); + for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) { + if (entry.getKey().toLowerCase().contains("location")) { + if ("".equals(srcLocation)) { + srcLocation = (String) entry.getValue(); + } else if ("".equals(dstLocation)) { + dstLocation = (String) entry.getValue(); + } + } + if (entry.getKey().toLowerCase().contains("clientsignal")) { + if ("".equals(srcClientSignal)) { + srcClientSignal = (String) entry.getValue(); + } else if ("".equals(dstClientSignal)) { + dstClientSignal = (String) entry.getValue(); + } + } + } + } + + Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources); + // here we put client signal to vpn resource inputs + vpnRequestInputs.put("src-client-signal", srcClientSignal); + vpnRequestInputs.put("dst-client-signal", dstClientSignal); + + // Now we need to query terminal points from SP resourcemgr system. + List<Object> locationTerminalPointList = queryTerminalPointsFromServiceProviderSystem(srcLocation, dstLocation); + Map<String, Object> tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(0); + + serviceRequestInputs.put("inner-src-access-provider-id", tpInfoMap.get("access-provider-id")); + serviceRequestInputs.put("inner-src-access-client-id", tpInfoMap.get("access-client-id")); + serviceRequestInputs.put("inner-src-access-topology-id", tpInfoMap.get("access-topology-id")); + serviceRequestInputs.put("inner-src-access-node-id", tpInfoMap.get("access-node-id")); + serviceRequestInputs.put("inner-src-access-ltp-id", tpInfoMap.get("access-ltp-id")); + tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(1); + + serviceRequestInputs.put("inner-dst-access-provider-id", tpInfoMap.get("access-provider-id")); + serviceRequestInputs.put("inner-dst-access-client-id", tpInfoMap.get("access-client-id")); + serviceRequestInputs.put("inner-dst-access-topology-id", tpInfoMap.get("access-topology-id")); + serviceRequestInputs.put("inner-dst-access-node-id", tpInfoMap.get("access-node-id")); + serviceRequestInputs.put("inner-dst-access-ltp-id", tpInfoMap.get("access-ltp-id")); + + String newRequest = getJsonString(uuiObject); + return newRequest; + } + + private List<Object> queryTerminalPointsFromServiceProviderSystem(String srcLocation, String dstLocation) { + Map<String, String> locationSrc = new HashMap<String, String>(); + locationSrc.put("location", srcLocation); + Map<String, String> locationDst = new HashMap<String, String>(); + locationDst.put("location", dstLocation); + List<Map<String, String>> locations = new ArrayList<Map<String, String>>(); + locations.add(locationSrc); + locations.add(locationDst); + List<Object> returnList = new ArrayList<Object>(); + String reqContent = getJsonString(locations); + String url = getThirdSPEndPoint(); + String responseContent = sendRequest(url, "POST", reqContent); + if (null != responseContent) { + returnList = getJsonObject(responseContent, List.class); + } + return returnList; + } + + private Map<String, Object> getVPNResourceRequestInputs(List<Object> resources) { + for (Object resource : resources) { + Map<String, Object> resourceObject = (Map<String, Object>) resource; + Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters"); + Map<String, Object> resourceRequestInputs = (Map<String, Object>) resourceParametersObject + .get("requestInputs"); + for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) { + if (entry.getKey().toLowerCase().contains("vpntype")) { + return resourceRequestInputs; + } + } + } + return null; + } + + public static void main(String args[]){ + String str = "restconf/config/GENERIC-RESOURCE-API:services/service/eca7e542-12ba-48de-8544-fac59303b14e/service-data/networks/network/aec07806-1671-4af2-b722-53c8e320a633/network-data/"; + + int index1 = str.indexOf("/network/"); + int index2 = str.indexOf("/network-data"); + + String str1 = str.substring(index1 + "/network/".length(), index2); + System.out.println(str1); + + } + + private String doSOTNServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) { + // query the route for the service. + Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class); + Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service"); + Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters"); + Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs"); + Map<String, Object> oofQueryObject = new HashMap<String, Object>(); + List<Object> resources = (List<Object>) serviceParametersObject.get("resources"); + oofQueryObject.put("src-access-provider-id", serviceRequestInputs.get("inner-src-access-provider-id")); + oofQueryObject.put("src-access-client-id", serviceRequestInputs.get("inner-src-access-client-id")); + oofQueryObject.put("src-access-topology-id", serviceRequestInputs.get("inner-src-access-topology-id")); + oofQueryObject.put("src-access-node-id", serviceRequestInputs.get("inner-src-access-node-id")); + oofQueryObject.put("src-access-ltp-id", serviceRequestInputs.get("inner-src-access-ltp-id")); + oofQueryObject.put("dst-access-provider-id", serviceRequestInputs.get("inner-dst-access-provider-id")); + oofQueryObject.put("dst-access-client-id", serviceRequestInputs.get("inner-dst-access-client-id")); + oofQueryObject.put("dst-access-topology-id", serviceRequestInputs.get("inner-dst-access-topology-id")); + oofQueryObject.put("dst-access-node-id", serviceRequestInputs.get("inner-dst-access-node-id")); + oofQueryObject.put("dst-access-ltp-id", serviceRequestInputs.get("inner-dst-access-ltp-id")); + String oofRequestReq = getJsonString(oofQueryObject); + String url = getOOFCalcEndPoint(); + String responseContent = sendRequest(url, "POST", oofRequestReq); + + List<Object> returnList = new ArrayList<Object>(); + if (null != responseContent) { + returnList = getJsonObject(responseContent, List.class); + } + // in demo we have only one VPN. no cross VPNs, so get first item. + Map<String, Object> returnRoute = getReturnRoute(returnList); + Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources); + vpnRequestInputs.putAll(returnRoute); + String newRequest = getJsonString(uuiObject); + return newRequest; + } + + private Map<String, Object> getReturnRoute(List<Object> returnList){ + Map<String, Object> returnRoute = new HashMap<String,Object>(); + for(Object returnVpn :returnList){ + Map<String, Object> returnVpnInfo = (Map<String, Object>) returnVpn; + String accessTopoId = (String)returnVpnInfo.get("access-topology-id"); + if("100".equals(accessTopoId)){ + returnRoute.putAll(returnVpnInfo); + } + else if("101".equals(accessTopoId)){ + for(String key : returnVpnInfo.keySet()){ + returnRoute.put("domain1-" + key, returnVpnInfo.get(key)); + } + } + else if("102".equals(accessTopoId)){ + for(String key : returnVpnInfo.keySet()){ + returnRoute.put("domain2-" + key, returnVpnInfo.get(key)); + } + } + else{ + for(String key : returnVpnInfo.keySet()){ + returnRoute.put("domain" + accessTopoId +"-" + key, returnVpnInfo.get(key)); + } + } + } + return returnRoute; + } + + private Map<String, Object> getResourceParams(Execution execution, String resourceCustomizationUuid, + String serviceParameters) { + List<String> resourceList = jsonUtil.StringArrayToList(execution, + (String) JsonUtils.getJsonValue(serviceParameters, "resources")); + // Get the right location str for resource. default is an empty array. + String resourceInputsFromUui = ""; + for (String resource : resourceList) { + String resCusUuid = (String) JsonUtils.getJsonValue(resource, "resourceCustomizationUuid"); + if (resourceCustomizationUuid.equals(resCusUuid)) { + String resourceParameters = JsonUtils.getJsonValue(resource, "parameters"); + resourceInputsFromUui = JsonUtils.getJsonValue(resourceParameters, "requestInputs"); + } + } + Map<String, Object> resourceInputsFromUuiMap = getJsonObject(resourceInputsFromUui, Map.class); + return resourceInputsFromUuiMap; + } + + public static <T> T getJsonObject(String jsonstr, Class<T> type) { + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); + try { + return mapper.readValue(jsonstr, type); + } catch (IOException e) { + LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError, + "fail to unMarshal json", e); + } + return null; + } + + public static String getJsonString(Object srcObj) { + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); + String jsonStr = null; + try { + jsonStr = mapper.writeValueAsString(srcObj); + } catch (JsonProcessingException e) { + LOGGER.debug("SdcToscaParserException", e); + e.printStackTrace(); + } + return jsonStr; + } + + private static String sendRequest(String url, String methodType, String content) { + + String msbUrl = url; + HttpRequestBase method = null; + HttpResponse httpResponse = null; + + try { + int timeout = DEFAULT_TIME_OUT; + + RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout) + .setConnectionRequestTimeout(timeout).build(); + + HttpClient client = HttpClientBuilder.create().build(); + + if ("POST".equals(methodType.toUpperCase())) { + HttpPost httpPost = new HttpPost(msbUrl); + httpPost.setConfig(requestConfig); + httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON)); + method = httpPost; + } else if ("PUT".equals(methodType.toUpperCase())) { + HttpPut httpPut = new HttpPut(msbUrl); + httpPut.setConfig(requestConfig); + httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON)); + method = httpPut; + } else if ("GET".equals(methodType.toUpperCase())) { + HttpGet httpGet = new HttpGet(msbUrl); + httpGet.setConfig(requestConfig); + method = httpGet; + } else if ("DELETE".equals(methodType.toUpperCase())) { + HttpDelete httpDelete = new HttpDelete(msbUrl); + httpDelete.setConfig(requestConfig); + method = httpDelete; + } + + // now have no auth + // String userCredentials = + // SDNCAdapterProperties.getEncryptedProperty(Constants.SDNC_AUTH_PROP, + // Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY); + // String authorization = "Basic " + + // DatatypeConverter.printBase64Binary(userCredentials.getBytes()); + // method.setHeader("Authorization", authorization); + + httpResponse = client.execute(method); + String responseContent = null; + if (null != httpResponse && httpResponse.getEntity() != null) { + try { + responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); + } catch (ParseException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != method) { + method.reset(); + } + method = null; + return responseContent; + + } catch (SocketTimeoutException | ConnectTimeoutException e) { + return null; + + } catch (Exception e) { + return null; + + } finally { + if (httpResponse != null) { + try { + EntityUtils.consume(httpResponse.getEntity()); + } catch (Exception e) { + } + } + if (method != null) { + try { + method.reset(); + } catch (Exception e) { + + } + } + } + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java index 09561a620e..2f5bda6f46 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java @@ -231,7 +231,7 @@ public abstract class AbstractBuilder<IN, OUT> { protected ServiceInformationEntity getServiceInformationEntity(DelegateExecution execution) { ServiceInformationEntity serviceInformationEntity = new ServiceInformationEntity(); - serviceInformationEntity.setServiceId("VOLTE_SERVICE_ID"); + serviceInformationEntity.setServiceId((String) execution.getVariable("serviceInstanceId")); serviceInformationEntity.setSubscriptionServiceType((String) execution.getVariable("serviceType")); serviceInformationEntity.setOnapModelInformation(getOnapServiceModelInformationEntity(execution)); serviceInformationEntity.setServiceInstanceId((String) execution.getVariable("serviceInstanceId")); diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateActivateSDNCResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateActivateSDNCResource.bpmn new file mode 100644 index 0000000000..f3c629f9db --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateActivateSDNCResource.bpmn @@ -0,0 +1,393 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> + <bpmn:process id="CreateActivateSDNCResource" name="CreateActivateSDNCResource" isExecutable="true"> + <bpmn:startEvent id="createSDNCRES_StartEvent" name="createSDNCRES_StartEvent"> + <bpmn:outgoing>SequenceFlow_1qo2pln</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:sequenceFlow id="SequenceFlow_1qo2pln" sourceRef="createSDNCRES_StartEvent" targetRef="Task_1dlrfiw" /> + <bpmn:sequenceFlow id="SequenceFlow_0khtova" sourceRef="PreprocessIncomingRequest_task" targetRef="Task_0tezqd4" /> + <bpmn:scriptTask id="PreprocessIncomingRequest_task" name="prepare SDNC Create Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_18l3crb</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0khtova</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.prepareSDNCRequest(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:endEvent id="EndEvent_1x6k78c" name="create SDNC call end"> + <bpmn:incoming>SequenceFlow_17md60u</bpmn:incoming> + </bpmn:endEvent> + <bpmn:callActivity id="CallActivity_1600xlj" name="Call SDNC RSRC Create Adapter V1 " calledElement="sdncAdapter"> + <bpmn:extensionElements> + <camunda:in source="CRESDNCRES_activateSDNCRequest" target="sdncAdapterWorkflowRequest" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> + <camunda:out source="sdncAdapterResponse" target="sdncAdapterResponse" /> + <camunda:out source="SDNCA_ResponseCode" target="SDNCA_ResponseCode" /> + <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:in source="sdncAdapterWorkflowRequest" target="sdncAdapterWorkflowRequest" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_15mvedq</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1xk5xed</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_0mszkkr" /> + <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="ScriptTask_1g5zyi6" /> + <bpmn:scriptTask id="Task_023hred" name="post SDNC create call"> + <bpmn:incoming>SequenceFlow_1afu5al</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.postCreateSDNCCall(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_0w2es8j" sourceRef="Task_1dlrfiw" targetRef="Task_13sx2bp" /> + <bpmn:sequenceFlow id="SequenceFlow_18l3crb" sourceRef="Task_13sx2bp" targetRef="PreprocessIncomingRequest_task" /> + <bpmn:scriptTask id="Task_1dlrfiw" name="Set the Recipe DesignTimeParam" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1qo2pln</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0w2es8j</bpmn:outgoing> + <bpmn:script><![CDATA[String recipeParamXsdDemo="""{"operationType":"VPN","apiType":"network"}""" +String recipeParamXsd="" +execution.setVariable("recipeParamXsd", recipeParamXsd)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:scriptTask id="Task_13sx2bp" name="Pre Process Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0w2es8j</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_18l3crb</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.preProcessRequest(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1mz0vdx" sourceRef="Task_0tezqd4" targetRef="Task_18tomkl" /> + <bpmn:sequenceFlow id="SequenceFlow_15mvedq" sourceRef="Task_18tomkl" targetRef="CallActivity_1600xlj" /> + <bpmn:scriptTask id="Task_0tezqd4" name="Create progress update parameters before create" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1mz0vdx</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.prepareUpdateBeforeCreateSDNCResource(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:scriptTask id="Task_0uwlr22" name="Create progress update parameters After create" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0ruppyi</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1jr6zi0</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:serviceTask id="Task_18tomkl" name="update progress update"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1mz0vdx</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_15mvedq</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:serviceTask id="ServiceTask_1cm8iwr" name="update progress update"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1jr6zi0</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_10cy2nu</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_1jr6zi0" sourceRef="Task_0uwlr22" targetRef="ServiceTask_1cm8iwr" /> + <bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_17md60u</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def csi = new CreateActivateSDNCResource() +csi.sendSyncResponse(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_17md60u" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" /> + <bpmn:scriptTask id="ScriptTask_0a98d9a" name="prepare SDNC Activate Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_10cy2nu</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0rp0tdn</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.prepareSDNCActivateRequest(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_10cy2nu" sourceRef="ServiceTask_1cm8iwr" targetRef="ScriptTask_0a98d9a" /> + <bpmn:scriptTask id="ScriptTask_1toiss1" name="Create progress update parameters After Activate" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0s3vc50</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_05adaey</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.prepareUpdateAfterActivateSDNCResource(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:serviceTask id="ServiceTask_10e6vjg" name="update progress update"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_05adaey</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1afu5al</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_05adaey" sourceRef="ScriptTask_1toiss1" targetRef="ServiceTask_10e6vjg" /> + <bpmn:sequenceFlow id="SequenceFlow_1afu5al" sourceRef="ServiceTask_10e6vjg" targetRef="Task_023hred" /> + <bpmn:callActivity id="CallActivity_0pr0s2y" name="Call SDNC RSRCActivate Adapter V1 " calledElement="sdncAdapter"> + <bpmn:extensionElements> + <camunda:in source="CRESDNCRES_activateSDNCRequest" target="sdncAdapterWorkflowRequest" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> + <camunda:out source="sdncAdapterResponse" target="sdncAdapterResponse" /> + <camunda:out source="SDNCA_ResponseCode" target="SDNCA_ResponseCode" /> + <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:in source="sdncAdapterWorkflowRequest" target="sdncAdapterWorkflowRequest" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_0rp0tdn</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1efgf9m</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_1efgf9m" sourceRef="CallActivity_0pr0s2y" targetRef="Task_0p200y6" /> + <bpmn:sequenceFlow id="SequenceFlow_0ruppyi" sourceRef="Task_0mszkkr" targetRef="Task_0uwlr22" /> + <bpmn:scriptTask id="Task_0mszkkr" name="post create SDNC call" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1xk5xed</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0ruppyi</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.postCreateSDNC(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:scriptTask id="Task_0p200y6" name="post activate SDNC call" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1efgf9m</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0s3vc50</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi = new CreateActivateSDNCResource() +dcsi.postActivateSDNC(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_0s3vc50" sourceRef="Task_0p200y6" targetRef="ScriptTask_1toiss1" /> + <bpmn:sequenceFlow id="SequenceFlow_0rp0tdn" sourceRef="ScriptTask_0a98d9a" targetRef="CallActivity_0pr0s2y" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateActivateSDNCResource"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="createSDNCRES_StartEvent"> + <dc:Bounds x="-111" y="111" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="-134" y="147" width="85" height="28" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln"> + <di:waypoint xsi:type="dc:Point" x="-75" y="129" /> + <di:waypoint xsi:type="dc:Point" x="-10" y="129" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="-87.5" y="108" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova"> + <di:waypoint xsi:type="dc:Point" x="413" y="129" /> + <di:waypoint xsi:type="dc:Point" x="460" y="129" /> + <di:waypoint xsi:type="dc:Point" x="500" y="129" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="391.5" y="108" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task"> + <dc:Bounds x="313" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c"> + <dc:Bounds x="1049" y="544" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1013" y="586" width="81" height="28" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="CallActivity_1600xlj_di" bpmnElement="CallActivity_1600xlj"> + <dc:Bounds x="109" y="295" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1xk5xed_di" bpmnElement="SequenceFlow_1xk5xed"> + <di:waypoint xsi:type="dc:Point" x="209" y="335" /> + <di:waypoint xsi:type="dc:Point" x="257" y="335" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="188" y="314" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0"> + <di:waypoint xsi:type="dc:Point" x="896" y="562" /> + <di:waypoint xsi:type="dc:Point" x="915" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="860.5" y="541" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred"> + <dc:Bounds x="796" y="522" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0w2es8j_di" bpmnElement="SequenceFlow_0w2es8j"> + <di:waypoint xsi:type="dc:Point" x="90" y="129" /> + <di:waypoint xsi:type="dc:Point" x="148" y="129" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="74" y="108" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_18l3crb_di" bpmnElement="SequenceFlow_18l3crb"> + <di:waypoint xsi:type="dc:Point" x="248" y="129" /> + <di:waypoint xsi:type="dc:Point" x="313" y="129" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="235.5" y="108" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_0lc6l7a_di" bpmnElement="Task_1dlrfiw"> + <dc:Bounds x="-10" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_14l9mlv_di" bpmnElement="Task_13sx2bp"> + <dc:Bounds x="148" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1mz0vdx_di" bpmnElement="SequenceFlow_1mz0vdx"> + <di:waypoint xsi:type="dc:Point" x="606" y="129" /> + <di:waypoint xsi:type="dc:Point" x="638" y="129" /> + <di:waypoint xsi:type="dc:Point" x="638" y="129" /> + <di:waypoint xsi:type="dc:Point" x="738" y="129" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="608" y="123" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_15mvedq_di" bpmnElement="SequenceFlow_15mvedq"> + <di:waypoint xsi:type="dc:Point" x="788" y="169" /> + <di:waypoint xsi:type="dc:Point" x="788" y="218" /> + <di:waypoint xsi:type="dc:Point" x="0" y="218" /> + <di:waypoint xsi:type="dc:Point" x="0" y="335" /> + <di:waypoint xsi:type="dc:Point" x="109" y="335" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="349" y="197" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_1kqf4ge_di" bpmnElement="Task_0tezqd4"> + <dc:Bounds x="506" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_0hu4lhm_di" bpmnElement="Task_0uwlr22"> + <dc:Bounds x="426" y="295" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1q6ssz7_di" bpmnElement="Task_18tomkl"> + <dc:Bounds x="738" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1cm8iwr_di" bpmnElement="ServiceTask_1cm8iwr"> + <dc:Bounds x="588" y="295" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1jr6zi0_di" bpmnElement="SequenceFlow_1jr6zi0"> + <di:waypoint xsi:type="dc:Point" x="526" y="335" /> + <di:waypoint xsi:type="dc:Point" x="554" y="335" /> + <di:waypoint xsi:type="dc:Point" x="554" y="335" /> + <di:waypoint xsi:type="dc:Point" x="588" y="335" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="524" y="329" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6"> + <dc:Bounds x="915" y="522" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_17md60u_di" bpmnElement="SequenceFlow_17md60u"> + <di:waypoint xsi:type="dc:Point" x="1015" y="562" /> + <di:waypoint xsi:type="dc:Point" x="1049" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="987" y="540" width="90" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_0a98d9a_di" bpmnElement="ScriptTask_0a98d9a"> + <dc:Bounds x="-2" y="522" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_10cy2nu_di" bpmnElement="SequenceFlow_10cy2nu"> + <di:waypoint xsi:type="dc:Point" x="638" y="375" /> + <di:waypoint xsi:type="dc:Point" x="638" y="435" /> + <di:waypoint xsi:type="dc:Point" x="-33" y="435" /> + <di:waypoint xsi:type="dc:Point" x="-33" y="562" /> + <di:waypoint xsi:type="dc:Point" x="-2" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="302.5" y="413" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_1toiss1_di" bpmnElement="ScriptTask_1toiss1"> + <dc:Bounds x="490" y="522" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_10e6vjg_di" bpmnElement="ServiceTask_10e6vjg"> + <dc:Bounds x="656" y="522" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_05adaey_di" bpmnElement="SequenceFlow_05adaey"> + <di:waypoint xsi:type="dc:Point" x="590" y="562" /> + <di:waypoint xsi:type="dc:Point" x="656" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="623" y="540" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1afu5al_di" bpmnElement="SequenceFlow_1afu5al"> + <di:waypoint xsi:type="dc:Point" x="756" y="562" /> + <di:waypoint xsi:type="dc:Point" x="796" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="776" y="540" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="CallActivity_0pr0s2y_di" bpmnElement="CallActivity_0pr0s2y"> + <dc:Bounds x="178" y="522" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1efgf9m_di" bpmnElement="SequenceFlow_1efgf9m"> + <di:waypoint xsi:type="dc:Point" x="278" y="562" /> + <di:waypoint xsi:type="dc:Point" x="336" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="307" y="540" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0ruppyi_di" bpmnElement="SequenceFlow_0ruppyi"> + <di:waypoint xsi:type="dc:Point" x="357" y="335" /> + <di:waypoint xsi:type="dc:Point" x="426" y="335" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="391.5" y="313" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_13eovp4_di" bpmnElement="Task_0mszkkr"> + <dc:Bounds x="257" y="295" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_0ymnxuf_di" bpmnElement="Task_0p200y6"> + <dc:Bounds x="336" y="522" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0s3vc50_di" bpmnElement="SequenceFlow_0s3vc50"> + <di:waypoint xsi:type="dc:Point" x="436" y="562" /> + <di:waypoint xsi:type="dc:Point" x="490" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="463" y="540" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0rp0tdn_di" bpmnElement="SequenceFlow_0rp0tdn"> + <di:waypoint xsi:type="dc:Point" x="98" y="562" /> + <di:waypoint xsi:type="dc:Point" x="178" y="562" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="138" y="540" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn index 8fe6b70d1a..0475a6a963 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoCreateE2EServiceInstanceV3" name="DoCreateE2EServiceInstanceV3" isExecutable="true"> <bpmn2:startEvent id="createSI_startEvent" name="Start Flow"> <bpmn2:outgoing>SequenceFlow_1qiiycn</bpmn2:outgoing> @@ -99,7 +99,7 @@ ddsi.postProcessAAIPUT(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1qctzm0" sourceRef="Task_0uiekmn" targetRef="Task_0raqlqc" /> <bpmn2:scriptTask id="Task_0uiekmn" name="Prepare Resource Oper Status" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_1hbesp9</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_03ebqhf</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1qctzm0</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def ddsi = new DoCreateE2EServiceInstance() @@ -132,12 +132,12 @@ ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script> <bpmn2:linkEventDefinition name="Decompose_Service" /> </bpmn2:intermediateThrowEvent> <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_1mlbhmt" name="GoTo StartService"> - <bpmn2:incoming>SequenceFlow_1gusrvp</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_012h7yx</bpmn2:incoming> <bpmn2:linkEventDefinition name="StartService" /> </bpmn2:intermediateThrowEvent> <bpmn2:scriptTask id="ScriptTask_1o01d7d" name="PostProcess Decompose Service " scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0xjwb45</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_027owbf</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_012h7yx</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def dcsi= new DoCreateE2EServiceInstance() dcsi.processDecomposition(execution)]]></bpmn2:script> @@ -165,7 +165,6 @@ dcsi.prepareDecomposeService(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_166w91p</bpmn2:outgoing> <bpmn2:linkEventDefinition name="Decompose_Service" /> </bpmn2:intermediateCatchEvent> - <bpmn2:sequenceFlow id="SequenceFlow_027owbf" sourceRef="ScriptTask_1o01d7d" targetRef="Task_0ush1g4" /> <bpmn2:sequenceFlow id="SequenceFlow_0xjwb45" sourceRef="CallActivity_0biblpc" targetRef="ScriptTask_1o01d7d" /> <bpmn2:sequenceFlow id="SequenceFlow_0qxzgvq" sourceRef="ScriptTask_1cllqk3" targetRef="CallActivity_0biblpc" /> <bpmn2:sequenceFlow id="SequenceFlow_1qiiycn" sourceRef="createSI_startEvent" targetRef="preProcessRequest_ScriptTask" /> @@ -185,11 +184,10 @@ dcsi.prepareDecomposeService(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_1hbesp9</bpmn2:outgoing> <bpmn2:linkEventDefinition name="StartPrepareResource" /> </bpmn2:intermediateCatchEvent> - <bpmn2:sequenceFlow id="SequenceFlow_1hbesp9" sourceRef="IntermediateCatchEvent_05dus9b" targetRef="Task_0uiekmn" /> - <bpmn2:sequenceFlow id="SequenceFlow_1gusrvp" sourceRef="Task_0ush1g4" targetRef="IntermediateThrowEvent_1mlbhmt" /> - <bpmn2:scriptTask id="Task_0ush1g4" name="Call Homing(To be Done)" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_027owbf</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1gusrvp</bpmn2:outgoing> + <bpmn2:sequenceFlow id="SequenceFlow_1hbesp9" sourceRef="IntermediateCatchEvent_05dus9b" targetRef="Task_0dqjp43" /> + <bpmn2:scriptTask id="Task_0ush1g4" name="Call Service OOF" scriptFormat="groovy"> + <bpmn2:incoming>SequenceFlow_01s0ef2</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_03ebqhf</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def dcsi= new DoCreateE2EServiceInstance() dcsi.doServiceHoming(execution)]]></bpmn2:script> @@ -236,6 +234,16 @@ csi.postProcessForAddResource(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_0a6vgsu</bpmn2:incoming> </bpmn2:endEvent> <bpmn2:sequenceFlow id="SequenceFlow_0a6vgsu" sourceRef="ScriptTask_1y7jr4t" targetRef="EndEvent_0hzmoug" /> + <bpmn2:sequenceFlow id="SequenceFlow_03ebqhf" sourceRef="Task_0ush1g4" targetRef="Task_0uiekmn" /> + <bpmn2:sequenceFlow id="SequenceFlow_012h7yx" sourceRef="ScriptTask_1o01d7d" targetRef="IntermediateThrowEvent_1mlbhmt" /> + <bpmn2:sequenceFlow id="SequenceFlow_01s0ef2" sourceRef="Task_0dqjp43" targetRef="Task_0ush1g4" /> + <bpmn2:scriptTask id="Task_0dqjp43" name="Call Service Pre Operation" scriptFormat="groovy"> + <bpmn2:incoming>SequenceFlow_1hbesp9</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_01s0ef2</bpmn2:outgoing> + <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def dcsi= new DoCreateE2EServiceInstance() +dcsi.doServicePreOperation(execution)]]></bpmn2:script> + </bpmn2:scriptTask> </bpmn2:process> <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> @@ -344,17 +352,17 @@ csi.postProcessForAddResource(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1qctzm0_di" bpmnElement="SequenceFlow_1qctzm0"> - <di:waypoint xsi:type="dc:Point" x="296" y="300" /> - <di:waypoint xsi:type="dc:Point" x="402" y="300" /> + <di:waypoint xsi:type="dc:Point" x="534" y="300" /> + <di:waypoint xsi:type="dc:Point" x="604" y="300" /> <bpmndi:BPMNLabel> - <dc:Bounds x="304" y="279" width="90" height="12" /> + <dc:Bounds x="524" y="279" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0v81r5h_di" bpmnElement="Task_0uiekmn"> - <dc:Bounds x="196" y="260" width="100" height="80" /> + <dc:Bounds x="434" y="260" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_14tnuxf_di" bpmnElement="Task_0raqlqc"> - <dc:Bounds x="402" y="260" width="100" height="80" /> + <dc:Bounds x="604" y="260" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateThrowEvent_11saqvj_di" bpmnElement="IntermediateThrowEvent_0bq4fxs"> <dc:Bounds x="1315" y="-207" width="36" height="36" /> @@ -383,13 +391,6 @@ csi.postProcessForAddResource(execution)]]></bpmn2:script> <dc:Bounds x="2" y="-21" width="88" height="24" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_027owbf_di" bpmnElement="SequenceFlow_027owbf"> - <di:waypoint xsi:type="dc:Point" x="813" y="-39" /> - <di:waypoint xsi:type="dc:Point" x="1057" y="-39" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="890" y="-60" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0xjwb45_di" bpmnElement="SequenceFlow_0xjwb45"> <di:waypoint xsi:type="dc:Point" x="578" y="-39" /> <di:waypoint xsi:type="dc:Point" x="713" y="-39" /> @@ -463,53 +464,42 @@ csi.postProcessForAddResource(execution)]]></bpmn2:script> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1hbesp9_di" bpmnElement="SequenceFlow_1hbesp9"> <di:waypoint xsi:type="dc:Point" x="54" y="300" /> - <di:waypoint xsi:type="dc:Point" x="196" y="300" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="125" y="279" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1gusrvp_di" bpmnElement="SequenceFlow_1gusrvp"> - <di:waypoint xsi:type="dc:Point" x="1157" y="-39" /> - <di:waypoint xsi:type="dc:Point" x="1315" y="-39" /> + <di:waypoint xsi:type="dc:Point" x="87" y="300" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1236" y="-60" width="0" height="12" /> + <dc:Bounds x="25.5" y="279" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0wr11dt_di" bpmnElement="Task_0ush1g4"> - <dc:Bounds x="1057" y="-79" width="100" height="80" /> + <dc:Bounds x="277" y="260" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_1ojtwas_di" bpmnElement="CallActivity_1ojtwas"> - <dc:Bounds x="852" y="260" width="100" height="80" /> + <dc:Bounds x="971" y="260" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_04b21gb_di" bpmnElement="ScriptTask_04b21gb"> - <dc:Bounds x="629" y="260" width="100" height="80" /> + <dc:Bounds x="799" y="260" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1y7jr4t_di" bpmnElement="ScriptTask_1y7jr4t"> - <dc:Bounds x="1068" y="260" width="100" height="80" /> + <dc:Bounds x="1145" y="260" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_13xfsff_di" bpmnElement="SequenceFlow_13xfsff"> - <di:waypoint xsi:type="dc:Point" x="502" y="300" /> - <di:waypoint xsi:type="dc:Point" x="629" y="300" /> + <di:waypoint xsi:type="dc:Point" x="704" y="300" /> + <di:waypoint xsi:type="dc:Point" x="799" y="300" /> <bpmndi:BPMNLabel> - <dc:Bounds x="565.5" y="279" width="0" height="12" /> + <dc:Bounds x="706.5" y="279" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0bf6bzp_di" bpmnElement="SequenceFlow_0bf6bzp"> - <di:waypoint xsi:type="dc:Point" x="729" y="300" /> - <di:waypoint xsi:type="dc:Point" x="789" y="300" /> - <di:waypoint xsi:type="dc:Point" x="789" y="300" /> - <di:waypoint xsi:type="dc:Point" x="852" y="300" /> + <di:waypoint xsi:type="dc:Point" x="899" y="300" /> + <di:waypoint xsi:type="dc:Point" x="971" y="300" /> <bpmndi:BPMNLabel> - <dc:Bounds x="804" y="294" width="0" height="12" /> + <dc:Bounds x="890" y="279" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0d0c20n_di" bpmnElement="SequenceFlow_0d0c20n"> - <di:waypoint xsi:type="dc:Point" x="952" y="300" /> - <di:waypoint xsi:type="dc:Point" x="1009" y="300" /> - <di:waypoint xsi:type="dc:Point" x="1009" y="300" /> - <di:waypoint xsi:type="dc:Point" x="1068" y="300" /> + <di:waypoint xsi:type="dc:Point" x="1071" y="300" /> + <di:waypoint xsi:type="dc:Point" x="1145" y="300" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1024" y="294" width="0" height="12" /> + <dc:Bounds x="1063" y="279" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0hzmoug_di" bpmnElement="EndEvent_0hzmoug"> @@ -519,14 +509,36 @@ csi.postProcessForAddResource(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0a6vgsu_di" bpmnElement="SequenceFlow_0a6vgsu"> - <di:waypoint xsi:type="dc:Point" x="1168" y="300" /> - <di:waypoint xsi:type="dc:Point" x="1242" y="300" /> - <di:waypoint xsi:type="dc:Point" x="1242" y="300" /> + <di:waypoint xsi:type="dc:Point" x="1245" y="300" /> <di:waypoint xsi:type="dc:Point" x="1315" y="300" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1257" y="294" width="0" height="12" /> + <dc:Bounds x="1235" y="279" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_03ebqhf_di" bpmnElement="SequenceFlow_03ebqhf"> + <di:waypoint xsi:type="dc:Point" x="377" y="300" /> + <di:waypoint xsi:type="dc:Point" x="434" y="300" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="405.5" y="278" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_012h7yx_di" bpmnElement="SequenceFlow_012h7yx"> + <di:waypoint xsi:type="dc:Point" x="813" y="-39" /> + <di:waypoint xsi:type="dc:Point" x="1315" y="-39" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1064" y="-61" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_01s0ef2_di" bpmnElement="SequenceFlow_01s0ef2"> + <di:waypoint xsi:type="dc:Point" x="187" y="300" /> + <di:waypoint xsi:type="dc:Point" x="277" y="300" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="232" y="278" width="0" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ScriptTask_1uhlqf5_di" bpmnElement="Task_0dqjp43"> + <dc:Bounds x="87" y="260" width="100" height="80" /> + </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions> |