summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
authorTomasz Golabek <tomasz.golabek@nokia.com>2019-03-26 16:36:22 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-04-08 10:52:41 +0000
commit06e8b70cb9cdbcc131a183f3a85a95b513d2b2f1 (patch)
tree486f741f09fa4c647fafcc8fa019efb150a96392 /catalog-be/src/main/java
parent8df11d420ff91a668960150ebc408e0c0733ce86 (diff)
Yaml parser exposed via SDC endpoint
GAB parser exposed as POST /v1/catalog/gab/searchFor endpoint. Introduced OWASP ESAPI initial configuration Change-Id: I2ee575b6092a97bc6acb1a5378bc66321e9fb182 Issue-ID: SDC-2209 Signed-off-by: Tomasz Golabek <tomasz.golabek@nokia.com>
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GenericArtifactBrowserBusinessLogic.java80
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/info/GenericArtifactQueryInfo.java63
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java4
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java93
4 files changed, 240 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GenericArtifactBrowserBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GenericArtifactBrowserBusinessLogic.java
new file mode 100644
index 0000000000..fed1eb7fe9
--- /dev/null
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/GenericArtifactBrowserBusinessLogic.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.be.components.impl;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import org.onap.sdc.gab.GABService;
+import org.onap.sdc.gab.GABServiceImpl;
+import org.onap.sdc.gab.model.GABQuery;
+import org.onap.sdc.gab.model.GABResult;
+import org.onap.sdc.gab.model.GABResults;
+
+@org.springframework.stereotype.Component
+public class GenericArtifactBrowserBusinessLogic extends BaseBusinessLogic {
+
+ private GABService gabService;
+
+ public GenericArtifactBrowserBusinessLogic() {
+ gabService = new GABServiceImpl();
+ }
+
+ public String searchFor(GABQuery gabQuery) throws IOException {
+ GABResults gabResults = gabService.searchFor(gabQuery);
+ return createGsonForGABResult().toJson(gabResults);
+ }
+
+ private Gson createGsonForGABResult(){
+ return new GsonBuilder().setPrettyPrinting()
+ .registerTypeAdapter(GABResult.class, new GABResultSerializer())
+ .registerTypeAdapter(GABResults.class, new GABResultsSerializer())
+ .create();
+ }
+
+ private class GABResultsSerializer implements JsonSerializer<GABResults> {
+ @Override
+ public JsonElement serialize(GABResults gabResults, Type type,
+ JsonSerializationContext jsonSerializationContext) {
+ JsonObject result = new JsonObject();
+ JsonArray jsonArray = new JsonArray();
+ gabResults.getRows().stream().map(jsonSerializationContext::serialize).forEach(jsonArray::add);
+ result.add("data", jsonArray);
+ return result;
+ }
+ }
+
+ private class GABResultSerializer implements JsonSerializer<GABResult> {
+ @Override
+ public JsonElement serialize(GABResult gabResult, Type type, JsonSerializationContext jsonSerializationContext) {
+ JsonObject result = new JsonObject();
+ gabResult.getEntries().forEach(entry -> result.addProperty(entry.getPath(), String.valueOf(entry.getData())));
+ return result;
+ }
+ }
+
+}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/info/GenericArtifactQueryInfo.java b/catalog-be/src/main/java/org/openecomp/sdc/be/info/GenericArtifactQueryInfo.java
new file mode 100644
index 0000000000..66a85d7ccd
--- /dev/null
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/info/GenericArtifactQueryInfo.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.be.info;
+
+import java.util.Set;
+
+public class GenericArtifactQueryInfo {
+
+ private Set<String> fields;
+ private String parentId;
+ private String artifactUniqueId;
+
+ public GenericArtifactQueryInfo() {
+ }
+
+ public GenericArtifactQueryInfo(Set<String> fields, String parentId, String artifactUniqueId) {
+ this.fields = fields;
+ this.parentId = parentId;
+ this.artifactUniqueId = artifactUniqueId;
+ }
+
+ public void setFields(Set<String> fields) {
+ this.fields = fields;
+ }
+
+ public void setParentId(String parentId) {
+ this.parentId = parentId;
+ }
+
+ public void setArtifactUniqueId(String artifactUniqueId) {
+ this.artifactUniqueId = artifactUniqueId;
+ }
+
+ public Set<String> getFields() {
+ return fields;
+ }
+
+ public String getParentId() {
+ return parentId;
+ }
+
+ public String getArtifactUniqueId() {
+ return artifactUniqueId;
+ }
+}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java
index d27db55158..94431f6b48 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/BeGenericServlet.java
@@ -140,6 +140,10 @@ public class BeGenericServlet extends BasicServlet {
return getClassFromWebAppContext(context, () -> UserBusinessLogic.class);
}
+ protected GenericArtifactBrowserBusinessLogic getGenericArtifactBrowserBL(ServletContext context) {
+ return getClassFromWebAppContext(context, () -> GenericArtifactBrowserBusinessLogic.class);
+ }
+
protected ResourceBusinessLogic getResourceBL(ServletContext context) {
return getClassFromWebAppContext(context, () -> ResourceBusinessLogic.class);
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java
new file mode 100644
index 0000000000..ea00a86ad9
--- /dev/null
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/GenericArtifactBrowserServlet.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.be.servlets;
+
+import com.jcabi.aspects.Loggable;
+import fj.data.Either;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import java.io.IOException;
+import java.util.Set;
+import java.util.stream.Collectors;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.onap.sdc.gab.model.GABQuery;
+import org.onap.sdc.gab.model.GABQuery.GABQueryType;
+import org.openecomp.sdc.be.info.GenericArtifactQueryInfo;
+import org.openecomp.sdc.common.log.wrappers.Logger;
+import org.openecomp.sdc.exception.ResponseFormat;
+import org.owasp.esapi.ESAPI;
+import org.springframework.stereotype.Controller;
+
+@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
+@Path("/v1/catalog/gab")
+@Consumes(MediaType.APPLICATION_JSON)
+@Produces(MediaType.APPLICATION_JSON)
+@Api(value = "Generic Artifact Browser")
+@Controller
+public class GenericArtifactBrowserServlet extends BeGenericServlet {
+
+ private static final Logger LOGGER = Logger.getLogger(GenericArtifactBrowserServlet.class);
+
+ @POST
+ @Path("/searchFor")
+ @ApiOperation(value = "Search json paths inside the yaml", httpMethod = "POST", notes = "Returns found entries of json paths", response = Response.class)
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Returned yaml entries"),
+ @ApiResponse(code = 400, message = "Invalid content / Missing content")})
+ public Response searchFor(
+ @ApiParam(value = "Generic Artifact search model", required = true) GenericArtifactQueryInfo query,
+ @Context final HttpServletRequest request) {
+ try {
+ ServletContext context = request.getSession().getServletContext();
+ Either<ImmutablePair<String, byte[]>, ResponseFormat> immutablePairResponseFormatEither = getArtifactBL(context)
+ .downloadArtifact(ESAPI.encoder().canonicalize(query.getParentId()), ESAPI.encoder().canonicalize(query.getArtifactUniqueId()));
+ if (immutablePairResponseFormatEither.isLeft()){
+ GABQuery gabQuery = prepareGabQuery(query, immutablePairResponseFormatEither);
+ return buildOkResponse(getGenericArtifactBrowserBL(context).searchFor(gabQuery));
+ }else{
+ throw new IOException(immutablePairResponseFormatEither.right().value().getFormattedMessage());
+ }
+ } catch (IOException e) {
+ LOGGER.error("Cannot search for a given queries in the yaml file", e);
+ return buildGeneralErrorResponse();
+ }
+ }
+
+ private GABQuery prepareGabQuery(GenericArtifactQueryInfo query,
+ Either<ImmutablePair<String, byte[]>, ResponseFormat> immutablePairResponseFormatEither) {
+ byte[] content = immutablePairResponseFormatEither.left().value().getRight();
+ Set<String> queryFields = query.getFields().stream().map(ESAPI.encoder()::canonicalize).collect(Collectors.toSet());
+ return new GABQuery(queryFields, new String(content), GABQueryType.CONTENT);
+ }
+
+}
kflowException', execution, 2500, "Volume group $DCVFMODVOLV2_volumeGroupName already exists in the system.", isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_7" name="" sourceRef="ScriptTask_createVolGrpExistsException" targetRef="EndEvent_6" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_aaiReturnCode404" name="AAI Return Code is 404?" default="SequenceFlow_volGrpName404No"> <bpmn2:incoming>SequenceFlow_19</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_volGrpName404Yes</bpmn2:outgoing> <bpmn2:outgoing>SequenceFlow_volGrpName404No</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_volGrpName404Yes" name="Yes" sourceRef="ExclusiveGateway_aaiReturnCode404" targetRef="ScriptTask_callRestAaiCreateVolumeGrp"> <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{DCVFMODVOLV2_AaiReturnCode == '404'}]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_volGrpName404No" name="No" sourceRef="ExclusiveGateway_aaiReturnCode404" targetRef="ScriptTask_createVolGrpExistsException" /> <bpmn2:scriptTask id="ScriptTask_callRestAaiQueryGenericVnf" name="Call REST AAI Query Generic VNF" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIGenericVnf', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="ScriptTask_callRestAaiQueryGenericVnf" targetRef="ScriptTask_callRestAaiQueryVolGrpName" /> <bpmn2:boundaryEvent id="BoundaryEvent_catchAaiError" name="" attachedToRef="ScriptTask_callRestAaiQueryVolGrpName"> <bpmn2:outgoing>SequenceFlow_19</bpmn2:outgoing> <bpmn2:errorEventDefinition id="ErrorEventDefinition_3" errorRef="Error_1" /> </bpmn2:boundaryEvent> <bpmn2:sequenceFlow id="SequenceFlow_19" name="" sourceRef="BoundaryEvent_catchAaiError" targetRef="ExclusiveGateway_aaiReturnCode404" /> <bpmn2:scriptTask id="ScriptTask_callRestAaiQueryVolGrpName" name="Call REST AAI Query Volume Grp Name" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="ScriptTask_callRestAaiQueryVolGrpName" targetRef="ExclusiveGateway_aaiReturnCode404" /> <bpmn2:scriptTask id="ScriptTask_callRestAaiCreateVolumeGrp" name="Call REST AAI Create Volume Group" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_volGrpName404Yes</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('callRESTCreateAAIVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="ScriptTask_callRestAaiCreateVolumeGrp" targetRef="ScriptTask_prepareVnfAdapterCreate" /> <bpmn2:callActivity id="CallActivity_callVnfAdapterCreate" name="Call VNF Adapter Create" calledElement="vnfAdapterRestV1"> <bpmn2:extensionElements> <camunda:in source="DCVFMODVOLV2_createVnfARequest" target="vnfAdapterRestV1Request" /> <camunda:in source="msoRequestId" target="mso-request-id" /> <camunda:in source="serviceInstanceId" target="mso-service-instance-id" /> <camunda:out source="vnfAdapterRestV1Response" target="DCVFMODVOLV2_createVnfAResponse" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:out source="VNFREST_vnfAdapterStatusCode" target="DCVFMODVOLV2_createVnfAReturnCode" /> <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> <camunda:out source="VNFREST_SuccessIndicator" target="VNFREST_SuccessIndicator" /> </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1qwurc5</bpmn2:outgoing> </bpmn2:callActivity> <bpmn2:scriptTask id="ScriptTask_callRestAaiRequeryVolGrpNm" name="Call REST AAI Requery Volume Group Name" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1gbt2n5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_28</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_28" name="" sourceRef="ScriptTask_callRestAaiRequeryVolGrpNm" targetRef="ScriptTask_callRestAaiVolumeGrp" /> <bpmn2:scriptTask id="ScriptTask_prepareDbInfraRequest" name="Set Success Indicator" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('setSuccessIndicator', execution, true)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_8" name="" sourceRef="ScriptTask_prepareDbInfraRequest" targetRef="EndEvent_1" /> <bpmn2:scriptTask id="ScriptTask_callRestAaiVolumeGrp" name="Call REST AAI Update Volume Group" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_28</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('callRESTUpdateCreatedVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="ScriptTask_callRestAaiVolumeGrp" targetRef="ScriptTask_prepareDbInfraRequest" /> <bpmn2:endEvent id="EndEvent_1" name="End"> <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming> </bpmn2:endEvent> <bpmn2:scriptTask id="ScriptTask_prepareVnfAdapterCreate" name="Prepare VNF Adapter Create Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('prepareVnfAdapterCreateRequest', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_10" name="" sourceRef="ScriptTask_prepareVnfAdapterCreate" targetRef="CallActivity_callVnfAdapterCreate" /> <bpmn2:startEvent id="StartEvent_doCreateVfModuleVolume" name="Start"> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> </bpmn2:startEvent> <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_doCreateVfModuleVolume" targetRef="ScriptTask_preProcessRequest" /> <bpmn2:endEvent id="EndEvent_6" name="End"> <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming> </bpmn2:endEvent> <bpmn2:scriptTask id="Task_07psich" name="Validate VNF Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1qwurc5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1gbt2n5</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('validateVnfResponse', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1qwurc5" sourceRef="CallActivity_callVnfAdapterCreate" targetRef="Task_07psich" /> <bpmn2:sequenceFlow id="SequenceFlow_1gbt2n5" sourceRef="Task_07psich" targetRef="ScriptTask_callRestAaiRequeryVolGrpNm" /> <bpmn2:callActivity id="Task_1u766ge" name="Call Generic Get Service instance" calledElement="GenericGetService"> <bpmn2:extensionElements> <camunda:in source="serviceInstanceId" target="GENGS_serviceInstanceId" /> <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> <camunda:in source="GENGS_type" target="GENGS_type" /> <camunda:out source="GENGS_FoundIndicator" target="GENGS_FoundIndicator" /> <camunda:out source="GENGS_SuccessIndicator" target="GENGS_SuccessIndicator" /> </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_1wi1cf9</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1vmbvy8</bpmn2:outgoing> </bpmn2:callActivity> <bpmn2:scriptTask id="Task_0qbm5cz" name="Validate Get Service Instance Call" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1vmbvy8</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1dpt7ul</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() doCreateVfModuleVolumeV2.executeMethod('validateGetServiceInstanceCall', execution, isDebugLogEnabled)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1wi1cf9" sourceRef="ScriptTask_preProcessRequest" targetRef="Task_1u766ge" /> <bpmn2:sequenceFlow id="SequenceFlow_1vmbvy8" sourceRef="Task_1u766ge" targetRef="Task_0qbm5cz" /> <bpmn2:sequenceFlow id="SequenceFlow_1dpt7ul" sourceRef="Task_0qbm5cz" targetRef="ScriptTask_callRestAaiCloudRegion" /> </bpmn2:process> <bpmn2:error id="Error_1" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateVfModuleVolumeV2"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_65" bpmnElement="StartEvent_doCreateVfModuleVolume"> <dc:Bounds x="270" y="128" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="276" y="169" width="23" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_285" bpmnElement="ScriptTask_preProcessRequest"> <dc:Bounds x="369" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_287" bpmnElement="ScriptTask_callRestAaiCloudRegion"> <dc:Bounds x="768" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_288" bpmnElement="ScriptTask_callRestAaiQueryVolGrpName"> <dc:Bounds x="1045" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_247" bpmnElement="ExclusiveGateway_aaiReturnCode404" isMarkerVisible="true"> <dc:Bounds x="1242" y="121" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="1224" y="176" width="85" height="24" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_289" bpmnElement="ScriptTask_callRestAaiCreateVolumeGrp"> <dc:Bounds x="256" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_290" bpmnElement="ScriptTask_prepareVnfAdapterCreate"> <dc:Bounds x="420" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_32" bpmnElement="CallActivity_callVnfAdapterCreate"> <dc:Bounds x="576" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_292" bpmnElement="ScriptTask_callRestAaiRequeryVolGrpNm"> <dc:Bounds x="857" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_293" bpmnElement="ScriptTask_callRestAaiVolumeGrp"> <dc:Bounds x="995" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_294" bpmnElement="ScriptTask_prepareDbInfraRequest"> <dc:Bounds x="1142" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_226" bpmnElement="EndEvent_1"> <dc:Bounds x="1283" y="328" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1292" y="369" width="19" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_65" targetElement="_BPMNShape_ScriptTask_285"> <di:waypoint xsi:type="dc:Point" x="306" y="146" /> <di:waypoint xsi:type="dc:Point" x="369" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="338" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_volGrpName404Yes" sourceElement="_BPMNShape_ExclusiveGateway_247" targetElement="_BPMNShape_ScriptTask_289"> <di:waypoint xsi:type="dc:Point" x="1267" y="171" /> <di:waypoint xsi:type="dc:Point" x="1267" y="232" /> <di:waypoint xsi:type="dc:Point" x="811" y="232" /> <di:waypoint xsi:type="dc:Point" x="306" y="232" /> <di:waypoint xsi:type="dc:Point" x="306" y="307" /> <bpmndi:BPMNLabel> <dc:Bounds x="582" y="232" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_ScriptTask_289" targetElement="_BPMNShape_ScriptTask_290"> <di:waypoint xsi:type="dc:Point" x="356" y="347" /> <di:waypoint xsi:type="dc:Point" x="420" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="388" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ScriptTask_290" targetElement="_BPMNShape_CallActivity_32"> <di:waypoint xsi:type="dc:Point" x="520" y="347" /> <di:waypoint xsi:type="dc:Point" x="576" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="548" y="455" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ScriptTask_287" targetElement="_BPMNShape_ScriptTask_311"> <di:waypoint xsi:type="dc:Point" x="868" y="146" /> <di:waypoint xsi:type="dc:Point" x="911" y="147" /> <bpmndi:BPMNLabel> <dc:Bounds x="890" y="132" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_296" bpmnElement="ScriptTask_createVolGrpExistsException"> <dc:Bounds x="1355" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_ScriptTask_296" targetElement="_BPMNShape_EndEvent_241"> <di:waypoint xsi:type="dc:Point" x="1455" y="146" /> <di:waypoint xsi:type="dc:Point" x="1493" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="1474" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_BoundaryEvent_62" targetElement="_BPMNShape_ExclusiveGateway_247"> <di:waypoint xsi:type="dc:Point" x="1145" y="88" /> <di:waypoint xsi:type="dc:Point" x="1145" y="59" /> <di:waypoint xsi:type="dc:Point" x="1267" y="59" /> <di:waypoint xsi:type="dc:Point" x="1267" y="121" /> <bpmndi:BPMNLabel> <dc:Bounds x="1206" y="44" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_volGrpName404No" sourceElement="_BPMNShape_ExclusiveGateway_247" targetElement="_BPMNShape_ScriptTask_296"> <di:waypoint xsi:type="dc:Point" x="1292" y="146" /> <di:waypoint xsi:type="dc:Point" x="1355" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="1320" y="146" width="14" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_ScriptTask_292" targetElement="_BPMNShape_ScriptTask_293"> <di:waypoint xsi:type="dc:Point" x="957" y="347" /> <di:waypoint xsi:type="dc:Point" x="995" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="976" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_293" targetElement="_BPMNShape_ScriptTask_294"> <di:waypoint xsi:type="dc:Point" x="1095" y="347" /> <di:waypoint xsi:type="dc:Point" x="1142" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="1119" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ScriptTask_294" targetElement="_BPMNShape_EndEvent_226"> <di:waypoint xsi:type="dc:Point" x="1242" y="347" /> <di:waypoint xsi:type="dc:Point" x="1283" y="346" /> <bpmndi:BPMNLabel> <dc:Bounds x="1263" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_311" bpmnElement="ScriptTask_callRestAaiQueryGenericVnf"> <dc:Bounds x="911" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_311" targetElement="_BPMNShape_ScriptTask_288"> <di:waypoint xsi:type="dc:Point" x="1011" y="146" /> <di:waypoint xsi:type="dc:Point" x="1045" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="1028" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_62" bpmnElement="BoundaryEvent_catchAaiError"> <dc:Bounds x="1127" y="88" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1145" y="129" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_288" targetElement="_BPMNShape_ExclusiveGateway_247"> <di:waypoint xsi:type="dc:Point" x="1145" y="146" /> <di:waypoint xsi:type="dc:Point" x="1242" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="1194" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_241" bpmnElement="EndEvent_6"> <dc:Bounds x="1493" y="128" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1502" y="169" width="19" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_00lua86_di" bpmnElement="Task_07psich"> <dc:Bounds x="716" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1qwurc5_di" bpmnElement="SequenceFlow_1qwurc5"> <di:waypoint xsi:type="dc:Point" x="676" y="347" /> <di:waypoint xsi:type="dc:Point" x="716" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="696" y="322" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1gbt2n5_di" bpmnElement="SequenceFlow_1gbt2n5"> <di:waypoint xsi:type="dc:Point" x="816" y="347" /> <di:waypoint xsi:type="dc:Point" x="857" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="837" y="322" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1u596hd_di" bpmnElement="Task_1u766ge"> <dc:Bounds x="506" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1n9cmka_di" bpmnElement="Task_0qbm5cz"> <dc:Bounds x="640" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1wi1cf9_di" bpmnElement="SequenceFlow_1wi1cf9"> <di:waypoint xsi:type="dc:Point" x="469" y="146" /> <di:waypoint xsi:type="dc:Point" x="506" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="488" y="121" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1vmbvy8_di" bpmnElement="SequenceFlow_1vmbvy8"> <di:waypoint xsi:type="dc:Point" x="606" y="146" /> <di:waypoint xsi:type="dc:Point" x="640" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="623" y="121" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1dpt7ul_di" bpmnElement="SequenceFlow_1dpt7ul"> <di:waypoint xsi:type="dc:Point" x="740" y="146" /> <di:waypoint xsi:type="dc:Point" x="768" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="754" y="121" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions>