import org.onap.so.db.catalog.beans.CloudifyManager;
import org.onap.so.logger.MsoLogger;
+import java.io.FileInputStream;
+import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@Override
public void migrate(Connection connection) throws Exception {
LOGGER.debug("Starting migration for CloudConfig");
- CloudConfig cloudConfig = loadCloudConfig();
- if(cloudConfig == null){
- LOGGER.debug("No CloudConfig defined in :"+getApplicationYamlName()+" exiting.");
- }else{
+
+ CloudConfig cloudConfig = null;
+
+ // Try the override file
+ String configLocation = System.getProperty("spring.config.location");
+ if (configLocation != null) {
+ try (InputStream stream = new FileInputStream(configLocation)) {
+ cloudConfig = loadCloudConfig(stream);
+ }
+ }
+
+ if (cloudConfig == null) {
+ LOGGER.debug("No CloudConfig defined in " + configLocation);
+
+ // Try the application.yaml file
+ try (InputStream stream = R__CloudConfigMigration.class.getResourceAsStream(getApplicationYamlName())) {
+ cloudConfig = loadCloudConfig(stream);
+ }
+
+ if (cloudConfig == null) {
+ LOGGER.debug("No CloudConfig defined in " + getApplicationYamlName());
+ }
+ }
+
+ if(cloudConfig != null){
migrateCloudIdentity(cloudConfig.getIdentityServices().values(), connection);
migrateCloudSite(cloudConfig.getCloudSites().values(), connection);
migrateCloudifyManagers(cloudConfig.getCloudifyManagers().values(), connection);
this.cloudConfig = cloudConfig;
}
- private CloudConfig loadCloudConfig() throws Exception {
+ private CloudConfig loadCloudConfig(InputStream stream) throws Exception {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
- R__CloudConfigMigration cloudConfigMigration = mapper.readValue(R__CloudConfigMigration.class
- .getResourceAsStream(getApplicationYamlName()), R__CloudConfigMigration.class);
+ R__CloudConfigMigration cloudConfigMigration =
+ mapper.readValue(stream, R__CloudConfigMigration.class);
CloudConfig cloudConfig = cloudConfigMigration.getCloudConfig();
+
if(cloudConfig != null){
- cloudConfig.populateId();
+ cloudConfig.populateId();
}
return cloudConfig;
flyway:
outOfOrder: true
- ignoreMissingMigrations: true
\ No newline at end of file
+ ignoreMissingMigrations: true
+ baseline-on-migrate: true
+ validate-on-migrate: false
http.csrf().disable()
.authorizeRequests()
.antMatchers("/manage/health","/manage/info").permitAll()
- .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),",").toString())
+ .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),","))
.and()
.httpBasic();
}
* 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.
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-
-
class AaiUtil {
private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AaiUtil.class);
return uri
}
+ public String getAAIServiceInstanceUri(DelegateExecution execution) {
+ String uri = getBusinessCustomerUri(execution)
+
+ uri = uri +"/" + execution.getVariable("globalSubscriberId") + "/service-subscriptions/service-subscription/" + UriUtils.encode(execution.getVariable("serviceType"),"UTF-8") + "/service-instances/service-instance/" + UriUtils.encode(execution.getVariable("serviceInstanceId"),"UTF-8")
+
+ msoLogger.debug('AaiUtil.getAAIRequestInputUri() - AAI URI: ' + uri)
+ return uri
+ }
+
//public String getBusinessCustomerUriv7(DelegateExecution execution) {
// // //def uri = getUri(execution, BUSINESS_CUSTOMERV7)
// def uri = getUri(execution, 'Customer')
return 0
}
}
+
+ private def getPInterface(DelegateExecution execution, String aai_uri) {
+
+ String namespace = getNamespaceFromUri(aai_uri)
+ String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+ String serviceAaiPath = ${aai_endpoint}${aai_uri}
+
+ APIResponse response = executeAAIGetCall(execution, serviceAaiPath)
+ return new XmlParser().parseText(response.getResponseBodyAsString())
+ }
+
+ // This method checks if interface is remote
+ private def isPInterfaceRemote(DelegateExecution execution, String uri) {
+ if(uri.contains("ext-aai-network")) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ // This method returns Local and remote TPs information from AAI
+ public Map getTPsfromAAI(DelegateExecution execution) {
+ Map tpInfo = [:]
+
+ String aai_uri = '/aai/v14/network/logical-links'
+
+ String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+ String serviceAaiPath = ${aai_endpoint}${aai_uri}
+
+ APIResponse response = executeAAIGetCall(execution, serviceAaiPath)
+
+ def logicalLinks = new XmlParser().parseText(response.getResponseBodyAsString())
+
+ logicalLinks."logical-links".find { link ->
+ def pInterface = []
+ def relationship = link."relationship-list"."relationship"
+ relationship.each {
+ if ("p-interface".compareToIgnoreCase(it."related-to")) {
+ pInterface.add(it)
+ }
+ }
+ if (pInterface.size() == 2) {
+ def localTP = null
+ def remoteTP = null
+
+ if (pInterface[0]."related-link".contains("ext-aai-networks")) {
+ remoteTP = pInterface[0]
+ localTP = pInterface[1]
+ }
+
+ if (pInterface[1]."related-link".contains("ext-aai-networks")) {
+ localTP = pInterface[0]
+ remoteTP = pInterface[1]
+ }
+
+ if (localTP != null && remoteTP != null) {
+
+ // give local tp
+ var intfLocal = getPInterface(execution, localTP."related-link")
+ tpInfotpInfo.put("local-access-node-id", localTP."related-link".split("/")[6])
+
+ def networkRef = intfLocal."network-ref".split("/")
+ tpInfo.put("local-access-provider-id", networkRef[1])
+ tpInfo.put("local-access-client-id", networkRef[3])
+ tpInfo.put("local-access-topology-id", networkRef[5])
+ tpInfo.put("local-access-ltp-id", localTP."interface-name")
+
+ // give local tp
+ var intfRemote = getPInterface(execution, remoteTP."related-link")
+ tpInfo.put("remote-access-node-id", remoteTP."related-link".split("/")[6])
+ def networkRefRemote = intfRemote."network-ref".split("/")
+ tpInfo.put("remote-access-provider-id", networkRefRemote[1])
+ tpInfo.put("remote-access-client-id", networkRefRemote[3])
+ tpInfo.put("remote-access-topology-id", networkRefRemote[5])
+ tpInfo.put("remote-access-ltp-id", remoteTP."interface-name")
+ }
+ }
+
+ }
+ return tpInfo
+ }
}
\ No newline at end of file
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor;
+import org.onap.so.logger.MsoLogger
import org.onap.so.rest.APIResponse
import org.onap.so.rest.RESTClient
import org.onap.so.rest.RESTConfig
public MsoUtils utils = new MsoUtils()
ExceptionUtil exceptionUtil = new ExceptionUtil()
-
- private AbstractServiceTaskProcessor taskProcessor
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ExternalAPIUtil.class)
public static final String PostServiceOrderRequestsTemplate =
"{\n" +
"\t\t\"action\": <action>,\n" +
"\t\t\"service\": {\n" +
"\t\t\t\"serviceState\": <serviceState>,\n" +
+ "\t\t\t\"id\": <serviceId>,\n" +
"\t\t\t\"name\": <serviceName>,\n" +
- "\t\t\t\"serviceType\": <serviceType>,\n" +
"\t\t\t\"serviceSpecification\": { \n" +
"\t\t\t\t\"id\": <serviceUuId> \n" +
"\t\t\t},\n" +
"\t} \n" +
"}"
- public ExternalAPIUtil(AbstractServiceTaskProcessor taskProcessor) {
- this.taskProcessor = taskProcessor
- }
// public String getUri(DelegateExecution execution, resourceName) {
//
-// def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
// def uri = execution.getVariable("ExternalAPIURi")
// if(uri) {
-// taskProcessor.logDebug("ExternalAPIUtil.getUri: " + uri, isDebugLogEnabled)
+// msoLogger.debug("ExternalAPIUtil.getUri: " + uri)
// return uri
// }
//
// }
public String setTemplate(String template, Map<String, String> valueMap) {
- taskProcessor.logDebug("ExternalAPIUtil setTemplate", true);
+ msoLogger.debug("ExternalAPIUtil setTemplate", true);
StringBuffer result = new StringBuffer();
String pattern = "<.*>";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(template);
- taskProcessor.logDebug("ExternalAPIUtil template:" + template, true);
+ msoLogger.debug("ExternalAPIUtil template:" + template, true);
while (m.find()) {
String key = template.substring(m.start() + 1, m.end() - 1);
- taskProcessor.logDebug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true);
+ msoLogger.debug("ExternalAPIUtil key:" + key + " contains key? " + valueMap.containsKey(key), true);
m.appendReplacement(result, valueMap.getOrDefault(key, "\"TBD\""));
}
m.appendTail(result);
- taskProcessor.logDebug("ExternalAPIUtil return:" + result.toString(), true);
+ msoLogger.debug("ExternalAPIUtil return:" + result.toString(), true);
return result.toString();
}
*
*/
public APIResponse executeExternalAPIGetCall(DelegateExecution execution, String url){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- taskProcessor.logDebug(" ======== STARTED Execute ExternalAPI Get Process ======== ", isDebugEnabled)
+ msoLogger.debug(" ======== STARTED Execute ExternalAPI Get Process ======== ")
APIResponse apiResponse = null
try{
String uuid = utils.getRequestID()
- taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled)
- taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled)
+ msoLogger.debug( "Generated uuid is: " + uuid)
+ msoLogger.debug( "URL to be used is: " + url)
String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_externalapi_auth"),execution.getVariable("URN_mso_msoKey"))
}
apiResponse = client.get()
- taskProcessor.logDebug( "======== COMPLETED Execute ExternalAPI Get Process ======== ", isDebugEnabled)
+ msoLogger.debug( "======== COMPLETED Execute ExternalAPI Get Process ======== ")
}catch(Exception e){
- taskProcessor.logDebug("Exception occured while executing ExternalAPI Get Call. Exception is: \n" + e, isDebugEnabled)
+ msoLogger.debug("Exception occured while executing ExternalAPI Get Call. Exception is: \n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 9999, e.getMessage())
}
return apiResponse
*
*/
public APIResponse executeExternalAPIPostCall(DelegateExecution execution, String url, String payload){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- taskProcessor.logDebug( " ======== Started Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( " ======== Started Execute ExternalAPI Post Process ======== ")
APIResponse apiResponse = null
try{
String uuid = utils.getRequestID()
- taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled)
- taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled)
+ msoLogger.debug( "Generated uuid is: " + uuid)
+ msoLogger.debug( "URL to be used is: " + url)
String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_externalapi_auth"),execution.getVariable("URN_mso_msoKey"))
RESTConfig config = new RESTConfig(url);
}
apiResponse = client.httpPost(payload)
- taskProcessor.logDebug( "======== Completed Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( "======== Completed Execute ExternalAPI Post Process ======== ")
}catch(Exception e){
- taskProcessor.utils.log("ERROR", "Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e, isDebugEnabled)
+ msoLogger.error("Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 9999, e.getMessage())
}
return apiResponse
*
*/
public APIResponse executeExternalAPIPostCall(DelegateExecution execution, String url, String payload, String authenticationHeaderValue, String headerName, String headerValue){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- taskProcessor.logDebug( " ======== Started Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( " ======== Started Execute ExternalAPI Post Process ======== ")
APIResponse apiResponse = null
try{
- taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled)
+ msoLogger.debug( "URL to be used is: " + url)
String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_externalapi_auth"),execution.getVariable("URN_mso_msoKey"))
}
apiResponse = client.httpPost(payload)
- taskProcessor.logDebug( "======== Completed Execute ExternalAPI Post Process ======== ", isDebugEnabled)
+ msoLogger.debug( "======== Completed Execute ExternalAPI Post Process ======== ")
}catch(Exception e){
- taskProcessor.utils.log("ERROR", "Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e, isDebugEnabled)
+ msoLogger.error("Exception occured while executing ExternalAPI Post Call. Exception is: \n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 9999, e.getMessage())
}
return apiResponse
boolean is3rdONAPExist = false
- if(inputParameters.has("id"))
- {
- String sppartnerId = inputParameters.get("id")
- }
if(inputParameters.has("url"))
{
String sppartnerUrl = inputParameters.get("url")
{
callSource = inputParameters.get("CallSource")
if("ExternalAPI".equalsIgnoreCase(callSource)) {
+ String sppartnerId = inputParameters.get("SppartnerServiceId")
+ execution.setVariable(Prefix + "SppartnerServiceId", sppartnerId)
isLocalCall = false
}
}
msoLogger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
- execution.setVariable("serviceInstanceId", serviceInstanceId)
+ execution.setVariable(Prefix + "ServiceInstanceId", serviceInstanceId)
msoLogger.info("serviceInstanceId:" + serviceInstanceId)
} catch (BpmnError e) {
//get TP links from AAI for SOTN handoverMode only
String handoverMode = execution.getVariable(Prefix + "HandoverMode")
if("SOTN".equalsIgnoreCase(handoverMode)) {
- //to do get tp link in AAI
-
-
// Put TP Link info into serviceParameters
- String accessProviderId = ""
- String accessClientId = ""
- String accessTopologyId = ""
- String accessNodeId = ""
- String accessLtpId = ""
- JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
- inputParameters.put("access-provider-id", accessProviderId)
- inputParameters.put("access-client-id", accessClientId)
- inputParameters.put("access-topology-id", accessTopologyId)
- inputParameters.put("access-node-id", accessNodeId)
- inputParameters.put("access-ltp-id", accessLtpId)
+ JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
+
+ Map<String, Object> crossTPs = new HashMap<String, Object>();
+ crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"));
+ crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"));
+ crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"));
+ crossTPs.put("local-access-node-id", inputParameters.get("remote-access-node-id"));
+ crossTPs.put("local-access-ltp-id", inputParameters.get("remote-access-ltp-id"));
+ crossTPs.put("remote-access-provider-id", inputParameters.get("local-access-provider-id"));
+ crossTPs.put("remote-access-client-id", inputParameters.get("local-client-id"));
+ crossTPs.put("remote-access-topology-id", inputParameters.get("local-topology-id"));
+ crossTPs.put("remote-access-node-id", inputParameters.get("local-node-id"));
+ crossTPs.put("remote-access-ltp-id", inputParameters.get("local-ltp-id"));
+
+ inputParameters.put("local-access-provider-id", crossTPs.get("local-access-provider-id"));
+ inputParameters.put("local-access-client-id", crossTPs.get("local-access-client-id"));
+ inputParameters.put("local-access-topology-id", crossTPs.get("local-access-topology-id"));
+ inputParameters.put("local-access-node-id", crossTPs.get("local-access-node-id"));
+ inputParameters.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
+ inputParameters.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
+ inputParameters.put("remote-access-client-id", crossTPs.get("remote-client-id"));
+ inputParameters.put("remote-access-topology-id", crossTPs.get("remote-topology-id"));
+ inputParameters.put("remote-access-node-id", crossTPs.get("remote-node-id"));
+ inputParameters.put("remote-access-ltp-id", crossTPs.get("remote-ltp-id"));
+
execution.setVariable(Prefix + "ServiceParameters", inputParameters)
}
String action = "add" //for create
String serviceState = "active"
String serviceName = execution.getVariable("serviceInstanceName")
- String serviceType = execution.getVariable("serviceType")
- String serviceId = execution.getVariable("serviceInstanceId")
+ String serviceUuId = execution.setVariable(Prefix + "SppartnerUUID")
Map<String, String> valueMap = new HashMap<>()
valueMap.put("externalId", '"' + externalId + '"')
valueMap.put("orderItemId", '"' + orderItemId + '"')
valueMap.put("action", '"' + action + '"')
valueMap.put("serviceState", '"' + serviceState + '"')
+ valueMap.put("serviceId", '""')//To be confirmed
valueMap.put("serviceName", '"' + serviceName + '"')
- valueMap.put("serviceType", '"' + serviceType + '"')
- valueMap.put("serviceId", '"' + serviceId + '"')
+ valueMap.put("serviceUuId", '"' + serviceUuId + '"')
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
// insert CallSource='ExternalAPI' to uuiRequest
- Map<String, String> callSourceMap = new HashMap<>()
- callSourceMap.put("inputName", "CallSource")
- callSourceMap.put("inputValue", "ExternalAPI")
- String _requestInputs_ = externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, callSourceMap)
+ Map<String, String> requestInputsMap = new HashMap<>()
+ requestInputsMap.put("inputName", "CallSource")
+ requestInputsMap.put("inputValue", "ExternalAPI")
+ String _requestInputs_ = externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
+
+ requestInputsMap.clear()
+ String serviceInstanceId = execution.getVariable(Prefix + "ServiceInstanceId")
+ requestInputsMap.put("inputName", "SppartnerServiceId")
+ requestInputsMap.put("inputValue", serviceInstanceId)
+ _requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
+
+ requestInputsMap.clear()
+ String serviceType = execution.getVariable("serviceType")
+ requestInputsMap.put("inputName", "serviceType")
+ requestInputsMap.put("inputValue", serviceType)
+ _requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
// Transfer all uuiRequest incomeParameters to ExternalAPI format
JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
for(String key : inputParameters.keySet()) {
String inputName = key
String inputValue = inputParameters.opt(key)
- Map<String, String> requestInputsMap = new HashMap<>()
+ requestInputsMap.clear()
requestInputsMap.put("inputName", '"' + inputName+ '"')
requestInputsMap.put("inputValue", '"' + inputValue + '"')
_requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
{
msoLogger.debug("Get ServiceOrder Received a Good Response")
- String serviceOrderState = responseObj.get("State")
+
+ String sppartnerServiceId = responseObj.get("orderIterm.service.id")
+ execution.setVariable(Prefix + "SppartnerServiceId", sppartnerServiceId)
+
+ String serviceOrderState = responseObj.get("orderIterm.state")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("serviceOrderState", serviceOrderState)
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
msoLogger.info(" ***** Started postCreateE2ESIin3rdONAP *****")
- String sppartnerId = UUID.randomUUID().toString()
+ String sppartnerId = execution.getVariable(Prefix + "SppartnerServiceId")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String callSource = execution.getVariable(Prefix + "CallSource")
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ String serviceInstanceId = execution.getVariable(Prefix + "ServiceInstanceId")
String globalSubscriberId = execution.getVariable("globalSubscriberId")
String serviceType = execution.getVariable("serviceType")
--- /dev/null
+/*-
+ * ============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.onap.so.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.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.onap.so.bpmn.common.recipe.ResourceInput;
+import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
+import org.onap.so.bpmn.core.WorkflowException
+import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
+import org.onap.so.logger.MsoLogger
+import org.onap.so.rest.APIResponse
+import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
+
+import java.util.UUID;
+
+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.onap.so.rest.RESTClient
+import org.onap.so.rest.RESTConfig
+import org.onap.so.rest.APIResponse;
+import org.onap.so.bpmn.common.scripts.AaiUtil
+
+/**
+ * This groovy class supports the <class>CreateDeviceResource.bpmn</class> process.
+ * flow for Device Resource Create
+ */
+public class CreateDeviceResource extends AbstractServiceTaskProcessor {
+
+ String Prefix="CREDEVRES_"
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+ JsonUtils jsonUtil = new JsonUtils()
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateDeviceResource.class)
+
+ public void preProcessRequest(DelegateExecution execution){
+ msoLogger.info(" ***** Started preProcessRequest *****")
+ try {
+
+ //get bpmn inputs from resource request.
+ String requestId = execution.getVariable("mso-request-id")
+ String requestAction = execution.getVariable("requestAction")
+ msoLogger.info("The requestAction is: " + requestAction)
+ String recipeParamsFromRequest = execution.getVariable("recipeParams")
+ msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ String resourceInput = execution.getVariable("resourceInput")
+ msoLogger.info("The resourceInput is: " + resourceInput)
+ //Get ResourceInput Object
+ ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
+ execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+ String resourceInputPrameters = resourceInputObj.getResourceParameters()
+ String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
+ JSONObject inputParameters = new JSONObject(customizeResourceParam(inputParametersJson))
+ execution.setVariable(Prefix + "resourceRequestInputs", inputParameters)
+
+ //Deal with recipeParams
+ String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
+ String resourceName = resourceInputObj.getResourceInstanceName()
+ //For sdnc requestAction default is "createNetworkInstance"
+ String operationType = "Network"
+ if(!StringUtils.isBlank(recipeParamsFromRequest)){
+ //the operationType from worflow(first node) is second priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromRequest, "operationType")
+ }
+ if(!StringUtils.isBlank(recipeParamsFromWf)){
+ //the operationType from worflow(first node) is highest priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
+ }
+
+ execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
+ execution.setVariable("mso-request-id", requestId)
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex){
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ String customizeResourceParam(String networkInputParametersJson) {
+ List<Map<String, Object>> paramList = new ArrayList();
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson);
+ 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 checkDevType(DelegateExecution execution){
+ msoLogger.info(" ***** Started checkDevType *****")
+ try {
+
+ JSONObject inputParameters = execution.getVariable(Prefix + "resourceRequestInputs")
+
+ String devType = inputParameters.get("device_class")
+
+ if(StringUtils.isBlank(devType)) {
+ devType = "OTHER"
+ }
+
+ execution.setVariable("device_class", devType)
+
+ } catch (Exception ex){
+ String msg = "Exception in checkDevType " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void getVNFTemplatefromSDC(DelegateExecution execution){
+ msoLogger.info(" ***** Started getVNFTemplatefromSDC *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void postVNFInfoProcess(DelegateExecution execution){
+ msoLogger.info(" ***** Started postVNFInfoProcess *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in postVNFInfoProcess " + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ msoLogger.debug(" *** sendSyncResponse *** ")
+
+ try {
+ String operationStatus = "finished"
+ // RESTResponse for main flow
+ String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
+ msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ sendWorkflowResponse(execution, 202, resourceOperationResp)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ msoLogger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit sendSyncResopnse *****")
+ }
+}
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
import java.util.UUID
+import org.onap.so.logger.MsoLogger
import org.camunda.bpm.engine.runtime.Execution
import org.camunda.bpm.engine.delegate.BpmnError
/**
* This groovy class supports the <class>Delete3rdONAPE2EServiceInstance.bpmn</class> process.
- * flow for Delete E2EServiceInstance in 3rdONAP
+ * flow for Delete 3rdONAPE2EServiceInstance in 3rdONAP
*/
public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, Delete3rdONAPE2EServiceInstance.class)
+
public void checkSPPartnerInfoFromAAI (DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started checkSPPartnerInfo *****", isDebugEnabled)
+ msoLogger.info(" ***** Started checkSPPartnerInfo *****")
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)
+ msoLogger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- utils.log("INFO","The recipeParams is: " + recipeParamsFromRequest, isDebugEnabled)
+ msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- utils.log("INFO","The resourceInput is: " + resourceInput, isDebugEnabled)
+ msoLogger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
// set local resourceInput
execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
String resourceInstanceId = resourceInputObj.getResourceInstancenUuid()
- String sppartnerId = resourceInstanceId
- execution.setVariable(Prefix + "SppartnerId", sppartnerId)
- utils.log("INFO", "sppartnerId:" + sppartnerId, isDebugEnabled)
// Get Sppartner from AAI
AaiUtil aaiUriUtil = new AaiUtil(this)
String callSource = "UUI"
String sppartnerUrl = ""
- String sppartnerVersion = ""
if(execution.getVariable(Prefix + "SuccessIndicator")) {
callSource = execution.getVariable(Prefix + "CallSource")
- sppartnerId = execution.getVariable(Prefix + "SppartnerId")
- sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
- sppartnerVersion = execution.getVariable(Prefix + "SppartnerVersion")
}
boolean is3rdONAPExist = false
throw e
} catch (Exception ex){
String msg = "Exception in checkSPPartnerInfoFromAAI " + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ msoLogger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void checkLocallCall (DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started checkLocallCall *****", isDebugEnabled)
+ msoLogger.info(" ***** Started checkLocallCall *****")
boolean isLocalCall = true
String callSource = execution.getVariable(Prefix + "CallSource")
}
public void preProcessRequest(DelegateExecution execution){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started preProcessRequest *****", isDebugEnabled)
+ msoLogger.info(" ***** Started preProcessRequest *****")
try {
ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")
String msg = ""
String globalSubscriberId = resourceInputObj.getGlobalSubscriberId()
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
//set local variable
execution.setVariable("globalSubscriberId", globalSubscriberId)
- utils.log("INFO", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
+ msoLogger.info( "globalSubscriberId:" + globalSubscriberId)
String serviceType = resourceInputObj.getServiceType()
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("serviceType", serviceType)
- utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
+ msoLogger.info( "serviceType:" + serviceType)
String operationId = resourceInputObj.getOperationId()
if (isBlank(operationId)) {
msg = "Input operationId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("operationId", operationId)
- utils.log("INFO", "operationId:" + operationId, isDebugEnabled)
+ msoLogger.info( "operationId:" + operationId)
String resourceName = resourceInputObj.getResourceInstanceName()
if (isBlank(resourceName)) {
msg = "Input resourceName is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("resourceName", resourceName)
- utils.log("INFO", "resourceInstanceId:" + resourceName, isDebugEnabled)
+ msoLogger.info( "resourceInstanceId:" + resourceName)
String resourceTemplateId = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
if (isBlank(resourceTemplateId)) {
msg = "Input resourceTemplateId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ msoLogger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("resourceTemplateId", resourceTemplateId)
- utils.log("INFO", "resourceTemplateId:" + resourceTemplateId, isDebugEnabled)
+ msoLogger.info( "resourceTemplateId:" + resourceTemplateId)
} catch (BpmnError e) {
throw e
} catch (Exception ex){
String msg = "Exception in preProcessRequest " + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ msoLogger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareUpdateProgress(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started prepareUpdateProgress *****", isDebugEnabled)
+ msoLogger.info(" ***** Started prepareUpdateProgress *****")
ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
String operType = resourceInputObj.getOperationType()
String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
</soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
- utils.log("INFO"," ***** End prepareUpdateProgress *****", isDebugEnabled)
+ msoLogger.info(" ***** End prepareUpdateProgress *****")
}
public void prepare3rdONAPRequest(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started prepare3rdONAPRequest *****", isDebugEnabled)
+ msoLogger.info(" ***** Started prepare3rdONAPRequest *****")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String extAPIPath = sppartnerUrl + 'serviceOrder'
String serviceState = "active"
String serviceName = ""
String serviceType = execution.getVariable("serviceType")
- String serviceId = execution.getVariable(Prefix + "ServiceInstanceId")
+ String serviceId = execution.getVariable(Prefix + "SppartnerId")
+
+ queryServicefrom3rdONAP(execution)
+ String serviceUuId = execution.getVariable(Prefix + "serviceSpecificationId")
Map<String, String> valueMap = new HashMap<>()
valueMap.put("externalId", '"' + externalId + '"')
valueMap.put("orderItemId", '"' + orderItemId + '"')
valueMap.put("action", '"' + action + '"')
valueMap.put("serviceState", '"' + serviceState + '"')
+ valueMap.put("serviceId", '"' + serviceId + '"')
valueMap.put("serviceName", '"' + serviceName + '"')
valueMap.put("serviceType", '"' + serviceType + '"')
- valueMap.put("serviceId", '"' + serviceId + '"')
+ valueMap.put("serviceUuId", '"' + serviceUuId + '"')
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap)
execution.setVariable(Prefix + "Payload", payload)
- utils.log("INFO", "Exit " + prepare3rdONAPRequest, isDebugEnabled)
+ msoLogger.info( "Exit " + prepare3rdONAPRequest)
+ }
+
+ private void queryServicefrom3rdONAP(DelegateExecution execution)
+ {
+ msoLogger.info(" ***** Started queryServicefrom3rdONAP *****")
+
+ //https://{api_url}/nbi/api/v1/service/{serviceinstanceid}
+ String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
+ String extAPIPath = sppartnerUrl + "service/" + execution.setVariable(Prefix + "SppartnerId")
+
+ ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+
+ APIResponse response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath)
+
+ int responseCode = response.getStatusCode()
+ execution.setVariable(Prefix + "getServiceResponseCode", responseCode)
+ utils.log("DEBUG", "Get Service response code is: " + responseCode)
+
+ String extApiResponse = response.getResponseBodyAsString()
+ JSONObject responseObj = new JSONObject(extApiResponse)
+ execution.setVariable(Prefix + "getServiceResponse", extApiResponse)
+
+ //Process Response //200 OK 201 CREATED 202 ACCEPTED
+ if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
+ {
+ utils.log("DEBUG", "Get Service Received a Good Response")
+ String serviceUuid = responseObj.get("serviceSpecification.id")
+ execution.setVariable(Prefix + "serviceSpecificationId", serviceUuid)
+ }
+ else{
+ utils.log("DEBUG", "Get Service Received a Bad Response Code. Response Code is: " + responseCode)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Service Received a bad response from 3rdONAP External API")
+ }
+
+ msoLogger.info( "Exit " + queryServicefrom3rdONAP)
}
public void doDeleteE2ESIin3rdONAP(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started doDeleteE2ESIin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started doDeleteE2ESIin3rdONAP *****")
String extAPIPath = execution.getVariable("ExternalAPIURL")
String payload = execution.getVariable(Prefix + "Payload")
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "postServiceOrderResponseCode", responseCode)
- utils.log("DEBUG", "Post ServiceOrder response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Post ServiceOrder response code is: " + responseCode)
String extApiResponse = response.getResponseBodyAsString()
JSONObject responseObj = new JSONObject(extApiResponse)
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- utils.log("DEBUG", "Post ServiceOrder Received a Good Response", isDebugEnabled)
+ msoLogger.debug("Post ServiceOrder Received a Good Response")
String serviceOrderId = responseObj.get("ServiceOrderId")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("serviceOrderId", serviceOrderId)
}
else{
- utils.log("DEBUG", "Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
}
- utils.log("INFO", "Exit " + doDeleteE2ESIin3rdONAP, isDebugEnabled)
+ msoLogger.info( "Exit " + doDeleteE2ESIin3rdONAP)
}
public void getE2ESIProgressin3rdONAP(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started getE2ESIProgressin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
String extAPIPath = execution.getVariable("ExternalAPIURL")
extAPIPath += "/" + execution.getVariable("ServiceOrderId")
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "getServiceOrderResponseCode", responseCode)
- utils.log("DEBUG", "Get ServiceOrder response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Get ServiceOrder response code is: " + responseCode)
String extApiResponse = response.getResponseBodyAsString()
JSONObject responseObj = new JSONObject(extApiResponse)
//Process Response //200 OK 201 CREATED 202 ACCEPTED
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
{
- utils.log("DEBUG", "Get ServiceOrder Received a Good Response", isDebugEnabled)
+ msoLogger.debug("Get ServiceOrder Received a Good Response")
String serviceOrderState = responseObj.get("State")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("serviceOrderState", serviceOrderState)
execution.setVariable("statusDescription", "Delete Service Order Status is " + serviceOrderState)
}
else{
- utils.log("DEBUG", "Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get ServiceOrder Received a bad response")
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get ServiceOrder Received a bad response from 3rdONAP External API")
}
- utils.log("INFO", "Exit " + getE2ESIProgressin3rdONAP, isDebugEnabled)
+ msoLogger.info( "Exit " + getE2ESIProgressin3rdONAP)
}
/**
* delay 5 sec
*/
public void timeDelay(DelegateExecution execution) {
- def isDebugEnabled= execution.getVariable("isDebugLogEnabled")
try {
Thread.sleep(5000)
} catch(InterruptedException e) {
- utils.log("ERROR", "Time Delay exception" + e , isDebugEnabled)
+ utils.log("ERROR", "Time Delay exception" + e )
}
}
private void getSPPartnerInAAI(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started postDeleteE2ESIin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started postDeleteE2ESIin3rdONAP *****")
AaiUtil aaiUriUtil = new AaiUtil(this)
String serviceAaiPath = execution.getVariable(Prefix + "serviceAaiPath")
APIResponse response = aaiUriUtil.executeAAIGetCall(execution, serviceAaiPath)
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "GetSppartnerResponseCode", responseCode)
- utils.log("DEBUG", " Get sppartner response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug(" Get sppartner response code is: " + responseCode)
String aaiResponse = response.getResponseBodyAsString()
aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- utils.log("DEBUG", "GET sppartner Received a Good Response", isDebugEnabled)
+ msoLogger.debug("GET sppartner Received a Good Response")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable(Prefix + "FoundIndicator", true)
String sppartnerId = utils.getNodeText1(aaiResponse, "sppartner-id")
execution.setVariable(Prefix + "SppartnerId", sppartnerId)
- utils.log("DEBUG", " SppartnerId is: " + sppartnerId, isDebugEnabled)
+ msoLogger.debug(" SppartnerId is: " + sppartnerId)
String sppartnerUrl = utils.getNodeText1(aaiResponse, "sppartner-url")
execution.setVariable(Prefix + "SppartnerUrl", sppartnerUrl)
- utils.log("DEBUG", " SppartnerUrl is: " + sppartnerUrl, isDebugEnabled)
+ msoLogger.debug(" SppartnerUrl is: " + sppartnerUrl)
String callSource = utils.getNodeText1(aaiResponse, "sppartner-callsource")
execution.setVariable(Prefix + "CallSource", callSource)
- utils.log("DEBUG", " CallSource is: " + callSource, isDebugEnabled)
+ msoLogger.debug(" CallSource is: " + callSource)
String sppartnerVersion = utils.getNodeText1(aaiResponse, "resource-version")
execution.setVariable(Prefix + "SppartnerVersion", sppartnerVersion)
- utils.log("DEBUG", " Resource Version is: " + sppartnerVersion, isDebugEnabled)
+ msoLogger.debug(" Resource Version is: " + sppartnerVersion)
}
else
{
- utils.log("DEBUG", "Get sppartner Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Get sppartner Received a Bad Response Code. Response Code is: " + responseCode)
exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
throw new BpmnError("MSOWorkflowException")
}
- utils.log("INFO", "Exit " + deleteSPPartnerInAAI, isDebugEnabled)
+ msoLogger.info( "Exit " + deleteSPPartnerInAAI)
}
public void deleteSPPartnerInAAI(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started postDeleteE2ESIin3rdONAP *****", isDebugEnabled)
+ msoLogger.info(" ***** Started postDeleteE2ESIin3rdONAP *****")
String sppartnerId = execution.getVariable(Prefix + "SppartnerId")
String sppartnerUrl = execution.getVariable(Prefix + "sppartnerUrl")
APIResponse response = aaiUriUtil.executeAAIDeleteCall(execution, serviceAaiPath)
int responseCode = response.getStatusCode()
execution.setVariable(Prefix + "DeleteSppartnerResponseCode", responseCode)
- utils.log("DEBUG", " Get sppartner response code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug(" Get sppartner response code is: " + responseCode)
String aaiResponse = response.getResponseBodyAsString()
aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- utils.log("DEBUG", "Delete sppartner Received a Good Response", isDebugEnabled)
+ msoLogger.debug("Delete sppartner Received a Good Response")
execution.setVariable(Prefix + "SuccessIndicator", true)
}
else if(responseCode == 404){
- utils.log("DEBUG", " Delete sppartner Received a Not Found (404) Response", isDebugEnabled)
+ msoLogger.debug(" Delete sppartner Received a Not Found (404) Response")
execution.setVariable(Prefix + "FoundIndicator", false)
}
else
{
- utils.log("DEBUG", "Delete sppartner Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)
+ msoLogger.debug("Delete sppartner Received a Bad Response Code. Response Code is: " + responseCode)
exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
throw new BpmnError("MSOWorkflowException")
}
- utils.log("INFO", "Exit " + deleteSPPartnerInAAI, isDebugEnabled)
+ msoLogger.info( "Exit " + deleteSPPartnerInAAI)
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
}
public void postProcess(DelegateExecution execution){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Started postProcess *****", isDebugEnabled)
+ msoLogger.info(" ***** Started postProcess *****")
String responseCode = execution.getVariable(Prefix + "putSppartnerResponseCode")
String responseObj = execution.getVariable(Prefix + "putSppartnerResponse")
- utils.log("INFO","response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj, isDebugEnabled)
- utils.log("INFO"," ***** Exit postProcess *****", isDebugEnabled)
+ msoLogger.info("response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj)
+ msoLogger.info(" ***** Exit postProcess *****")
}
public void sendSyncResponse (DelegateExecution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+ msoLogger.debug(" *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled)
+ msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ msoLogger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ msoLogger.debug(" ***** Exit sendSyncResopnse *****")
}
}
--- /dev/null
+/*-
+ * ============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.onap.so.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.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.onap.so.bpmn.common.recipe.ResourceInput;
+import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
+import org.onap.so.bpmn.core.WorkflowException
+import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
+import org.onap.so.logger.MsoLogger
+import org.onap.so.rest.APIResponse
+import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
+
+import java.util.UUID;
+
+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.onap.so.rest.RESTClient
+import org.onap.so.rest.RESTConfig
+import org.onap.so.rest.APIResponse;
+import org.onap.so.bpmn.common.scripts.AaiUtil
+
+/**
+ * This groovy class supports the <class>CreateDeviceResource.bpmn</class> process.
+ * flow for Device Resource Create
+ */
+public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
+
+ String Prefix="DELDEVRES_"
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+ JsonUtils jsonUtil = new JsonUtils()
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteDeviceResource.class)
+
+ public void preProcessRequest(DelegateExecution execution){
+ msoLogger.info(" ***** Started preProcessRequest *****")
+ try {
+
+ //get bpmn inputs from resource request.
+ String requestId = execution.getVariable("mso-request-id")
+ String requestAction = execution.getVariable("requestAction")
+ msoLogger.info("The requestAction is: " + requestAction)
+ String recipeParamsFromRequest = execution.getVariable("recipeParams")
+ msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ String resourceInput = execution.getVariable("resourceInput")
+ msoLogger.info("The resourceInput is: " + resourceInput)
+ //Get ResourceInput Object
+ ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
+ execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+ String resourceInputPrameters = resourceInputObj.getResourceParameters()
+ String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
+ JSONObject inputParameters = new JSONObject(customizeResourceParam(inputParametersJson))
+ execution.setVariable(Prefix + "resourceRequestInputs", inputParameters)
+
+ //Deal with recipeParams
+ String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
+ String resourceName = resourceInputObj.getResourceInstanceName()
+ //For sdnc requestAction default is "createNetworkInstance"
+ String operationType = "Network"
+ if(!StringUtils.isBlank(recipeParamsFromRequest)){
+ //the operationType from worflow(first node) is second priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromRequest, "operationType")
+ }
+ if(!StringUtils.isBlank(recipeParamsFromWf)){
+ //the operationType from worflow(first node) is highest priority.
+ operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
+ }
+
+ execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
+ execution.setVariable("mso-request-id", requestId)
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex){
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ String customizeResourceParam(String networkInputParametersJson) {
+ List<Map<String, Object>> paramList = new ArrayList();
+ JSONObject jsonObject = new JSONObject(networkInputParametersJson);
+ 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 checkDevType(DelegateExecution execution){
+ utils.log("INFO"," ***** Started checkDevType *****")
+ try {
+
+ JSONObject inputParameters = execution.getVariable(Prefix + "resourceRequestInputs")
+
+ String devType = inputParameters.get("device_class")
+
+ if(StringUtils.isBlank(devType)) {
+ devType = "OTHER"
+ }
+
+ execution.setVariable("device_class", devType)
+
+ } catch (Exception ex){
+ String msg = "Exception in checkDevType " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void getVNFTemplatefromSDC(DelegateExecution execution){
+ utils.log("INFO"," ***** Started getVNFTemplatefromSDC *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void postVNFInfoProcess(DelegateExecution execution){
+ utils.log("INFO"," ***** Started postVNFInfoProcess *****")
+ try {
+ // To do
+
+
+ } catch (Exception ex){
+ String msg = "Exception in postVNFInfoProcess " + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ msoLogger.debug( " *** sendSyncResponse *** ")
+
+ try {
+ String operationStatus = "finished"
+ // RESTResponse for main flow
+ String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
+ msoLogger.debug( " sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ sendWorkflowResponse(execution, 202, resourceOperationResp)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ msoLogger.debug( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ msoLogger.debug(" ***** Exit sendSyncResopnse *****")
+ }
+}
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
- execution.setVariable("resourceType", currentResource.getModelInfo().getModelName())
+ execution.setVariable("resourceType", currentResource.getModelInfo().getModelName())
msoLogger.info("Now we deal with resouce:" + currentResource.getModelInfo().getModelName())
- msoLogger.trace("COMPLETED getCurrentResoure Process ")
+ msoLogger.trace("COMPLETED getCurrentResoure Process ")
}
public void parseNextResource(DelegateExecution execution){
} else {
String exceptionMessage = "Resource receipe is not found for resource modeluuid: " +
resourceInput.getResourceModelInfo().getModelUuid()
- utils.log("ERROR", exceptionMessage, isDebugEnabled)
+ msoLogger.trace(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, exceptionMessage)
}
)){
jObj.put("resourceInstanceId", eValue)
}
- // for sp-partner
- if(rt == "sp-partner" && eKey.equals("sp-partner.id")) {
+ // for sp-partner and others
+ else if(eKey.equals(rt + ".id")){
jObj.put("resourceInstanceId", eValue)
- String sppartnerName = "sp-partner" + eValue
- jObj.put("resourceType", sppartnerName)
+ String resourceName = rt + eValue;
+ jObj.put("resourceType", resourceName)
}
else if(eKey.equals(rt + ".id")){
jObj.put("resourceInstanceId", eValue)
--- /dev/null
+<?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.11.3">
+ <bpmn:process id="CreateDeviceResource.bpmn" name="CreateDeviceResource.bpmn" isExecutable="true">
+ <bpmn:endEvent id="EndEvent_1x6k78c" name="create Dev end">
+ <bpmn:incoming>SequenceFlow_0auvfvm</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_05niqbf</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0auvfvm</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def csi = new CreateDeviceResource.bpmn()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05niqbf" sourceRef="Task_0bga3e8" targetRef="ScriptTask_1g5zyi6" />
+ <bpmn:sequenceFlow id="SequenceFlow_0auvfvm" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
+ <bpmn:callActivity id="Task_0bga3e8" name="call Create SDNC Network Resource" calledElement="CreateSDNCNetworkResource">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1gu13by</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05niqbf</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:startEvent id="StartEvent_1vjxae6" name="createDev_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1rwaeun</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1caax8u" name="GoTo StartCreateDevinSDNC">
+ <bpmn:incoming>SequenceFlow_1ylvnxq</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:scriptTask id="ScriptTask_00y93jj" name="Check DevType" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0rq2jb1</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1hp2h5t</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.checkDevType(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_076ma0v">
+ <bpmn:incoming>SequenceFlow_1hp2h5t</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ss02ik</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0h4378g</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_076ma0v</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1chnlq6" name="GoTo StartCreateDevinSDNC">
+ <bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_02rli65">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "VNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1hp2h5t" sourceRef="ScriptTask_00y93jj" targetRef="ExclusiveGateway_0kba700" />
+ <bpmn:sequenceFlow id="SequenceFlow_0h4378g" name="PNF" sourceRef="ExclusiveGateway_0kba700" targetRef="IntermediateThrowEvent_1chnlq6">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "PNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1rwaeun" sourceRef="StartEvent_1vjxae6" targetRef="ScriptTask_14dav1d" />
+ <bpmn:scriptTask id="ScriptTask_14dav1d" name="Pre Process Request" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1rwaeun</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0rq2jb1</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.preProcessRequest(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0rq2jb1" sourceRef="ScriptTask_14dav1d" targetRef="ScriptTask_00y93jj" />
+ <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0slgrxw" name="StartCreateDevinSDNC">
+ <bpmn:outgoing>SequenceFlow_1gu13by</bpmn:outgoing>
+ <bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
+ </bpmn:intermediateCatchEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1gu13by" sourceRef="IntermediateCatchEvent_0slgrxw" targetRef="Task_0bga3e8" />
+ <bpmn:callActivity id="CallActivity_0pyrfca" name="call CreateVNF" calledElement="DoCreateVNF">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_0pg3072</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
+ <bpmn:endEvent id="EndEvent_0ymfq61">
+ <bpmn:incoming>SequenceFlow_076ma0v</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_076ma0v" sourceRef="ExclusiveGateway_0kba700" targetRef="EndEvent_0ymfq61" />
+ <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF Template fom SDC" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.getVNFTemplatefromSDC(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0pg3072" sourceRef="ScriptTask_02rli65" targetRef="CallActivity_0pyrfca" />
+ <bpmn:scriptTask id="ScriptTask_0u1piih" name="Post VNF info process " scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0pkp4ce</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ylvnxq</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new CreateDeviceResource()
+dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateDeviceResource.bpmn">
+ <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
+ <dc:Bounds x="1026" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="994" y="153" width="75" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
+ <dc:Bounds x="494" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_05niqbf_di" bpmnElement="SequenceFlow_05niqbf">
+ <di:waypoint xsi:type="dc:Point" x="191" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="494" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="297.5" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0auvfvm_di" bpmnElement="SequenceFlow_0auvfvm">
+ <di:waypoint xsi:type="dc:Point" x="594" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="765" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0aywvn3_di" bpmnElement="Task_0bga3e8">
+ <dc:Bounds x="91" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="StartEvent_1vjxae6_di" bpmnElement="StartEvent_1vjxae6">
+ <dc:Bounds x="-188" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-211" y="-109" width="88" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1caax8u_di" bpmnElement="IntermediateThrowEvent_1caax8u">
+ <dc:Bounds x="1026" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1009" y="-104" width="78" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_00y93jj_di" bpmnElement="ScriptTask_00y93jj">
+ <dc:Bounds x="141" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0kba700_di" bpmnElement="ExclusiveGateway_0kba700" isMarkerVisible="true">
+ <dc:Bounds x="334" y="-152" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="309" y="-166" width="34" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1chnlq6_di" bpmnElement="IntermediateThrowEvent_1chnlq6">
+ <dc:Bounds x="341" y="-28" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="325" y="13" width="78" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ss02ik_di" bpmnElement="SequenceFlow_1ss02ik">
+ <di:waypoint xsi:type="dc:Point" x="384" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="480" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="420.94444444444446" y="-148" width="23" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1hp2h5t_di" bpmnElement="SequenceFlow_1hp2h5t">
+ <di:waypoint xsi:type="dc:Point" x="241" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="334" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="242.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0h4378g_di" bpmnElement="SequenceFlow_0h4378g">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-102" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-28" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="365" y="-67.27272727272728" width="22" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1rwaeun_di" bpmnElement="SequenceFlow_1rwaeun">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="-53" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-147.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_14dav1d_di" bpmnElement="ScriptTask_14dav1d">
+ <dc:Bounds x="-53" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0rq2jb1_di" bpmnElement="SequenceFlow_0rq2jb1">
+ <di:waypoint xsi:type="dc:Point" x="47" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="141" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="49" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="IntermediateCatchEvent_0slgrxw_di" bpmnElement="IntermediateCatchEvent_0slgrxw">
+ <dc:Bounds x="-188" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-203" y="147" width="79" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1gu13by_di" bpmnElement="SequenceFlow_1gu13by">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="91" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-75.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0pyrfca_di" bpmnElement="CallActivity_0pyrfca">
+ <dc:Bounds x="662" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pkp4ce_di" bpmnElement="SequenceFlow_0pkp4ce">
+ <di:waypoint xsi:type="dc:Point" x="762" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="849" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="760.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_0ymfq61_di" bpmnElement="EndEvent_0ymfq61">
+ <dc:Bounds x="341" y="-251" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="359" y="-211" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_076ma0v_di" bpmnElement="SequenceFlow_076ma0v">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-215" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="374" y="-189.5" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
+ <dc:Bounds x="480" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pg3072_di" bpmnElement="SequenceFlow_0pg3072">
+ <di:waypoint xsi:type="dc:Point" x="580" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="662" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="621" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0u1piih_di" bpmnElement="ScriptTask_0u1piih">
+ <dc:Bounds x="849" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ylvnxq_di" bpmnElement="SequenceFlow_1ylvnxq">
+ <di:waypoint xsi:type="dc:Point" x="949" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="987.5" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
--- /dev/null
+<?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.11.3">
+ <bpmn:process id="DeleteDeviceResource.bpmn" name="DeleteDeviceResource.bpmn" isExecutable="true">
+ <bpmn:endEvent id="EndEvent_1x6k78c" name="delete Dev end">
+ <bpmn:incoming>SequenceFlow_0auvfvm</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_05niqbf</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0auvfvm</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def csi = new DeleteDeviceResource.bpmn()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05niqbf" sourceRef="Task_0bga3e8" targetRef="ScriptTask_1g5zyi6" />
+ <bpmn:sequenceFlow id="SequenceFlow_0auvfvm" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
+ <bpmn:callActivity id="Task_0bga3e8" name="call Delete SDNC Network Resource" calledElement="DeleteSDNCNetworkResource">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1gu13by</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05niqbf</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:startEvent id="StartEvent_1vjxae6" name="deleteDev_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1rwaeun</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1caax8u" name="GoTo StartDeleteDevinSDNC">
+ <bpmn:incoming>SequenceFlow_1ylvnxq</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:scriptTask id="ScriptTask_00y93jj" name="Check DevType from AAI" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0rq2jb1</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1hp2h5t</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.checkDevType(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_076ma0v">
+ <bpmn:incoming>SequenceFlow_1hp2h5t</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ss02ik</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0h4378g</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_076ma0v</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1chnlq6" name="GoTo StartDeleteDevinSDNC">
+ <bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
+ <bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
+ </bpmn:intermediateThrowEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_02rli65">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "VNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1hp2h5t" sourceRef="ScriptTask_00y93jj" targetRef="ExclusiveGateway_0kba700" />
+ <bpmn:sequenceFlow id="SequenceFlow_0h4378g" name="PNF" sourceRef="ExclusiveGateway_0kba700" targetRef="IntermediateThrowEvent_1chnlq6">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "PNF" )}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_1rwaeun" sourceRef="StartEvent_1vjxae6" targetRef="ScriptTask_14dav1d" />
+ <bpmn:scriptTask id="ScriptTask_14dav1d" name="Pre Process Request" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1rwaeun</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0rq2jb1</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.preProcessRequest(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0rq2jb1" sourceRef="ScriptTask_14dav1d" targetRef="ScriptTask_00y93jj" />
+ <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0slgrxw" name="StartDeleteDevinSDNC">
+ <bpmn:outgoing>SequenceFlow_1gu13by</bpmn:outgoing>
+ <bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
+ </bpmn:intermediateCatchEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1gu13by" sourceRef="IntermediateCatchEvent_0slgrxw" targetRef="Task_0bga3e8" />
+ <bpmn:callActivity id="CallActivity_0pyrfca" name="call DeleteVNF" calledElement="DoDeleteVNF">
+ <bpmn:extensionElements>
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="recipeParams" target="recipeParams" />
+ <camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
+ <camunda:in source="operationId" target="operationId" />
+ <camunda:in source="svcAction" target="svcAction" />
+ <camunda:in source="requestAction" target="requestAction" />
+ <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+ <camunda:in source="networkRequest" target="networkRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_0pg3072</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
+ <bpmn:endEvent id="EndEvent_0ymfq61">
+ <bpmn:incoming>SequenceFlow_076ma0v</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_076ma0v" sourceRef="ExclusiveGateway_0kba700" targetRef="EndEvent_0ymfq61" />
+ <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF ID" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.getVNFTemplatefromSDC(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0pg3072" sourceRef="ScriptTask_02rli65" targetRef="CallActivity_0pyrfca" />
+ <bpmn:scriptTask id="ScriptTask_0u1piih" name="Post VNF info process " scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0pkp4ce</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ylvnxq</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteDeviceResource()
+dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteDeviceResource.bpmn">
+ <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
+ <dc:Bounds x="1026" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="994" y="153" width="75" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
+ <dc:Bounds x="494" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_05niqbf_di" bpmnElement="SequenceFlow_05niqbf">
+ <di:waypoint xsi:type="dc:Point" x="191" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="494" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="297.5" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0auvfvm_di" bpmnElement="SequenceFlow_0auvfvm">
+ <di:waypoint xsi:type="dc:Point" x="594" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="765" y="104" width="90" height="20" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0aywvn3_di" bpmnElement="Task_0bga3e8">
+ <dc:Bounds x="91" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="StartEvent_1vjxae6_di" bpmnElement="StartEvent_1vjxae6">
+ <dc:Bounds x="-188" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-211" y="-109" width="88" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1caax8u_di" bpmnElement="IntermediateThrowEvent_1caax8u">
+ <dc:Bounds x="1026" y="-145" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1010" y="-104" width="77" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_00y93jj_di" bpmnElement="ScriptTask_00y93jj">
+ <dc:Bounds x="141" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_0kba700_di" bpmnElement="ExclusiveGateway_0kba700" isMarkerVisible="true">
+ <dc:Bounds x="334" y="-152" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="309" y="-166" width="34" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="IntermediateThrowEvent_1chnlq6_di" bpmnElement="IntermediateThrowEvent_1chnlq6">
+ <dc:Bounds x="341" y="-28" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="325" y="13" width="78" height="36" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ss02ik_di" bpmnElement="SequenceFlow_1ss02ik">
+ <di:waypoint xsi:type="dc:Point" x="384" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="480" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="420.94444444444446" y="-148" width="23" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1hp2h5t_di" bpmnElement="SequenceFlow_1hp2h5t">
+ <di:waypoint xsi:type="dc:Point" x="241" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="334" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="242.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0h4378g_di" bpmnElement="SequenceFlow_0h4378g">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-102" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-28" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="365" y="-67.27272727272728" width="22" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1rwaeun_di" bpmnElement="SequenceFlow_1rwaeun">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="-53" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-147.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_14dav1d_di" bpmnElement="ScriptTask_14dav1d">
+ <dc:Bounds x="-53" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0rq2jb1_di" bpmnElement="SequenceFlow_0rq2jb1">
+ <di:waypoint xsi:type="dc:Point" x="47" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="141" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="49" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="IntermediateCatchEvent_0slgrxw_di" bpmnElement="IntermediateCatchEvent_0slgrxw">
+ <dc:Bounds x="-188" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-203" y="147" width="78" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1gu13by_di" bpmnElement="SequenceFlow_1gu13by">
+ <di:waypoint xsi:type="dc:Point" x="-152" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="91" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-75.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0pyrfca_di" bpmnElement="CallActivity_0pyrfca">
+ <dc:Bounds x="662" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pkp4ce_di" bpmnElement="SequenceFlow_0pkp4ce">
+ <di:waypoint xsi:type="dc:Point" x="762" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="849" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="760.5" y="-148" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_0ymfq61_di" bpmnElement="EndEvent_0ymfq61">
+ <dc:Bounds x="341" y="-251" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="359" y="-211" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_076ma0v_di" bpmnElement="SequenceFlow_076ma0v">
+ <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
+ <di:waypoint xsi:type="dc:Point" x="359" y="-215" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="374" y="-189.5" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
+ <dc:Bounds x="480" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0pg3072_di" bpmnElement="SequenceFlow_0pg3072">
+ <di:waypoint xsi:type="dc:Point" x="580" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="662" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="621" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0u1piih_di" bpmnElement="ScriptTask_0u1piih">
+ <dc:Bounds x="849" y="-167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ylvnxq_di" bpmnElement="SequenceFlow_1ylvnxq">
+ <di:waypoint xsi:type="dc:Point" x="949" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="987.5" y="-148" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "HeatStackId is missing from create VolumeGroup Vnf Adapter response.");
}
}
+ execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock());
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
if (requestContext.getUserParams() != null) {
paramsMap.putAll(requestContext.getUserParams());
}
+ if (vfModule.getCloudParams() != null) {
+ paramsMap.putAll(vfModule.getCloudParams());
+ }
return paramsMap;
}
}
}
+ if (vfModule.getCloudParams() != null) {
+ for (Map.Entry<String, String> entry : vfModule.getCloudParams().entrySet()) {
+ GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
+ paramItem.setName(entry.getKey());
+ paramItem.setValue(entry.getValue());
+ vfModuleInputParameters.addParamItem(paramItem);
+ }
+ }
+
if (volumeGroup != null) {
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName("volume-group-id");
modelInfoVfModule.setModelUUID("vfModuleModelUuid");
modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
vfModule.setModelInfoVfModule(modelInfoVfModule);
+ HashMap<String, String> cloudParams = new HashMap<String, String>();
+ cloudParams.put("key3", "value3");
+ vfModule.setCloudParams(cloudParams);
CloudRegion cloudRegion = new CloudRegion();
cloudRegion.setLcpCloudRegionId("cloudRegionId");
modelInfoVfModule.setModelUUID("vfModuleModelUuid");
modelInfoVfModule.setModelCustomizationUUID("vfModuleModelCustomizationUuid");
vfModule.setModelInfoVfModule(modelInfoVfModule);
+ HashMap<String, String> cloudParams = new HashMap<String, String>();
+ userParams.put("key2", "value2");
+ vfModule.setCloudParams(cloudParams);
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setVolumeGroupId("volumeGroupId");
"fw_subint_ctrl_port_0_floating_v6_ip": "floatingIpV60",
"workload_context": "workloadContext",
"key1": "value2",
+ "key3": "value3",
"availability_zone_0": "zone0",
"availability_zone_1": "zone1",
"availability_zone_2": "zone2",
"name" : "key1",
"value" : "value1"
},
+ {
+ "name" : "key2",
+ "value" : "value2"
+ },
{
"name" : "volume-group-id",
"value" : "volumeGroupId"
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2017 Huawei Technologies Co., Ltd.
-
-Configure git and gerrit
-========================
-
-Basics
-------
-The recommended version of git is 2.7.4 or later. Check the installed version in the Ubuntu VM:
-
-.. code-block:: bash
-
- git --version
-
-Create an SSH key to user with gerrit. Use no passphrase.
-
-.. code-block:: bash
-
- ssh-keygen -t rsa
-
-Enter your SSH public key (id_rsa) into gerrit:
-
-- Browse to https://gerrit.onap.org
-- Log in
-- Open the menu next to your name (under the green search button)
-
-.. image:: images/Configure_git_1.png
-
-- Select "Settings"
-- In the "Settings" sidebar, click "SSH Public Keys"`
-- Click "Add Key..."
-- Paste the entire contents of $HOME/.ssh/id_rsa.pub into the text area and click "Add".
-
-.. image:: images/Configure_git_2.png
-
-Install the git-review package.
-
-.. code-block:: bash
-
- sudo apt update
- sudo apt install git-review
-
-Create $HOME/.gitconfig (replace highlighted values with your own information):
- [user]
-
- name = FirstName LastName
-
- email = you@yourcompany.com
-
- [core]
-
- autocrlf = false
-
- [merge]
-
- tool = vimdiff
-
- [gitreview]
-
- username = YourLinuxFoundationId
-
-**If you're behind a corporate firewall and your proxy server has SOCKS support...**
-
-You may be able to use the SSH protocol with git, which is preferred versus HTTP. This method is known to work in the AT&T corporate network.
-Install the socat package, which allows you to tunnel SSH connections through a proxy that supports SOCKS:
-
-.. code-block:: bash
-
- sudo apt update
- sudo apt install socat
-
-Create (or append to) $HOME/.ssh/config (replace highlighted values with your information)
-
- Host gerrit.onap.org
-
- User userid
-
- Hostname gerrit.onap.org
-
- ProxyCommand socat - PROXY:host:%h:%p,proxyport=port
-
- IdentityFile /home/userid/.ssh/id_rsa
-
- ServerAliveInterval 10
-
-Verify that you have connectivity to gerrit through the proxy. Answer "yes" to continue connecting, if prompted.
-
-.. code-block:: bash
-
- ssh -p 29418 gerrit.onap.org
-
-.. image:: images/Configure_git_3.png
\r
Guest Port: 22\r
\r
-.. image:: images/Configure_ubuntu_SO_1.png\r
+.. image:: ../images/Configure_ubuntu_SO_1.png\r
\r
.\r
\r
-.. image:: images/Configure_ubuntu_SO_2.png\r
+.. image:: ../images/Configure_ubuntu_SO_2.png\r
\r
Create Shared Folder\r
--------------------\r
cd /media/cdrom\r
sudo ./VBoxLinuxAdditions.run\r
\r
-.. image:: images/Configure_ubuntu_SO_9.png \r
+.. image:: ../images/Configure_ubuntu_SO_9.png \r
\r
Add yourself to the vboxsf user group (replace "userid" with your user ID):\r
\r
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2018 Huawei Technologies Co., Ltd.\r
-\r
-Install Docker\r
-===============\r
-\r
-Make sure curl is installed on the Ubuntu VM:\r
-\r
-.. code-block:: bash\r
-\r
- sudo apt update\r
- sudo apt install curl\r
-\r
-If you are behind a corporate firewall (replace "proxyhost:port" with your actual proxy information)\r
- https_proxy="https://*proxyhost:port*" curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -\r
- \r
-Otherwise:\r
- curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -\r
-Expected Response:\r
- OK\r
-Add the docker package repository:\r
- sudo apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-xenial main"\r
- \r
-Install packages:\r
-\r
-.. code-block:: bash\r
-\r
- sudo apt update\r
- sudo apt-cache policy docker-engine\r
- sudo apt install docker-engine\r
- sudo apt install docker-compose\r
- \r
-If you are behind a corporate firewall, you will need to configure proxy settings for docker so that images may be obtained from internet repositories. In the commands shown here, replace *"proxyhost:port"*, *"yourdomain1.com"*, and *"yourdomain2.com"* with appropriate values.\r
- \r
- Make the docker configuration directory:\r
-\r
-.. code-block:: bash\r
- \r
- sudo mkdir -p /etc/systemd/system/docker.service.d\r
- \r
- Edit (create) this file:\r
-\r
-.. code-block:: bash\r
- \r
- sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf\r
- \r
- Add these lines:\r
-\r
- [Service]\r
- \r
- Environment="HTTP_PROXY=https://*proxyhost:port*"\r
- \r
- Environment="HTTPS_PROXY=https://*proxyhost:port*"\r
- \r
- Environment="NO_PROXY=localhost,127.0.0.1,.yourdomain1.com,.yourdomain2.com"\r
- \r
- Restart docker:\r
-\r
-.. code-block:: bash\r
- \r
- sudo systemctl daemon-reload\r
- sudo systemctl restart docker\r
-\r
-Add yourself to the docker user group (replace "userid" with your user ID):\r
-\r
-.. code-block:: bash\r
-\r
- sudo usermod -a -G docker *userid*\r
-\r
-Log out and log back in so that the user group change will takeeffect.\r
-\r
-Verify that you can connect to docker as yourself (i.e. not as root):\r
-\r
-.. code-block:: bash\r
-\r
- docker ps\r
-\r
-Verify that you can download and run the hello-world container\r
-\r
-.. code-block:: bash\r
-\r
- docker run hello-world\r
- \r
-.. image:: images/Docker_install_1.png
\ No newline at end of file
+++ /dev/null
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-Workspace and Development Tools\r
-===============================\r
-\r
-We recognize that there are different ways to set up a workspace and different tools that may be chosen. This is just one way to set things up.\r
-\r
-Suggested Directory Structure\r
-------------------------------\r
-*NOTE*: You may have different versions of eclipse and java.\r
-\r
- onap\r
- \r
- .m2\r
- \r
- apache-maven-3.3.9\r
- \r
- camunda-modeler\r
- \r
- eclipse-jee-neon-3-linux-gtk-x86_64\r
- \r
- jdk1.8.0_131\r
- \r
- workspace\r
- \r
- SO\r
- chef-repo\r
- \r
- docker-config\r
- \r
- libs\r
- \r
- so\r
- \r
- so-config\r
- \r
-Java\r
------\r
-Download the latest Java_8_SE_Development_Kit_ from Oracle. Select a Linux x64 package.\r
-\r
-Unpack it.\r
-\r
-.. _Java_8_SE_Development_Kit: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\r
-\r
-Maven\r
-------\r
-\r
-Download the Apache_Maven_3.3.9_ binary. NOTE: 3.3.9 is the recommended version, even though much higher versions are available.\r
-\r
-Unpack it.\r
-\r
-.. _Apache_Maven_3.3.9: https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/\r
-\r
-Create an .m2 directory for maven and put settings.xml_ in it. Edit the local repository path in settings.xml to make it correct for your environment. Everything else should be OK.\r
-\r
-.. _settings.xml: https://wiki.onap.org/download/attachments/15997820/settings.xml?version=1&modificationDate=1506156303000&api=v2\r
-\r
-Camunda Modeler\r
----------------\r
-\r
-Download the Camunda_Modeler_. Select the Linux x64 package.\r
-Unpack it.\r
-\r
-.. _Camunda_Modeler: https://camunda.org/download/modeler/\r
-\r
-Eclipse\r
--------\r
-\r
-Download Eclipse_for_Linux_. Select the 64-bit Eclipse IDE for Java EE Developers. Oxygen seems to be the latest version. These instructions were written for Neon.\r
-Unpack it.\r
-\r
-.. _Eclipse_for_Linux: https://www.eclipse.org/downloads/eclipse-packages/?osType=linux\r
-\r
-In the eclipse directory, edit eclipse.ini\r
-\r
- Add (or change) the -vm setting so that it points to your JDK.\r
- \r
- Adjust the maximum heap space (2GB is recommended).\r
- \r
- Example:\r
- \r
-.. image:: images/Workspace_and_Development_Tools.png \r
- \r
-Eclipse Settings\r
-----------------\r
-\r
-**Configure eclipse to use your external maven 3.3.9 installation:**\r
- Go to Window→Preferences→Maven→Installations\r
- \r
- Click "Add" and browse to your apache-maven-3.3.9 directory. Click "OK" to select it.\r
- \r
- Click "Finish"\r
- \r
-.. image:: images/Workspace_and_Development_Tools_2.png\r
-\r
-Make sure the external installation is selected:\r
-\r
-.. image:: images/Workspace_and_Development_Tools_3.png\r
-\r
-**Configure eclipse to use your settings.xml**\r
- Go to Window→Preferences→Maven→User Settings\r
- \r
- Type the full path to your settings.xml file into the "User Settings" box and click "OK".\r
- \r
-.. image:: images/Workspace_and_Development_Tools_4.png
\ No newline at end of file
SO Interfaces
================================
-.. image:: images/SO_1.png
+.. image:: ../images/SO_1.png
SO APIs
=================================
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2018 Huawei Technologies Co., Ltd.\r
-\r
-SO - Architecture\r
-===============\r
-\r
-.. image:: images/SO_Architecture_1.png\r
-\r
-SO Sub-Components\r
-------------------\r
-\r
-**API Handler**\r
-\r
- RESTful interface to northbound clients\r
- \r
- * Handle service-level and infrastructure (VNF & network) requests\r
- \r
- Service-agnostic APIs\r
- * “Service Instantiation API”\r
-\r
- Model-driven recipe selection\r
- * Use SO Catalog to map input requests to BPMN flows\r
- * Dynamic lookup based on service-model + action\r
- * Input data forwarded to BPMN flow\r
- \r
- Track open and completed requests via SO Request DB\r
-\r
- Multiple API-H modules may support different APIs\r
-\r
-**BPMN Execution Engine**\r
-\r
- Open-source Camunda platform\r
- * Support BPMN 2.0 service recipes\r
-\r
- Expose RESTful interface to API-H (unique path per recipe)\r
-\r
- Make use of common “building block” sub-flows\r
-\r
- Sequence orchestration steps for each Resource in the recipe\r
- * Request and configure network resources via SDN-C\r
- * Manage cloud resources via PO (OpenStack)\r
- * Update inventory via A&AI\r
- \r
- Perform error handling/rollback\r
-\r
-**Resource Adapters**\r
-\r
- Interfaces to lower level controllers and other ONAP components\r
- * Platform Orchestrator, SDN-Controller, APP-Controller, VFC-Controllers\r
- * Hides the details of complex interfaces (e.g. OpenStack APIs)\r
- * Expose interfaces to BPMN flows as SOAP or REST APIs\r
- * Support synchronous and asynchronous operations\r
- \r
- Provided as part of SO platform for use by all BPMN flows\r
-\r
- Use SO Catalog to map resource requests to a recipe/template\r
-\r
- Data-driven design\r
- * Catalog templates may be updated via self-service (outside of release cycles)\r
- * Merge input parameters with templates at run-time\r
-\r
-**Data Stores**\r
- \r
- Request DB\r
- * Tracks open and completed requests\r
- \r
- SO Catalog\r
- * SO view of the SDC Catalog\r
- * service and resource models, recipes, and templates\r
- * Populated via SDC distribution service from TOSCA models\r
-\r
- Camunda DB\r
- * Maintain state for BPMN flows\r
- * Supports multiple active engines\r
- \r
-**SDC Distribution Client**\r
-\r
- Receive updated service models from SDC\r
- * Event-bus notifications when new models available\r
- * HTTP retrieval of models (TOSCA) and artifacts (Heat)\r
- \r
- Receive distributions as TOSCA models\r
-\r
- Populate SO Catalog\r
-\r
- Support self-service updates to models and artifacts\r
- \r
-Third Party and Open Source\r
----------------------------\r
-\r
-**BPMN Engine**\r
- Camunda (open source)\r
-\r
-**Other Open Source Components of Note:**\r
- JBOSS EAP/Wildfly\r
- MySQL/MariaDB\r
- Openstack Java SDK (“woorea”)\r
-\r
-\r
-\r
-\r
-\r
- \r
- \r
-\r
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2018 Huawei Technologies Co., Ltd.
+
+SO - Architecture
+===============
+
+.. image:: ../images/SO_Architecture_1.png
+
+SO Sub-Components
+------------------
+
+**API Handler**
+
+ RESTful interface to northbound clients
+
+ * Handle service-level and infrastructure (VNF & network) requests
+
+ Service-agnostic APIs
+ * “Service Instantiation API”
+
+ Model-driven recipe selection
+ * Use SO Catalog to map input requests to BPMN flows
+ * Dynamic lookup based on service-model + action
+ * Input data forwarded to BPMN flow
+
+ Track open and completed requests via SO Request DB
+
+ Multiple API-H modules may support different APIs
+
+**BPMN Execution Engine**
+
+ Open-source Camunda platform
+ * Support BPMN 2.0 service recipes
+
+ Expose RESTful interface to API-H (unique path per recipe)
+
+ Make use of common “building block” sub-flows
+
+ Sequence orchestration steps for each Resource in the recipe
+ * Request and configure network resources via SDN-C
+ * Manage cloud resources via PO (OpenStack)
+ * Update inventory via A&AI
+
+ Perform error handling/rollback
+
+**Resource Adapters**
+
+ Interfaces to lower level controllers and other ONAP components
+ * Platform Orchestrator, SDN-Controller, APP-Controller, VFC-Controllers
+ * Hides the details of complex interfaces (e.g. OpenStack APIs)
+ * Expose interfaces to BPMN flows as SOAP or REST APIs
+ * Support synchronous and asynchronous operations
+
+ Provided as part of SO platform for use by all BPMN flows
+
+ Use SO Catalog to map resource requests to a recipe/template
+
+ Data-driven design
+ * Catalog templates may be updated via self-service (outside of release cycles)
+ * Merge input parameters with templates at run-time
+
+**Data Stores**
+
+ Request DB
+ * Tracks open and completed requests
+
+ SO Catalog
+ * SO view of the SDC Catalog
+ * service and resource models, recipes, and templates
+ * Populated via SDC distribution service from TOSCA models
+
+ Camunda DB
+ * Maintain state for BPMN flows
+ * Supports multiple active engines
+
+**SDC Distribution Client**
+
+ Receive updated service models from SDC
+ * Event-bus notifications when new models available
+ * HTTP retrieval of models (TOSCA) and artifacts (Heat)
+
+ Receive distributions as TOSCA models
+
+ Populate SO Catalog
+
+ Support self-service updates to models and artifacts
+
+** SO Monitoring**
+ Monitor BPMN Workflow execution by providing
+ * Service list search based on search criteria
+ * Service statistic
+ * Service Process Instance Rendering and Detail
+
+Third Party and Open Source
+---------------------------
+
+**BPMN Engine**
+ Camunda (open source)
+
+**Other Open Source Components of Note:**
+ Tomcat
+ MySQL/MariaDB
+ Openstack Java SDK (“woorea”)
+
+
+
+
+
+
+
+
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-BPMN Main Process Flows\r
-========================\r
-\r
-Characteristics\r
-----------------\r
-\r
-**Invoked by an API Handler**\r
-\r
- The BPMN application (war) exposes a REST endpoint to which the API Handler(s) send requests for flow execution. The message sent by the API Handler to this endpoint is a JSON wrapper containing:\r
- \r
- * The original request received by the API handler from the portal or other client.\r
- * Metadata such as the request-id generated by the API Handler for the request.\r
- * The name of the BPMN process to execute (obtained by the API Handler from the mso_catalog.service_recipe table.\r
- \r
-**Asynchronous Service Model**\r
- \r
- All main process flows implement an asynchronous service model. The connection to the API Handler is kept open until the main process flow sends back a response. In the flow shown below, this is done by the "Send Sync Ack Response" script task. A flow is expected to send a response after validating the request, but before performing any long running tasks or tasks that could cause the process to be suspended.\r
- \r
- After the synchronous response is sent, the flow continues to execute. When the flow ends, it may optionally send an asynchronous notification to a callback URL provided in the original request (behavior depends on the API agreement)\r
- \r
-**Typically calls one or more subprocess flows**\r
-\r
- Main process flows usually implement the high-level service logic, delegating the "real" work to reusable subflows (Building Blocks) or custom subflows\r
- \r
-**Handles "Completion" and "Fallout" tasks**\r
-\r
- "Completion" tasks are those that occur when the process ends successfully, and "Fallout" tasks are those that occur when the process fails. Activities include:\r
- \r
- * Updating the mso_requests database.\r
- * Rolling back uncompleted work.\r
- * Sending an asynchronous callback notification.\r
-\r
-Example: CreateVfModuleVolumeInfraV1.bpmn\r
-------------------------------------------\r
-\r
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Main Process Flows
+========================
+
+Characteristics
+----------------
+
+**Invoked by an API Handler**
+
+ The BPMN application (war) exposes a REST endpoint to which the API Handler(s) send requests for flow execution. The message sent by the API Handler to this endpoint is a JSON wrapper containing:
+
+ * The original request received by the API handler from the portal or other client.
+ * Metadata such as the request-id generated by the API Handler for the request.
+ * The name of the BPMN process to execute (obtained by the API Handler from the mso_catalog.service_recipe table.
+
+**Asynchronous Service Model**
+
+ All main process flows implement an asynchronous service model. The connection to the API Handler is kept open until the main process flow sends back a response. In the flow shown below, this is done by the "Send Sync Ack Response" script task. A flow is expected to send a response after validating the request, but before performing any long running tasks or tasks that could cause the process to be suspended.
+
+ After the synchronous response is sent, the flow continues to execute. When the flow ends, it may optionally send an asynchronous notification to a callback URL provided in the original request (behavior depends on the API agreement)
+
+**Typically calls one or more subprocess flows**
+
+ Main process flows usually implement the high-level service logic, delegating the "real" work to reusable subflows (Building Blocks) or custom subflows
+
+**Handles "Completion" and "Fallout" tasks**
+
+ "Completion" tasks are those that occur when the process ends successfully, and "Fallout" tasks are those that occur when the process fails. Activities include:
+
+ * Updating the mso_requests database.
+ * Rolling back uncompleted work.
+ * Sending an asynchronous callback notification.
+
+Example: CreateVfModuleVolumeInfraV1.bpmn
+------------------------------------------
+
.. image:: images/BPMN_Main_Process_Flows_1.png
\ No newline at end of file
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-BPMN Project Structure\r
-=======================\r
-\r
-BPMN main process flow\r
-----------------------\r
-\r
-A BPMN main process flow is a top-level flow. All main process flows are under the src/main/resources/process folder.\r
-\r
-CreateVfModuleVolumeInfraV1 is a main process flow.\r
-\r
-.. image:: images/bpmn_project_structure_1.png\r
-\r
-Open BPMN files with the camunda modeler (standalone application). To launch the modeler from eclipse, right-click→open-with→Other→Browse. Select Check the boxes on the dialog so that eclipse will open all .bpmn files with the camunda-modeler executable.\r
-\r
-BPMN subprocess flow\r
----------------------\r
-\r
-A BPMN subprocess flow is meant to be invoked by other flows (either main process flows or other subprocess flows). All subprocess flows are under the src/main/resources/subprocess folder.\r
-\r
-The CreateVfModuleVolumeInfraV1 process flow is delivered with two custom subflows: DoCreateVfModuleVolumeV2 and DoCreateVfModuleVolumeRollback.\r
-\r
-.. image:: images/bpmn_project_structure_2.png\r
-\r
-Groovy scripts\r
----------------\r
-\r
-There is one groovy script for each BPMN file. Groovy scripts are invoked by script tasks within the BPMN flows.\r
-\r
-.. image:: images/bpmn_project_structure_3.png\r
-\r
-Unit Tests\r
------------\r
-\r
-Normally, we create a unit test class for every flow. This one is missing a unit test for its rollback flow.\r
-\r
-.. image:: images/bpmn_project_structure_4.png\r
-\r
-Unit Test Resource Files\r
-------------------------\r
-\r
-Any files needed by the unit tests are kept under the src/test/resources/__files folder.\r
-\r
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Project Structure
+=======================
+
+BPMN main process flow
+----------------------
+
+A BPMN main process flow is a top-level flow. All main process flows are under the src/main/resources/process folder.
+
+CreateVfModuleVolumeInfraV1 is a main process flow.
+
+.. image:: images/bpmn_project_structure_1.png
+
+Open BPMN files with the camunda modeler (standalone application). To launch the modeler from eclipse, right-click→open-with→Other→Browse. Select Check the boxes on the dialog so that eclipse will open all .bpmn files with the camunda-modeler executable.
+
+BPMN subprocess flow
+---------------------
+
+A BPMN subprocess flow is meant to be invoked by other flows (either main process flows or other subprocess flows). All subprocess flows are under the src/main/resources/subprocess folder.
+
+The CreateVfModuleVolumeInfraV1 process flow is delivered with two custom subflows: DoCreateVfModuleVolumeV2 and DoCreateVfModuleVolumeRollback.
+
+.. image:: images/bpmn_project_structure_2.png
+
+Groovy scripts
+---------------
+
+There is one groovy script for each BPMN file. Groovy scripts are invoked by script tasks within the BPMN flows.
+
+.. image:: images/bpmn_project_structure_3.png
+
+Unit Tests
+-----------
+
+Normally, we create a unit test class for every flow. This one is missing a unit test for its rollback flow.
+
+.. image:: images/bpmn_project_structure_4.png
+
+Unit Test Resource Files
+------------------------
+
+Any files needed by the unit tests are kept under the src/test/resources/__files folder.
+
.. image:: images/bpmn_project_structure_5.png
\ No newline at end of file
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-BPMN Subprocess Process Flows\r
-==============================\r
-\r
-Characteristics\r
-----------------\r
-\r
-**Invoked by other flows**\r
-\r
- A BPMN Call_Activity_ provides the mechanism to invoke subprocess flows. The Called Element attribute of the Call Activity specifies the name of the subprocess to execute.\r
-\r
-.. _Call_Activity: https://docs.camunda.org/manual/7.7/reference/bpmn20/subprocesses/call-activity/\r
-\r
-**Input and Output variable mapping**\r
-\r
- In the modeler, you can specify a list of "In Mappings". With this, you can map execution variables from the calling flow to the subprocess. The subprocess always has its own copy of each variable. To transfer values back to the calling flow, you specify "Out Mappings".\r
-\r
-**May throw MSOWorkflowException**\r
-\r
- The current best practice for reporting errors from subprocess is described here:\r
- \r
- * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.\r
- * The WorkflowException object contains an error code and an error message.\r
- * The subprocess should then throw an MSOWorkflowException BPMN event which may be handled by the calling flow.\r
- \r
-Example: VnfAdapterRestV1.bpmn\r
--------------------------------\r
-\r
-.. image:: images/BPMN_Subprocess_process_flows_1.png\r
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Subprocess Process Flows
+==============================
+
+Characteristics
+----------------
+
+**Invoked by other flows**
+
+ A BPMN Call_Activity_ provides the mechanism to invoke subprocess flows. The Called Element attribute of the Call Activity specifies the name of the subprocess to execute.
+
+.. _Call_Activity: https://docs.camunda.org/manual/7.7/reference/bpmn20/subprocesses/call-activity/
+
+**Input and Output variable mapping**
+
+ In the modeler, you can specify a list of "In Mappings". With this, you can map execution variables from the calling flow to the subprocess. The subprocess always has its own copy of each variable. To transfer values back to the calling flow, you specify "Out Mappings".
+
+**May throw MSOWorkflowException**
+
+ The current best practice for reporting errors from subprocess is described here:
+
+ * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.
+ * The WorkflowException object contains an error code and an error message.
+ * The subprocess should then throw an MSOWorkflowException BPMN event which may be handled by the calling flow.
+
+Example: VnfAdapterRestV1.bpmn
+-------------------------------
+
+.. image:: images/BPMN_Subprocess_process_flows_1.png
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-Camunda Modeler\r
-=================\r
-\r
-The Camunda_Modeler_ is the editor for BPMN 2.0 process flows. It is a standalone application. NOTE: the Camunda eclipse plugin is no longer supported and should not be used.\r
-\r
-.. _Camunda_Modeler: https://docs.camunda.org/manual/latest/modeler/camunda-modeler/\r
-\r
-.. image:: images/camunda_modeler_1.png\r
-\r
-Modeler Templates\r
-------------------\r
-\r
-Some work has already been done in MSO to develop templates_ for "building block" subprocess flows. When a template is provided for a BPMN element, the modeler displays a custom form for inputting parameters. This significantly simplifies flow construction and reduces the chance of making mistakes.\r
-\r
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Camunda Modeler
+=================
+
+The Camunda_Modeler_ is the editor for BPMN 2.0 process flows. It is a standalone application. NOTE: the Camunda eclipse plugin is no longer supported and should not be used.
+
+.. _Camunda_Modeler: https://docs.camunda.org/manual/latest/modeler/camunda-modeler/
+
+.. image:: images/camunda_modeler_1.png
+
+Modeler Templates
+------------------
+
+Some work has already been done in MSO to develop templates_ for "building block" subprocess flows. When a template is provided for a BPMN element, the modeler displays a custom form for inputting parameters. This significantly simplifies flow construction and reduces the chance of making mistakes.
+
.. _templates: https://docs.camunda.org/manual/7.7/modeler/camunda-modeler/element-templates/
\ No newline at end of file
.. toctree::\r
:maxdepth: 1\r
\r
- Install_Configure_SO.rst\r
- architecture.rst\r
+ installconfigure/Install_Configure_SO.rst\r
+ architecture/architecture.rst\r
offered_consumed_apis.rst\r
developer_information.rst\r
release-notes.rst
\ No newline at end of file
.. toctree::\r
:maxdepth: 1\r
\r
- SO_Interface.rst\r
+ api/SO_Interface.rst\r
name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level"
level="WARN" />
+ <logger name="db.migration" level="DEBUG" />
<logger name="org.apache.wire" level="DEBUG" />
<logger name="org.onap" level="DEBUG" />
<logger name="com.att.ecomp" level="DEBUG" />
<appender-ref ref="asyncError" />
</root>
-</configuration>
\ No newline at end of file
+</configuration>