aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java20
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java13
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java27
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java27
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java48
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java73
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java21
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java3
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListener.java30
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListenerPlugin.java24
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java12
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignNetworkBB.bpmn185
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn41
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WaitForPnfReadyBB.bpmn90
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java105
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java30
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAINetworkResources.java20
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java39
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java32
21 files changed, 694 insertions, 165 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java
index 6b3ad1d528..554e987fc8 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/L3Network.java
@@ -100,6 +100,10 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> {
private List<AggregateRoute> aggregateRoutes = new ArrayList<>();
@JsonProperty("vpn-binding")
private List<VpnBinding> vpnBindings = new ArrayList<>();
+ @JsonProperty("line-of-business")
+ private LineOfBusiness lineOfBusiness;
+ @JsonProperty("platform")
+ private Platform platform;
public ModelInfoNetwork getModelInfoNetwork() {
return modelInfoNetwork;
@@ -313,6 +317,22 @@ public class L3Network implements Serializable, ShallowCopy<L3Network> {
return vpnBindings;
}
+ public LineOfBusiness getLineOfBusiness() {
+ return lineOfBusiness;
+ }
+
+ public void setLineOfBusiness(LineOfBusiness lineOfBusiness) {
+ this.lineOfBusiness = lineOfBusiness;
+ }
+
+ public Platform getPlatform() {
+ return platform;
+ }
+
+ public void setPlatform(Platform platform) {
+ this.platform = platform;
+ }
+
@Override
public boolean equals(final Object other) {
if (!(other instanceof L3Network)) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java
index 772c61e48b..1953ba410b 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java
@@ -24,6 +24,7 @@ import java.io.Serializable;
import javax.persistence.Id;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
@@ -41,7 +42,7 @@ public class Pnf implements Serializable, ShallowCopy<Pnf> {
@JsonProperty("pnf-name")
private String pnfName;
- @JsonProperty("role")
+ @JsonProperty("nf-role")
private String role;
@JsonProperty("orchestration-status")
@@ -50,6 +51,8 @@ public class Pnf implements Serializable, ShallowCopy<Pnf> {
@JsonProperty("cloud-region")
private CloudRegion cloudRegion;
+ @JsonProperty("model-info-pnf")
+ private ModelInfoPnf modelInfoPnf;
public String getPnfId() {
return pnfId;
@@ -97,6 +100,14 @@ public class Pnf implements Serializable, ShallowCopy<Pnf> {
this.cloudRegion = cloudRegion;
}
+ public ModelInfoPnf getModelInfoPnf() {
+ return modelInfoPnf;
+ }
+
+ public void setModelInfoPnf(ModelInfoPnf modelInfoPnf) {
+ this.modelInfoPnf = modelInfoPnf;
+ }
+
@Override
public boolean equals(final Object other) {
if (!(other instanceof Pnf)) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java
new file mode 100644
index 0000000000..a01fa9698b
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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.onap.so.bpmn.servicedecomposition.modelinfo;
+
+import java.io.Serializable;
+
+public class ModelInfoPnf extends ModelInfoMetadata implements Serializable {
+ private static final long serialVersionUID = 50687109134317615L;
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index a4793476e4..e7e51bba77 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Modifications Copyright (c) 2019 Nokia
+ * Modifications Copyright (c) 2020 Nokia
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -815,13 +815,6 @@ public class BBInputSetup implements JavaDelegate {
}
}
- private void populatePnf(Pnfs pnf, String pnfId, ServiceInstance serviceInstance) {
- Pnf genericPnf = new Pnf();
- genericPnf.setPnfId(pnfId);
- genericPnf.setPnfName(pnf.getInstanceName());
- serviceInstance.getPnfs().add(genericPnf);
- }
-
protected boolean instanceGroupInList(GenericVnf vnf, String instanceGroupId) {
for (InstanceGroup instanceGroup : vnf.getInstanceGroups()) {
if (instanceGroup.getId() != null && instanceGroup.getId().equalsIgnoreCase(instanceGroupId)) {
@@ -915,7 +908,7 @@ public class BBInputSetup implements JavaDelegate {
if (network == null && (parameter.getBbName().equalsIgnoreCase(AssignFlows.NETWORK_A_LA_CARTE.toString())
|| parameter.getBbName().equalsIgnoreCase(AssignFlows.NETWORK_MACRO.toString()))) {
network = createNetwork(parameter.getLookupKeyMap(), parameter.getInstanceName(), parameter.getResourceId(),
- parameter.getInstanceParams());
+ parameter.getInstanceParams(), parameter);
parameter.getServiceInstance().getNetworks().add(network);
}
if (network != null) {
@@ -924,12 +917,20 @@ public class BBInputSetup implements JavaDelegate {
}
protected L3Network createNetwork(Map<ResourceKey, String> lookupKeyMap, String instanceName, String networkId,
- List<Map<String, String>> instanceParams) {
+ List<Map<String, String>> instanceParams, BBInputSetupParameter parameter) {
lookupKeyMap.put(ResourceKey.NETWORK_ID, networkId);
L3Network network = new L3Network();
network.setNetworkId(networkId);
network.setNetworkName(instanceName);
network.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
+ if (parameter != null) {
+ if (parameter.getLineOfBusiness() != null) {
+ network.setLineOfBusiness(this.mapperLayer.mapRequestLineOfBusiness(parameter.getLineOfBusiness()));
+ }
+ if (parameter.getLineOfBusiness() != null) {
+ network.setPlatform(this.mapperLayer.mapRequestPlatform(parameter.getPlatform()));
+ }
+ }
if (instanceParams != null) {
for (Map<String, String> params : instanceParams) {
network.getCloudParams().putAll(params);
@@ -1284,7 +1285,7 @@ public class BBInputSetup implements JavaDelegate {
if (collectionNetworkResourceCust != null) {
if ((bbName.equalsIgnoreCase(AssignFlows.NETWORK_A_LA_CARTE.toString())
|| bbName.equalsIgnoreCase(AssignFlows.NETWORK_MACRO.toString()))) {
- L3Network network = createNetwork(lookupKeyMap, null, networkId, null);
+ L3Network network = createNetwork(lookupKeyMap, null, networkId, null, null);
serviceInstance.getNetworks().add(network);
return network;
} else {
@@ -1495,8 +1496,8 @@ public class BBInputSetup implements JavaDelegate {
} else if (bbName.contains(PNF)) {
String pnfId = lookupKeyMap.get(ResourceKey.PNF);
resources.getPnfs().stream()
- .filter(pnf -> Objects.equals(key, pnf.getModelInfo().getModelCustomizationId())).findFirst()
- .ifPresent(pnf -> this.populatePnf(pnf, pnfId, serviceInstance));
+ .filter(pnfs -> Objects.equals(key, pnfs.getModelInfo().getModelCustomizationId())).findFirst()
+ .ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance));
} else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP)) {
Pair<Vnfs, VfModules> vnfsAndVfModules = getVfModulesAndItsVnfsByKey(key, resources);
if (vnfsAndVfModules != null) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java
new file mode 100644
index 0000000000..68161a8dd5
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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.onap.so.bpmn.servicedecomposition.tasks;
+
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
+import org.onap.so.db.catalog.beans.OrchestrationStatus;
+import org.onap.so.serviceinstancebeans.Pnfs;
+
+final class BBInputSetupPnf {
+
+ private BBInputSetupPnf() {
+ throw new IllegalStateException("Utility class");
+ }
+
+ static void populatePnfToServiceInstance(Pnfs pnfs, String pnfId, ServiceInstance serviceInstance) {
+ Pnf pnf = new Pnf();
+ pnf.setPnfId(pnfId);
+ pnf.setPnfName(pnfs.getInstanceName());
+ pnf.setModelInfoPnf(new ModelInfoPnf());
+ pnf.getModelInfoPnf().setModelCustomizationUuid(pnfs.getModelInfo().getModelCustomizationId());
+ pnf.getModelInfoPnf().setModelInvariantUuid(pnfs.getModelInfo().getModelInvariantId());
+ pnf.getModelInfoPnf().setModelUuid(pnfs.getModelInfo().getModelVersionId());
+ pnf.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
+
+ serviceInstance.getPnfs().add(pnf);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java
new file mode 100644
index 0000000000..aa9943b9b1
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 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.onap.so.bpmn.servicedecomposition.tasks;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.db.catalog.beans.OrchestrationStatus;
+import org.onap.so.serviceinstancebeans.ModelInfo;
+import org.onap.so.serviceinstancebeans.Pnfs;
+import static org.mockito.Mockito.doReturn;
+
+@RunWith(MockitoJUnitRunner.class)
+public class BBInputSetupPnfTest {
+
+ @Mock
+ private Pnfs pnfs;
+
+ @Mock
+ private ModelInfo modelInfo;
+
+ @Test
+ public void populatePnfShouldSetRequiredFields() {
+ final String pnfId = "PNF_id1";
+ final String pnfName = "PNF_name1";
+ final String modelCustomizationId = "8421fe03-fd1b-4bf7-845a-c3fe91edb031";
+ final String modelInvariantId = "3360a2a5-22ff-44c7-8935-08c8e5ecbd06";
+ final String modelVersionId = "b80c3a52-abd4-436c-a22e-9c5da768781a";
+
+ doReturn(modelCustomizationId).when(modelInfo).getModelCustomizationId();
+ doReturn(modelInvariantId).when(modelInfo).getModelInvariantId();
+ doReturn(modelVersionId).when(modelInfo).getModelVersionId();
+ doReturn(pnfName).when(pnfs).getInstanceName();
+ doReturn(modelInfo).when(pnfs).getModelInfo();
+
+ ServiceInstance serviceInstance = new ServiceInstance();
+ BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance);
+
+ assertEquals(1, serviceInstance.getPnfs().size());
+
+ Pnf pnf = serviceInstance.getPnfs().get(0);
+
+ assertEquals(pnfId, pnf.getPnfId());
+ assertEquals(pnfName, pnf.getPnfName());
+ assertEquals(modelCustomizationId, pnf.getModelInfoPnf().getModelCustomizationUuid());
+ assertEquals(modelInvariantId, pnf.getModelInfoPnf().getModelInvariantUuid());
+ assertEquals(modelVersionId, pnf.getModelInfoPnf().getModelUuid());
+ assertEquals(OrchestrationStatus.PRECREATED, pnf.getOrchestrationStatus());
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
index a45e803cf0..1acf4edb4a 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
@@ -1262,7 +1262,7 @@ public class BBInputSetupTest {
verify(SPY_bbInputSetup, times(1)).mapCatalogNetwork(network, modelInfo, service);
instanceName = "networkName2";
- L3Network network2 = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, resourceId, null);
+ L3Network network2 = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, resourceId, null, parameter);
SPY_bbInputSetup.populateL3Network(parameter);
verify(SPY_bbInputSetup, times(2)).mapCatalogNetwork(network2, modelInfo, service);
}
@@ -2832,17 +2832,32 @@ public class BBInputSetupTest {
expected.setNetworkId(networkId);
expected.setNetworkName(instanceName);
expected.setCloudParams(cloudParams);
+ Platform platform = new Platform();
+ platform.setPlatformName("platformName");
+ expected.setPlatform(platform);
+ LineOfBusiness lineOfBusiness = new LineOfBusiness();
+ lineOfBusiness.setLineOfBusinessName("lineOfBusiness");
+ expected.setLineOfBusiness(lineOfBusiness);
expected.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
List<Map<String, String>> instanceParams = new ArrayList<>();
instanceParams.add(cloudParams);
- L3Network actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, instanceParams);
+ org.onap.so.serviceinstancebeans.Platform platformRequest = new org.onap.so.serviceinstancebeans.Platform();
+ org.onap.so.serviceinstancebeans.LineOfBusiness lineOfBusinessRequest =
+ new org.onap.so.serviceinstancebeans.LineOfBusiness();
+ lineOfBusinessRequest.setLineOfBusinessName("lineOfBusiness");
+ platformRequest.setPlatformName("platformName");
+ BBInputSetupParameter parameter = new BBInputSetupParameter.Builder().setRequestId(REQUEST_ID)
+ .setPlatform(platformRequest).setLineOfBusiness(lineOfBusinessRequest).build();
+ L3Network actual =
+ SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, instanceParams, parameter);
assertThat(actual, sameBeanAs(expected));
assertEquals("LookupKeyMap is populated", networkId, lookupKeyMap.get(ResourceKey.NETWORK_ID));
expected.getCloudParams().clear();
- actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, null);
+
+ actual = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, networkId, null, parameter);
assertThat(actual, sameBeanAs(expected));
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
index 70365b744c..25f7c4b93f 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
@@ -75,9 +75,8 @@ public class WorkflowProcessor extends ProcessEngineAwareService {
}
}
- // Note: the business key is used to identify the process in unit tests
protected static String getBusinessKey(Map<String, Object> inputVariables) {
- return getOrCreate(inputVariables, "mso-business-key");
+ return getOrCreate(inputVariables, "mso-request-id");
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListener.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListener.java
new file mode 100644
index 0000000000..80d86ad009
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListener.java
@@ -0,0 +1,30 @@
+package org.onap.so.bpmn.core.plugins;
+
+import org.camunda.bpm.engine.impl.bpmn.behavior.CallableElementActivityBehavior;
+import org.camunda.bpm.engine.impl.bpmn.parser.AbstractBpmnParseListener;
+import org.camunda.bpm.engine.impl.context.Context;
+import org.camunda.bpm.engine.impl.core.model.CallableElement;
+import org.camunda.bpm.engine.impl.el.ElValueProvider;
+import org.camunda.bpm.engine.impl.el.Expression;
+import org.camunda.bpm.engine.impl.el.ExpressionManager;
+import org.camunda.bpm.engine.impl.pvm.process.ActivityImpl;
+import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl;
+import org.camunda.bpm.engine.impl.util.xml.Element;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class CallActivityBusinessKeyParseListener extends AbstractBpmnParseListener {
+
+ @Override
+ public void parseCallActivity(Element callActivityElement, ScopeImpl scope, ActivityImpl activity) {
+ ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager();
+ Expression expression = expressionManager.createExpression("#{execution.processBusinessKey}");
+ ElValueProvider p = new ElValueProvider(expression);
+ CallableElementActivityBehavior callableElementActivityBehavior =
+ (CallableElementActivityBehavior) activity.getActivityBehavior();
+ CallableElement callableElement = (CallableElement) callableElementActivityBehavior.getCallableElement();
+ callableElement.setBusinessKeyValueProvider(p);
+ callableElementActivityBehavior.setCallableElement(callableElement);
+ }
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListenerPlugin.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListenerPlugin.java
new file mode 100644
index 0000000000..a2d897e367
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/CallActivityBusinessKeyParseListenerPlugin.java
@@ -0,0 +1,24 @@
+package org.onap.so.bpmn.core.plugins;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.camunda.bpm.engine.impl.bpmn.parser.BpmnParseListener;
+import org.camunda.bpm.engine.impl.cfg.AbstractProcessEnginePlugin;
+import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class CallActivityBusinessKeyParseListenerPlugin extends AbstractProcessEnginePlugin {
+
+ @Override
+ public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
+ List<BpmnParseListener> preParseListeners = processEngineConfiguration.getCustomPreBPMNParseListeners();
+ if (preParseListeners == null) {
+ preParseListeners = new ArrayList<>();
+ processEngineConfiguration.setCustomPreBPMNParseListeners(preParseListeners);
+ }
+ preParseListeners.add(new CallActivityBusinessKeyParseListener());
+ }
+
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java
index 93f98a34a6..0161422b64 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java
@@ -1534,6 +1534,18 @@ public abstract class WorkflowTest {
}
}
+ protected Object getVariableFromHistoryByProcessInstanceId(String processInstanceId, String variableName) {
+ try {
+ HistoricVariableInstance v = historyService.createHistoricVariableInstanceQuery()
+ .processInstanceId(processInstanceId).variableName(variableName).singleResult();
+ return v == null ? null : v.getValue();
+ } catch (Exception e) {
+ logger.debug("Error retrieving variable {} from historical process with processInstanceId {}: ",
+ variableName, processInstanceId, e);
+ return null;
+ }
+ }
+
/**
* Gets a variable value from a process instance based on businessKey and process name. Must be used when multiple
* instances exist with the same business key such as when business key is passed to subflows or shared across
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignNetworkBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignNetworkBB.bpmn
index 7c86e964ec..c48f8b4d10 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignNetworkBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignNetworkBB.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="AssignNetworkBB" name="AssignNetworkBB" isExecutable="true">
<bpmn2:startEvent id="AssignNetworkBB_start">
<bpmn2:outgoing>SequenceFlow_11op1ih</bpmn2:outgoing>
@@ -21,7 +21,7 @@
<bpmn2:outgoing>SequenceFlow_0988gld</bpmn2:outgoing>
</bpmn2:serviceTask>
<bpmn2:sequenceFlow id="SequenceFlow_017131q" name="Yes" sourceRef="networkFoundByName_ExclusiveGateway" targetRef="ExclusiveGateway_0vtj8n8">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{AssignNetwork.networkFoundByName(execution.getVariable("gBuildingBlockExecution")) == true}]]></bpmn2:conditionExpression>
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{AssignNetwork.networkFoundByName(execution.getVariable("gBuildingBlockExecution")) == true}</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_0gkr871" name="No" sourceRef="networkFoundByName_ExclusiveGateway" targetRef="ServiceTask_put_network_in_AAI" />
<bpmn2:endEvent id="AssignNetworkBB_end">
@@ -36,11 +36,11 @@
<bpmn2:incoming>SequenceFlow_0e08b9t</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0mxc4ri</bpmn2:outgoing>
</bpmn2:serviceTask>
- <bpmn2:sequenceFlow id="SequenceFlow_1ctpnpe" sourceRef="ServiceTask_put_network_in_AAI" targetRef="ServiceTask_connect_to_Tenant" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1ctpnpe" sourceRef="ServiceTask_put_network_in_AAI" targetRef="ExclusiveGateway_0g85lk7" />
<bpmn2:sequenceFlow id="SequenceFlow_0e08b9t" sourceRef="ServiceTask_connect_to_NCIG" targetRef="ServiceTask_connect_to_NCSI" />
<bpmn2:sequenceFlow id="SequenceFlow_0mxc4ri" sourceRef="ServiceTask_connect_to_NCSI" targetRef="ExclusiveGateway_0vtj8n8" />
<bpmn2:serviceTask id="ServiceTask_connect_to_Tenant" name="&#10;AAI&#10;Connect&#10;(tenant)&#10;" camunda:expression="${AAICreateTasks.connectNetworkToTenant(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn2:incoming>SequenceFlow_1ctpnpe</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_0lj5jj1</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0fwcvep</bpmn2:outgoing>
</bpmn2:serviceTask>
<bpmn2:serviceTask id="ServiceTask_connect_to_CloudRegion" name="&#10;AAI&#10;Connect&#10;(cloud region)&#10;" camunda:expression="${AAICreateTasks.connectNetworkToCloudRegion(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
@@ -54,11 +54,6 @@
<bpmn2:outgoing>SequenceFlow_017131q</bpmn2:outgoing>
<bpmn2:outgoing>SequenceFlow_0gkr871</bpmn2:outgoing>
</bpmn2:inclusiveGateway>
- <bpmn2:inclusiveGateway id="ExclusiveGateway_0vtj8n8">
- <bpmn2:incoming>SequenceFlow_017131q</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_0mxc4ri</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_0jm95hf</bpmn2:outgoing>
- </bpmn2:inclusiveGateway>
<bpmn2:sequenceFlow id="SequenceFlow_0jm95hf" sourceRef="ExclusiveGateway_0vtj8n8" targetRef="ServiceTask_get_cloud_region" />
<bpmn2:sequenceFlow id="SequenceFlow_16hhbw3" sourceRef="ServiceTask_get_cloud_region" targetRef="ServiceTask_assign_network_sdnc" />
<bpmn2:sequenceFlow id="SequenceFlow_0988gld" sourceRef="ServiceTask_assign_network_aai" targetRef="AssignNetworkBB_end" />
@@ -74,11 +69,36 @@
</bpmn2:callActivity>
<bpmn2:sequenceFlow id="SequenceFlow_0rt36co" sourceRef="ServiceTask_assign_network_sdnc" targetRef="CallActivity_sdncHandlerCall" />
<bpmn2:sequenceFlow id="SequenceFlow_1mvf7b9" sourceRef="CallActivity_sdncHandlerCall" targetRef="ServiceTask_assign_network_aai" />
- <bpmn2:textAnnotation id="TextAnnotation_0dnksb2"> <bpmn2:text>sets Cloud Region on BB execution for SDNC assign</bpmn2:text>
-</bpmn2:textAnnotation>
+ <bpmn2:serviceTask id="Task_0mu8391" name="Create Platform" camunda:expression="${AAICreateTasks.createPlatformForNetwork(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn2:incoming>SequenceFlow_1kslfgw</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0j7rpm9</bpmn2:outgoing>
+ </bpmn2:serviceTask>
+ <bpmn2:serviceTask id="ServiceTask_0e2crgd" name="Create Lob" camunda:expression="${AAICreateTasks.createLineOfBusinessForNetwork(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn2:incoming>SequenceFlow_0j7rpm9</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0ugp99e</bpmn2:outgoing>
+ </bpmn2:serviceTask>
+ <bpmn2:sequenceFlow id="SequenceFlow_0lj5jj1" sourceRef="ExclusiveGateway_0g85lk7" targetRef="ServiceTask_connect_to_Tenant" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1kslfgw" sourceRef="ExclusiveGateway_0g85lk7" targetRef="Task_0mu8391" />
+ <bpmn2:sequenceFlow id="SequenceFlow_0j7rpm9" sourceRef="Task_0mu8391" targetRef="ServiceTask_0e2crgd" />
+ <bpmn2:sequenceFlow id="SequenceFlow_0ugp99e" sourceRef="ServiceTask_0e2crgd" targetRef="ExclusiveGateway_0vtj8n8" />
+ <bpmn2:parallelGateway id="ExclusiveGateway_0g85lk7">
+ <bpmn2:incoming>SequenceFlow_1ctpnpe</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0lj5jj1</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_1kslfgw</bpmn2:outgoing>
+ </bpmn2:parallelGateway>
+ <bpmn2:inclusiveGateway id="ExclusiveGateway_0vtj8n8">
+ <bpmn2:incoming>SequenceFlow_017131q</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_0mxc4ri</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_0ugp99e</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0jm95hf</bpmn2:outgoing>
+ </bpmn2:inclusiveGateway>
+ <bpmn2:textAnnotation id="TextAnnotation_0dnksb2">
+ <bpmn2:text>sets Cloud Region on BB execution for SDNC assign</bpmn2:text>
+ </bpmn2:textAnnotation>
<bpmn2:association id="Association_1rsqd3z" sourceRef="ServiceTask_get_cloud_region" targetRef="TextAnnotation_0dnksb2" />
- <bpmn2:textAnnotation id="TextAnnotation_17jb2vn"> <bpmn2:text>conditionally executed if Network Collection Instance Group exists</bpmn2:text>
-</bpmn2:textAnnotation>
+ <bpmn2:textAnnotation id="TextAnnotation_17jb2vn">
+ <bpmn2:text>conditionally executed if Network Collection Instance Group exists</bpmn2:text>
+ </bpmn2:textAnnotation>
<bpmn2:association id="Association_15ppe1t" sourceRef="ServiceTask_connect_to_NCIG" targetRef="TextAnnotation_17jb2vn" />
</bpmn2:process>
<bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
@@ -86,165 +106,190 @@
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="AssignNetworkBB">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="AssignNetworkBB_start">
- <dc:Bounds x="746" y="-105" width="36" height="36" />
+ <dc:Bounds x="156" y="137" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="739" y="-64" width="50" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1wo7ke9_di" bpmnElement="ServiceTask_get_cloud_region">
- <dc:Bounds x="1632" y="-127" width="100" height="80" />
+ <dc:Bounds x="1042" y="115" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1ofnl0p_di" bpmnElement="ServiceTask_assign_network_sdnc">
- <dc:Bounds x="1769" y="-127" width="100" height="80" />
+ <dc:Bounds x="1179" y="115" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_0dnksb2_di" bpmnElement="TextAnnotation_0dnksb2">
- <dc:Bounds x="1576" y="35" width="212" height="30" />
+ <dc:Bounds x="986" y="242" width="212" height="30" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Association_1rsqd3z_di" bpmnElement="Association_1rsqd3z">
- <di:waypoint xsi:type="dc:Point" x="1682" y="-47" />
- <di:waypoint xsi:type="dc:Point" x="1682" y="35" />
+ <di:waypoint x="1092" y="195" />
+ <di:waypoint x="1092" y="242" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1dm3ngd_di" bpmnElement="ServiceTask_put_network_in_AAI">
- <dc:Bounds x="906" y="-49" width="100" height="80" />
+ <dc:Bounds x="316" y="193" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_18yks1p_di" bpmnElement="ServiceTask_assign_network_aai">
- <dc:Bounds x="2106" y="-127" width="100" height="80" />
+ <dc:Bounds x="1516" y="115" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_017131q_di" bpmnElement="SequenceFlow_017131q">
- <di:waypoint xsi:type="dc:Point" x="863" y="-112" />
- <di:waypoint xsi:type="dc:Point" x="863" y="-161" />
- <di:waypoint xsi:type="dc:Point" x="1562" y="-161" />
- <di:waypoint xsi:type="dc:Point" x="1562" y="-112" />
+ <di:waypoint x="273" y="130" />
+ <di:waypoint x="273" y="81" />
+ <di:waypoint x="972" y="81" />
+ <di:waypoint x="972" y="130" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="871.5" y="-151.96931534232883" width="19" height="12" />
+ <dc:Bounds x="282" y="90" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0gkr871_di" bpmnElement="SequenceFlow_0gkr871">
- <di:waypoint xsi:type="dc:Point" x="863" y="-62" />
- <di:waypoint xsi:type="dc:Point" x="863" y="-9" />
- <di:waypoint xsi:type="dc:Point" x="906" y="-9" />
+ <di:waypoint x="273" y="180" />
+ <di:waypoint x="273" y="233" />
+ <di:waypoint x="316" y="233" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="872.125" y="-36.06410256410257" width="14" height="12" />
+ <dc:Bounds x="282" y="206" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_083u1a5_di" bpmnElement="AssignNetworkBB_end">
- <dc:Bounds x="2241" y="-105" width="36" height="36" />
+ <dc:Bounds x="1651" y="137" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="2214" y="-65" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_11op1ih_di" bpmnElement="SequenceFlow_11op1ih">
- <di:waypoint xsi:type="dc:Point" x="782" y="-87" />
- <di:waypoint xsi:type="dc:Point" x="838" y="-87" />
+ <di:waypoint x="192" y="155" />
+ <di:waypoint x="248" y="155" />
<bpmndi:BPMNLabel>
<dc:Bounds x="765" y="-102" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0a96yhg_di" bpmnElement="ServiceTask_connect_to_NCIG">
- <dc:Bounds x="1286" y="-49" width="100" height="80" />
+ <dc:Bounds x="743" y="193" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0mauyto_di" bpmnElement="ServiceTask_connect_to_NCSI">
- <dc:Bounds x="1422" y="-49" width="100" height="80" />
+ <dc:Bounds x="867" y="193" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1ctpnpe_di" bpmnElement="SequenceFlow_1ctpnpe">
- <di:waypoint xsi:type="dc:Point" x="1006" y="-9" />
- <di:waypoint xsi:type="dc:Point" x="1036" y="-9" />
+ <di:waypoint x="416" y="232" />
+ <di:waypoint x="421" y="232" />
<bpmndi:BPMNLabel>
<dc:Bounds x="976" y="-24" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0e08b9t_di" bpmnElement="SequenceFlow_0e08b9t">
- <di:waypoint xsi:type="dc:Point" x="1386" y="-9" />
- <di:waypoint xsi:type="dc:Point" x="1422" y="-9" />
+ <di:waypoint x="843" y="233" />
+ <di:waypoint x="867" y="233" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1359" y="-24" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0mxc4ri_di" bpmnElement="SequenceFlow_0mxc4ri">
- <di:waypoint xsi:type="dc:Point" x="1522" y="-9" />
- <di:waypoint xsi:type="dc:Point" x="1562" y="-9" />
- <di:waypoint xsi:type="dc:Point" x="1562" y="-62" />
+ <di:waypoint x="917" y="193" />
+ <di:waypoint x="956" y="164" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1497" y="-24" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_019bzpc_di" bpmnElement="ServiceTask_connect_to_Tenant">
- <dc:Bounds x="1036" y="-49" width="100" height="80" />
+ <dc:Bounds x="515" y="193" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1alvmym_di" bpmnElement="ServiceTask_connect_to_CloudRegion">
- <dc:Bounds x="1162" y="-49" width="100" height="80" />
+ <dc:Bounds x="622" y="193" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0fwcvep_di" bpmnElement="SequenceFlow_0fwcvep">
- <di:waypoint xsi:type="dc:Point" x="1136" y="-9" />
- <di:waypoint xsi:type="dc:Point" x="1162" y="-9" />
+ <di:waypoint x="565" y="193" />
+ <di:waypoint x="565" y="173" />
+ <di:waypoint x="672" y="173" />
+ <di:waypoint x="672" y="193" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1104" y="-24" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_07z7hcu_di" bpmnElement="SequenceFlow_07z7hcu">
- <di:waypoint xsi:type="dc:Point" x="1262" y="-9" />
- <di:waypoint xsi:type="dc:Point" x="1286" y="-9" />
+ <di:waypoint x="722" y="233" />
+ <di:waypoint x="743" y="233" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1229" y="-24" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="TextAnnotation_17jb2vn_di" bpmnElement="TextAnnotation_17jb2vn">
- <dc:Bounds x="1232" y="86" width="158" height="54" />
+ <dc:Bounds x="777" y="288" width="158" height="54" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Association_15ppe1t_di" bpmnElement="Association_15ppe1t">
- <di:waypoint xsi:type="dc:Point" x="1306" y="31" />
- <di:waypoint xsi:type="dc:Point" x="1267" y="86" />
+ <di:waypoint x="793" y="273" />
+ <di:waypoint x="793" y="288" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="InclusiveGateway_0kiphfm_di" bpmnElement="networkFoundByName_ExclusiveGateway">
- <dc:Bounds x="838" y="-112" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="898" y="-104" width="73" height="24" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="InclusiveGateway_0pxktc3_di" bpmnElement="ExclusiveGateway_0vtj8n8">
- <dc:Bounds x="1537" y="-112" width="50" height="50" />
+ <dc:Bounds x="248" y="130" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1562" y="-58" width="0" height="12" />
+ <dc:Bounds x="308" y="138" width="73" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0jm95hf_di" bpmnElement="SequenceFlow_0jm95hf">
- <di:waypoint xsi:type="dc:Point" x="1587" y="-87" />
- <di:waypoint xsi:type="dc:Point" x="1632" y="-87" />
+ <di:waypoint x="997" y="155" />
+ <di:waypoint x="1042" y="155" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1609.5" y="-108" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_16hhbw3_di" bpmnElement="SequenceFlow_16hhbw3">
- <di:waypoint xsi:type="dc:Point" x="1732" y="-87" />
- <di:waypoint xsi:type="dc:Point" x="1769" y="-87" />
+ <di:waypoint x="1142" y="155" />
+ <di:waypoint x="1179" y="155" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1750.5" y="-108" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0988gld_di" bpmnElement="SequenceFlow_0988gld">
- <di:waypoint xsi:type="dc:Point" x="2206" y="-87" />
- <di:waypoint xsi:type="dc:Point" x="2241" y="-87" />
+ <di:waypoint x="1616" y="155" />
+ <di:waypoint x="1651" y="155" />
<bpmndi:BPMNLabel>
<dc:Bounds x="2178.5" y="-108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0h7upeg_di" bpmnElement="CallActivity_sdncHandlerCall">
- <dc:Bounds x="1927" y="-127" width="100" height="80" />
+ <dc:Bounds x="1337" y="115" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0rt36co_di" bpmnElement="SequenceFlow_0rt36co">
- <di:waypoint xsi:type="dc:Point" x="1869" y="-87" />
- <di:waypoint xsi:type="dc:Point" x="1927" y="-87" />
+ <di:waypoint x="1279" y="155" />
+ <di:waypoint x="1337" y="155" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1898" y="-108" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1mvf7b9_di" bpmnElement="SequenceFlow_1mvf7b9">
- <di:waypoint xsi:type="dc:Point" x="2027" y="-87" />
- <di:waypoint xsi:type="dc:Point" x="2106" y="-87" />
+ <di:waypoint x="1437" y="155" />
+ <di:waypoint x="1516" y="155" />
<bpmndi:BPMNLabel>
<dc:Bounds x="2066.5" y="-108" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0z9uk3m_di" bpmnElement="Task_0mu8391">
+ <dc:Bounds x="471" y="305" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_0e2crgd_di" bpmnElement="ServiceTask_0e2crgd">
+ <dc:Bounds x="631" y="305" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0lj5jj1_di" bpmnElement="SequenceFlow_0lj5jj1">
+ <di:waypoint x="471" y="232" />
+ <di:waypoint x="515" y="233" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1kslfgw_di" bpmnElement="SequenceFlow_1kslfgw">
+ <di:waypoint x="446" y="257" />
+ <di:waypoint x="446" y="345" />
+ <di:waypoint x="471" y="345" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0j7rpm9_di" bpmnElement="SequenceFlow_0j7rpm9">
+ <di:waypoint x="571" y="343" />
+ <di:waypoint x="631" y="341" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0ugp99e_di" bpmnElement="SequenceFlow_0ugp99e">
+ <di:waypoint x="731" y="345" />
+ <di:waypoint x="972" y="345" />
+ <di:waypoint x="972" y="180" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ParallelGateway_02lmom2_di" bpmnElement="ExclusiveGateway_0g85lk7">
+ <dc:Bounds x="421" y="207" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="InclusiveGateway_1cof7a3_di" bpmnElement="ExclusiveGateway_0vtj8n8">
+ <dc:Bounds x="947" y="130" width="50" height="50" />
+ </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn
index c8600586ce..1b4470b545 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AssignPnfBB.bpmn
@@ -1,34 +1,38 @@
<?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: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" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1a52v2f" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/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" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1a52v2f" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0">
<bpmn:collaboration id="Collaboration_0go8wi3">
<bpmn:participant id="Participant_1dwc5st" name="SO&#10;Assign PNF" processRef="AssignPnfBB" />
<bpmn:participant id="Participant_0gycee4" name="AAI" />
<bpmn:messageFlow id="MessageFlow_0xh6bkn" sourceRef="CreatePnfEntryInAai" targetRef="Participant_0gycee4" />
</bpmn:collaboration>
<bpmn:process id="AssignPnfBB" name="AssignPnfBB" isExecutable="true">
- <bpmn:sequenceFlow id="SequenceFlow_0l6rtzy" sourceRef="CreatePnfEntryInAai" targetRef="AaiEntryExists" />
<bpmn:sequenceFlow id="SequenceFlow_1fu9o4x" sourceRef="AssignPnf_StartEvent" targetRef="CreatePnfEntryInAai" />
- <bpmn:endEvent id="AaiEntryExists" name="AAI entry exists">
- <bpmn:incoming>SequenceFlow_0l6rtzy</bpmn:incoming>
- </bpmn:endEvent>
<bpmn:serviceTask id="CreatePnfEntryInAai" name="Create Pnf entry in AAI" camunda:expression="${AAICreateTasks.createPnf(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_1fu9o4x</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0l6rtzy</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_0yrabnf</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:startEvent id="AssignPnf_StartEvent">
<bpmn:outgoing>SequenceFlow_1fu9o4x</bpmn:outgoing>
</bpmn:startEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_0yrabnf" sourceRef="CreatePnfEntryInAai" targetRef="Task_UpdatePnfOrchestrationStatusAssigned" />
+ <bpmn:sequenceFlow id="SequenceFlow_1yb16sd" sourceRef="Task_UpdatePnfOrchestrationStatusAssigned" targetRef="AaiEntryExists" />
+ <bpmn:serviceTask id="Task_UpdatePnfOrchestrationStatusAssigned" name="Update Pnf Orchestration Status to Assigned" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusAssignedPnf(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_0yrabnf</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1yb16sd</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:endEvent id="AaiEntryExists" name="AAI entry exists">
+ <bpmn:incoming>SequenceFlow_1yb16sd</bpmn:incoming>
+ </bpmn:endEvent>
<bpmn:association id="Association_1le3nwi" sourceRef="AssignPnf_StartEvent" targetRef="TextAnnotation_184cxp4" />
<bpmn:textAnnotation id="TextAnnotation_184cxp4">
<bpmn:text>Inputs:
- - pnfName - String
-</bpmn:text>
+ - pnfName - String</bpmn:text>
</bpmn:textAnnotation>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0go8wi3">
<bpmndi:BPMNShape id="Participant_1dwc5st_di" bpmnElement="Participant_1dwc5st" isHorizontal="true">
- <dc:Bounds x="160" y="80" width="646" height="391" />
+ <dc:Bounds x="160" y="80" width="738" height="391" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Participant_0gycee4_di" bpmnElement="Participant_0gycee4" isHorizontal="true">
<dc:Bounds x="260" y="567" width="502" height="60" />
@@ -51,19 +55,26 @@
<di:waypoint x="237" y="203" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1wfgsdz_di" bpmnElement="AaiEntryExists">
- <dc:Bounds x="722" y="269" width="36" height="36" />
+ <dc:Bounds x="772" y="269" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="703" y="312" width="77" height="14" />
+ <dc:Bounds x="753" y="312" width="77" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0l6rtzy_di" bpmnElement="SequenceFlow_0l6rtzy">
- <di:waypoint x="561" y="287" />
- <di:waypoint x="722" y="287" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1fu9o4x_di" bpmnElement="SequenceFlow_1fu9o4x">
<di:waypoint x="255" y="287" />
<di:waypoint x="461" y="287" />
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0yrabnf_di" bpmnElement="SequenceFlow_0yrabnf">
+ <di:waypoint x="561" y="287" />
+ <di:waypoint x="620" y="287" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1kmas9h_di" bpmnElement="Task_UpdatePnfOrchestrationStatusAssigned">
+ <dc:Bounds x="620" y="247" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1yb16sd_di" bpmnElement="SequenceFlow_1yb16sd">
+ <di:waypoint x="720" y="287" />
+ <di:waypoint x="772" y="287" />
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WaitForPnfReadyBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WaitForPnfReadyBB.bpmn
index b38ec69ba5..29e2f2bf11 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WaitForPnfReadyBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WaitForPnfReadyBB.bpmn
@@ -8,20 +8,26 @@
<bpmn:messageFlow id="MessageFlow_1py54jr" sourceRef="UnregisterfromPnfReadyEvent" targetRef="WorkflowMessageServiceForDmaap" />
</bpmn:collaboration>
<bpmn:process id="WaitForPnfReadyBB" name="WaitForPnfReadyBB" isExecutable="true">
- <bpmn:startEvent id="WaitForPnfReady_StartEvent">
- <bpmn:outgoing>SequenceFlow_1jzs6dp</bpmn:outgoing>
- </bpmn:startEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_17q5zqe" sourceRef="UpdatePnfOrchestrationStatusToRegistered" targetRef="AaiEntryUpdated" />
+ <bpmn:sequenceFlow id="SequenceFlow_0m2r6ye" sourceRef="UpdatePnfOrchestrationStatusToRegister" targetRef="WaitForDmaapPnfReadyNotification" />
+ <bpmn:sequenceFlow id="SequenceFlow_1miyzfe" sourceRef="UnregisterfromPnfReadyEvent" targetRef="ThrowTimeoutException" />
+ <bpmn:sequenceFlow id="SequenceFlow_0p09qgm" sourceRef="WaitForDmaapPnfReadyNotification" targetRef="UpdatePnfOrchestrationStatusToRegistered" />
+ <bpmn:sequenceFlow id="SequenceFlow_1o8od8e" sourceRef="RegisterForPnfReadyEvent" targetRef="UpdatePnfOrchestrationStatusToRegister" />
+ <bpmn:sequenceFlow id="SequenceFlow_1kc34bc" sourceRef="WaitForDmaapTimeout" targetRef="UnregisterfromPnfReadyEvent" />
+ <bpmn:sequenceFlow id="SequenceFlow_1jzs6dp" sourceRef="WaitForPnfReady_StartEvent" targetRef="RegisterForPnfReadyEvent" />
<bpmn:serviceTask id="RegisterForPnfReadyEvent" name="Register for Pnf Ready Event" camunda:delegateExpression="${RegisterForPnfReadyEvent}">
<bpmn:incoming>SequenceFlow_1jzs6dp</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1o8od8e</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1miyzfe" sourceRef="UnregisterfromPnfReadyEvent" targetRef="ThrowTimeoutException" />
- <bpmn:sequenceFlow id="SequenceFlow_0p09qgm" sourceRef="WaitForDmaapPnfReadyNotification" targetRef="AaiEntryUpdated" />
- <bpmn:sequenceFlow id="SequenceFlow_1o8od8e" sourceRef="RegisterForPnfReadyEvent" targetRef="WaitForDmaapPnfReadyNotification" />
- <bpmn:sequenceFlow id="SequenceFlow_1kc34bc" sourceRef="WaitForDmaapTimeout" targetRef="UnregisterfromPnfReadyEvent" />
- <bpmn:sequenceFlow id="SequenceFlow_1jzs6dp" sourceRef="WaitForPnfReady_StartEvent" targetRef="RegisterForPnfReadyEvent" />
- <bpmn:receiveTask id="WaitForDmaapPnfReadyNotification" name="Wait for DMAAP pnf-ready notification" messageRef="Message_13h1tlo">
+ <bpmn:startEvent id="WaitForPnfReady_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1jzs6dp</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="UpdatePnfOrchestrationStatusToRegister" name="Update Pnf Orchestration Status to Register" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusRegisterPnf(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_1o8od8e</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0m2r6ye</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:receiveTask id="WaitForDmaapPnfReadyNotification" name="Wait for DMAAP pnf-ready notification" messageRef="Message_13h1tlo">
+ <bpmn:incoming>SequenceFlow_0m2r6ye</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0p09qgm</bpmn:outgoing>
</bpmn:receiveTask>
<bpmn:boundaryEvent id="WaitForDmaapTimeout" name="Timeout" attachedToRef="WaitForDmaapPnfReadyNotification">
@@ -30,17 +36,21 @@
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">#{timeoutForPnfEntryNotification}</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:boundaryEvent>
+ <bpmn:serviceTask id="UpdatePnfOrchestrationStatusToRegistered" name="Update Pnf Orchestration Status to Registered" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusRegisteredPnf(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_0p09qgm</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_17q5zqe</bpmn:outgoing>
+ </bpmn:serviceTask>
<bpmn:serviceTask id="UnregisterfromPnfReadyEvent" name="Unregister from Pnf Ready Event" camunda:delegateExpression="${CancelDmaapSubscription}">
<bpmn:incoming>SequenceFlow_1kc34bc</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1miyzfe</bpmn:outgoing>
</bpmn:serviceTask>
+ <bpmn:endEvent id="AaiEntryUpdated" name="AAI entry updated">
+ <bpmn:incoming>SequenceFlow_17q5zqe</bpmn:incoming>
+ </bpmn:endEvent>
<bpmn:endEvent id="ThrowTimeoutException" name="Throw timeout exception">
<bpmn:incoming>SequenceFlow_1miyzfe</bpmn:incoming>
<bpmn:errorEventDefinition errorRef="Error_1" />
</bpmn:endEvent>
- <bpmn:endEvent id="AaiEntryUpdated" name="AAI entry updated">
- <bpmn:incoming>SequenceFlow_0p09qgm</bpmn:incoming>
- </bpmn:endEvent>
<bpmn:textAnnotation id="TextAnnotation_1eyzes8">
<bpmn:text>Inputs:
- pnf name - String</bpmn:text>
@@ -52,12 +62,12 @@
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1d0w8lf">
<bpmndi:BPMNShape id="Participant_1egg397_di" bpmnElement="WaitForPnfReadyBB_ID" isHorizontal="true">
- <dc:Bounds x="160" y="50" width="810" height="400" />
+ <dc:Bounds x="160" y="50" width="1040" height="400" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0k52gr7_di" bpmnElement="AaiEntryUpdated">
- <dc:Bounds x="882" y="189" width="36" height="36" />
+ <dc:Bounds x="1112" y="189" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="858" y="230" width="88" height="14" />
+ <dc:Bounds x="1088" y="230" width="88" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_0j5ok9h_di" bpmnElement="WaitForPnfReady_StartEvent">
@@ -67,12 +77,12 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Participant_0vmrrhf_di" bpmnElement="WorkflowMessageServiceForDmaap" isHorizontal="true">
- <dc:Bounds x="340" y="490" width="463" height="60" />
+ <dc:Bounds x="340" y="490" width="690" height="60" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0wbx6tt_di" bpmnElement="ThrowTimeoutException">
- <dc:Bounds x="882" y="322" width="36" height="36" />
+ <dc:Bounds x="1112" y="322" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="875" y="359" width="70" height="27" />
+ <dc:Bounds x="1105" y="359" width="70" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_1eyzes8_di" bpmnElement="TextAnnotation_1eyzes8">
@@ -83,32 +93,32 @@
<di:waypoint x="237" y="109" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="MessageFlow_1vrcp2d_di" bpmnElement="MessageFlow_1vrcp2d">
- <di:waypoint x="582" y="490" />
- <di:waypoint x="582" y="247" />
+ <di:waypoint x="772" y="490" />
+ <di:waypoint x="772" y="247" />
<bpmndi:BPMNLabel>
<dc:Bounds x="996" y="380" width="90" height="10" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="BoundaryEvent_15eo1k9_di" bpmnElement="WaitForDmaapTimeout">
- <dc:Bounds x="596" y="229" width="36" height="36" />
+ <dc:Bounds x="786" y="229" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="639" y="240" width="40" height="14" />
+ <dc:Bounds x="829" y="240" width="40" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1kc34bc_di" bpmnElement="SequenceFlow_1kc34bc">
- <di:waypoint x="614" y="265" />
- <di:waypoint x="614" y="340" />
- <di:waypoint x="710" y="340" />
+ <di:waypoint x="804" y="265" />
+ <di:waypoint x="804" y="340" />
+ <di:waypoint x="910" y="340" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1028" y="309" width="90" height="10" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ReceiveTask_1sfysua_di" bpmnElement="WaitForDmaapPnfReadyNotification">
- <dc:Bounds x="530" y="167" width="100" height="80" />
+ <dc:Bounds x="720" y="167" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0p09qgm_di" bpmnElement="SequenceFlow_0p09qgm">
- <di:waypoint x="630" y="207" />
- <di:waypoint x="882" y="207" />
+ <di:waypoint x="820" y="207" />
+ <di:waypoint x="910" y="207" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1106.5" y="187" width="90" height="10" />
</bpmndi:BPMNLabel>
@@ -131,26 +141,40 @@
<dc:Bounds x="340" y="167" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1miyzfe_di" bpmnElement="SequenceFlow_1miyzfe">
- <di:waypoint x="810" y="340" />
- <di:waypoint x="882" y="340" />
+ <di:waypoint x="1010" y="340" />
+ <di:waypoint x="1112" y="340" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1233.5" y="343" width="90" height="10" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="MessageFlow_1py54jr_di" bpmnElement="MessageFlow_1py54jr">
- <di:waypoint x="760" y="380" />
- <di:waypoint x="760" y="490" />
+ <di:waypoint x="960" y="380" />
+ <di:waypoint x="960" y="490" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1165" y="458" width="90" height="10" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_12j7hox_di" bpmnElement="UnregisterfromPnfReadyEvent">
- <dc:Bounds x="710" y="300" width="100" height="80" />
+ <dc:Bounds x="910" y="300" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1jzs6dp_di" bpmnElement="SequenceFlow_1jzs6dp">
<di:waypoint x="255" y="207" />
<di:waypoint x="340" y="207" />
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1kiymc9_di" bpmnElement="UpdatePnfOrchestrationStatusToRegister">
+ <dc:Bounds x="530" y="167" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0m2r6ye_di" bpmnElement="SequenceFlow_0m2r6ye">
+ <di:waypoint x="630" y="207" />
+ <di:waypoint x="720" y="207" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_17q5zqe_di" bpmnElement="SequenceFlow_17q5zqe">
+ <di:waypoint x="1010" y="207" />
+ <di:waypoint x="1112" y="207" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1e3i8pf_di" bpmnElement="UpdatePnfOrchestrationStatusToRegistered">
+ <dc:Bounds x="910" y="167" width="100" height="80" />
+ </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
index c223d3ff11..de6b75bd03 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/HomingV2.java
@@ -28,9 +28,9 @@ import org.springframework.stereotype.Component;
@Component
public class HomingV2 {
- static final String HOMING_SNIRO = "sniro";
- static final String HOMING_OOF = "oof";
- static final String HOMING_SOLUTION = "Homing_Solution";
+ public static final String HOMING_SNIRO = "sniro";
+ public static final String HOMING_OOF = "oof";
+ public static final String HOMING_SOLUTION = "Homing_Solution";
private SniroHomingV2 sniroHomingV2;
private OofHomingV2 oofHomingV2;
@@ -59,6 +59,6 @@ public class HomingV2 {
private boolean isSniro(BuildingBlockExecution execution) {
return execution.getGeneralBuildingBlock().getRequestContext().getRequestParameters().getUserParams().stream()
- .anyMatch(params -> HOMING_SNIRO.equals(params.get(HOMING_SOLUTION)));
+ .anyMatch(params -> HomingV2.HOMING_SNIRO.equals(params.get(HomingV2.HOMING_SOLUTION)));
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index 22089dae1f..dab5102efd 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -31,8 +31,6 @@ import java.util.TreeSet;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.onap.so.client.orchestration.AAIPnfResources;
-import org.onap.so.logger.LoggingAnchor;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
@@ -62,12 +60,14 @@ import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAIConfigurationResources;
import org.onap.so.client.orchestration.AAIInstanceGroupResources;
import org.onap.so.client.orchestration.AAINetworkResources;
+import org.onap.so.client.orchestration.AAIPnfResources;
import org.onap.so.client.orchestration.AAIServiceInstanceResources;
import org.onap.so.client.orchestration.AAIVfModuleResources;
import org.onap.so.client.orchestration.AAIVnfResources;
import org.onap.so.client.orchestration.AAIVolumeGroupResources;
import org.onap.so.client.orchestration.AAIVpnBindingResources;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -274,18 +274,28 @@ public class AAICreateTasks {
* @param str
* @throws @return
*/
+ public void createPlatformForNetwork(BuildingBlockExecution execution) {
+ try {
+ L3Network network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
+ if (network != null) {
+ createPlatformNetwork(network);
+ }
+ } catch (Exception ex) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ }
+ }
+
+ /**
+ * This method is used for separating (,) from the string.
+ *
+ * @param str
+ * @throws @return
+ */
public void createPlatform(BuildingBlockExecution execution) {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- Platform platform = vnf.getPlatform();
- if (platform != null) {
- if (platform.getPlatformName() == null || "".equals(platform.getPlatformName())) {
- logger.debug("PlatformName is null in input. Skipping create platform...");
- } else {
- List<String> platforms = splitCDL(platform.getPlatformName());
- platforms.stream().forEach(platformName -> aaiVnfResources
- .createPlatformandConnectVnf(new Platform(platformName), vnf));
- }
+ if (vnf != null) {
+ createPlatformVnf(vnf);
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
@@ -293,6 +303,30 @@ public class AAICreateTasks {
}
+ protected void createPlatformVnf(GenericVnf vnf) {
+ Platform platform = vnf.getPlatform();
+ if (Strings.isNullOrEmpty(platform.getPlatformName())) {
+ logger.debug("PlatformName is null in input. Skipping create platform...");
+ } else {
+ List<String> platforms = splitCDL(platform.getPlatformName());
+ platforms.stream().forEach(
+ platformName -> aaiVnfResources.createPlatformandConnectVnf(new Platform(platformName), vnf));
+ }
+ }
+
+ protected void createPlatformNetwork(L3Network network) {
+ Platform platform = network.getPlatform();
+ if (platform != null) {
+ if (Strings.isNullOrEmpty(platform.getPlatformName())) {
+ logger.debug("PlatformName is null in input. Skipping create platform...");
+ } else {
+ List<String> platforms = splitCDL(platform.getPlatformName());
+ platforms.stream().forEach(
+ platformName -> aaiNetworkResources.createPlatformAndConnectNetwork(platform, network));
+ }
+ }
+ }
+
/**
* This method is used for separating (,) from the string.
*
@@ -312,22 +346,51 @@ public class AAICreateTasks {
public void createLineOfBusiness(BuildingBlockExecution execution) {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- LineOfBusiness lineOfBusiness = vnf.getLineOfBusiness();
- if (lineOfBusiness != null) {
- if (lineOfBusiness.getLineOfBusinessName() == null
- || "".equals(lineOfBusiness.getLineOfBusinessName())) {
- logger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness...");
- } else {
- List<String> lineOfBussinesses = splitCDL(lineOfBusiness.getLineOfBusinessName());
- lineOfBussinesses.stream().forEach(lobName -> aaiVnfResources
- .createLineOfBusinessandConnectVnf(new LineOfBusiness(lobName), vnf));
- }
+ if (vnf != null) {
+ createLineOfBusinessVnf(vnf);
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+ public void createLineOfBusinessForNetwork(BuildingBlockExecution execution) {
+ try {
+ L3Network network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
+ if (network != null) {
+ createLineOfBusinessNetwork(network);
+ }
+ } catch (Exception ex) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ }
+ }
+
+ protected void createLineOfBusinessVnf(GenericVnf vnf) {
+ LineOfBusiness lineOfBusiness = vnf.getLineOfBusiness();
+ if (lineOfBusiness != null) {
+ if (Strings.isNullOrEmpty(lineOfBusiness.getLineOfBusinessName())) {
+ logger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness...");
+ } else {
+ List<String> lineOfBussinesses = splitCDL(lineOfBusiness.getLineOfBusinessName());
+ lineOfBussinesses.stream().forEach(
+ lobName -> aaiVnfResources.createLineOfBusinessandConnectVnf(new LineOfBusiness(lobName), vnf));
+ }
+ }
+ }
+
+ protected void createLineOfBusinessNetwork(L3Network network) {
+ LineOfBusiness lineOfBusiness = network.getLineOfBusiness();
+ if (lineOfBusiness != null) {
+ if (Strings.isNullOrEmpty(lineOfBusiness.getLineOfBusinessName())) {
+ logger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness...");
+ } else {
+ List<String> lineOfBussinesses = splitCDL(lineOfBusiness.getLineOfBusinessName());
+ lineOfBussinesses.stream().forEach(lobName -> aaiNetworkResources
+ .createLineOfBusinessAndConnectNetwork(new LineOfBusiness(lobName), network));
+ }
+ }
+ }
+
/**
* This method is used for creating the volume group in A&AI.
*
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
index f1fbe545ce..4d5494d18c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
@@ -118,6 +118,14 @@ public class AAIUpdateTasks {
}
}
+ /**
+ * BPMN access method to update status of Pnf to Assigned in AAI
+ *
+ * @param execution
+ */
+ public void updateOrchestrationStatusAssignedPnf(BuildingBlockExecution execution) {
+ updateOrchestrationStatusForPnf(execution, OrchestrationStatus.ASSIGNED);
+ }
/**
* BPMN access method to update status of Pnf to Active in AAI
@@ -125,11 +133,29 @@ public class AAIUpdateTasks {
* @param execution
*/
public void updateOrchestrationStatusActivePnf(BuildingBlockExecution execution) {
+ updateOrchestrationStatusForPnf(execution, OrchestrationStatus.ACTIVE);
+ }
+
+ /**
+ * BPMN access method to update status of Pnf to Register in AAI
+ */
+ public void updateOrchestrationStatusRegisterPnf(BuildingBlockExecution execution) {
+ updateOrchestrationStatusForPnf(execution, OrchestrationStatus.REGISTER);
+ }
+
+ /**
+ * BPMN access method to update status of Pnf to Registered in AAI
+ */
+ public void updateOrchestrationStatusRegisteredPnf(BuildingBlockExecution execution) {
+ updateOrchestrationStatusForPnf(execution, OrchestrationStatus.REGISTERED);
+ }
+
+ private void updateOrchestrationStatusForPnf(BuildingBlockExecution execution, OrchestrationStatus status) {
try {
Pnf pnf = extractPojosForBB.extractByKey(execution, ResourceKey.PNF);
- aaiPnfResources.updateOrchestrationStatusPnf(pnf, OrchestrationStatus.ACTIVE);
+ aaiPnfResources.updateOrchestrationStatusPnf(pnf, status);
} catch (Exception ex) {
- logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActivePnf", ex);
+ logger.error("Exception occurred in AAIUpdateTasks during update Orchestration Status to {}", status, ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java
index 11a7b83259..cf56964af3 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java
@@ -90,6 +90,17 @@ public class AAIObjectMapper {
}
public org.onap.aai.domain.yang.Pnf mapPnf(Pnf pnf) {
+ if (modelMapper.getTypeMap(Pnf.class, org.onap.aai.domain.yang.Pnf.class) == null) {
+ modelMapper.addMappings(new PropertyMap<Pnf, org.onap.aai.domain.yang.Pnf>() {
+ @Override
+ protected void configure() {
+ map().setModelCustomizationId(source.getModelInfoPnf().getModelCustomizationUuid());
+ map().setModelInvariantId(source.getModelInfoPnf().getModelInvariantUuid());
+ map().setModelVersionId(source.getModelInfoPnf().getModelUuid());
+ }
+ });
+ }
+
return modelMapper.map(pnf, org.onap.aai.domain.yang.Pnf.class);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAINetworkResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAINetworkResources.java
index bc702c9fb4..3af65815a6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAINetworkResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAINetworkResources.java
@@ -30,6 +30,8 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet;
import org.onap.so.client.aai.AAIObjectPlurals;
@@ -38,8 +40,8 @@ import org.onap.so.client.aai.entities.AAIEdgeLabel;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
+import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -76,6 +78,22 @@ public class AAINetworkResources {
serviceInstanceURI);
}
+ public void createLineOfBusinessAndConnectNetwork(LineOfBusiness lineOfBusiness, L3Network network) {
+ AAIResourceUri lineOfBusinessURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness.getLineOfBusinessName());
+ AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, network.getNetworkId());
+ injectionHelper.getAaiClient().createIfNotExists(lineOfBusinessURI, Optional.of(lineOfBusiness))
+ .connect(networkURI, lineOfBusinessURI);
+ }
+
+ public void createPlatformAndConnectNetwork(Platform platform, L3Network network) {
+ AAIResourceUri platformURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platform.getPlatformName());
+ AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, network.getNetworkId());
+ injectionHelper.getAaiClient().createIfNotExists(platformURI, Optional.of(platform)).connect(networkURI,
+ platformURI);
+ }
+
public void deleteNetwork(L3Network network) {
AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, network.getNetworkId());
injectionHelper.getAaiClient().delete(networkURI);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
index ae6dde6521..e26009a1de 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
@@ -139,6 +139,25 @@ public class AAIUpdateTasksTest extends BaseTaskTest {
aaiUpdateTasks.updateOrchestrationStatusActiveService(execution);
}
+ @Test
+ public void updateOrchestrationStatusAssignedPnfTest() throws Exception {
+ Pnf pnf = preparePnfAndExtractForPnf();
+ doNothing().when(aaiPnfResources).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.ASSIGNED);
+
+ aaiUpdateTasks.updateOrchestrationStatusAssignedPnf(execution);
+
+ verify(aaiPnfResources, times(1)).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.ASSIGNED);
+ }
+
+ @Test
+ public void updateOrchestrationStatusAssignedPnfExceptionTest() throws Exception {
+ Pnf pnf = preparePnfAndExtractForPnf();
+ doThrow(RuntimeException.class).when(aaiPnfResources).updateOrchestrationStatusPnf(pnf,
+ OrchestrationStatus.ASSIGNED);
+
+ expectedException.expect(BpmnError.class);
+ aaiUpdateTasks.updateOrchestrationStatusAssignedPnf(execution);
+ }
@Test
public void updateOrchestrationStatusActivePnfTest() throws Exception {
@@ -161,6 +180,26 @@ public class AAIUpdateTasksTest extends BaseTaskTest {
}
@Test
+ public void updateOrchestrationStatusRegisterPnfTest() throws Exception {
+ Pnf pnf = preparePnfAndExtractForPnf();
+ doNothing().when(aaiPnfResources).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.REGISTER);
+
+ aaiUpdateTasks.updateOrchestrationStatusRegisterPnf(execution);
+
+ verify(aaiPnfResources, times(1)).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.REGISTER);
+ }
+
+ @Test
+ public void updateOrchestrationStatusRegisteredPnfTest() throws Exception {
+ Pnf pnf = preparePnfAndExtractForPnf();
+ doNothing().when(aaiPnfResources).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.REGISTERED);
+
+ aaiUpdateTasks.updateOrchestrationStatusRegisteredPnf(execution);
+
+ verify(aaiPnfResources, times(1)).updateOrchestrationStatusPnf(pnf, OrchestrationStatus.REGISTERED);
+ }
+
+ @Test
public void updateOrchestrationStatusAssignedVnfTest() throws Exception {
doNothing().when(aaiVnfResources).updateOrchestrationStatusVnf(genericVnf, OrchestrationStatus.ASSIGNED);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java
index 821e70a8c8..dc64e4ee48 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2020 Nokia
+ * ================================================================================
* 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
@@ -41,6 +43,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTarget;
import org.onap.so.bpmn.servicedecomposition.bbobjects.SegmentationAssignment;
@@ -55,6 +58,7 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
@@ -233,6 +237,34 @@ public class AAIObjectMapperTest {
}
@Test
+ public void pnfMap() {
+ final String pnfId = "PNF_id1";
+ final String pnfName = "PNF_name1";
+ final String modelCustomizationId = "8421fe03-fd1b-4bf7-845a-c3fe91edb03e";
+ final String modelInvariantId = "341a6f84-2cf9-4942-8f9e-2472ffe4e1d8";
+ final String modelVersionId = "b13a0706-46b9-4a98-a9f9-5b28431235e7";
+ final OrchestrationStatus orchestrationStatus = OrchestrationStatus.PRECREATED;
+
+ Pnf pnf = new Pnf();
+ pnf.setPnfId(pnfId);
+ pnf.setPnfName(pnfName);
+ pnf.setModelInfoPnf(new ModelInfoPnf());
+ pnf.getModelInfoPnf().setModelCustomizationUuid(modelCustomizationId);
+ pnf.getModelInfoPnf().setModelInvariantUuid(modelInvariantId);
+ pnf.getModelInfoPnf().setModelUuid(modelVersionId);
+ pnf.setOrchestrationStatus(orchestrationStatus);
+
+ org.onap.aai.domain.yang.Pnf aaiPnf = aaiObjectMapper.mapPnf(pnf);
+
+ assertEquals(aaiPnf.getPnfId(), pnfId);
+ assertEquals(aaiPnf.getPnfName(), pnfName);
+ assertEquals(aaiPnf.getModelCustomizationId(), modelCustomizationId);
+ assertEquals(aaiPnf.getModelInvariantId(), modelInvariantId);
+ assertEquals(aaiPnf.getModelVersionId(), modelVersionId);
+ assertEquals(aaiPnf.getOrchestrationStatus(), orchestrationStatus.toString());
+ }
+
+ @Test
public void vfModuleMap() throws Exception {
VfModule vfModule = new VfModule();
vfModule.setVfModuleId("a");