aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-08-22 12:10:23 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-08-22 12:10:59 -0400
commitce28fc9159d0d554ef06fdd1f6e1f4c0918ad269 (patch)
tree807d79ffc32d9bc590e0c85d78d3acadad1cfbeb /bpmn/so-bpmn-tasks/src/main
parent66c2def4d7b1a85cccea76f9d5096bf3e23f3b9b (diff)
Prod fixes August 18th
fixed compilation issues and all unit tests now pass fix condition that checks for vnf in list to set homing flags fix resource name variable being null Skip volume group search for alacarte VF Module creation, since that group is expected to be specified on the input Remove temporary change to JUnit for creation of volume group. Add mapping of isBaseVfModule setting to AAIObjectMapper for vfModule. adding a unit test for hte issue which was fixed Explicitly return heatStackId variable from VnfAdapter subprocess Fixing an issue with the workflow processor/asynresource which may lead to apihandler leaving the active_Request table record in_progress while the bpmn quits the processing due to the error. Change-Id: I7587193fcb5251f50370d72a1e4c10d112a1c72f Issue-ID: SO-879 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java1
4 files changed, 12 insertions, 3 deletions
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 9c1fba62e9..b059a77641 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
@@ -144,9 +144,11 @@ public class AAIUpdateTasks {
public void updateHeatStackIdVolumeGroup(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
+ String heatStackId = execution.getVariable("heatStackId");
VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
CloudRegion cloudRegion = gBBInput.getCloudRegion();
+ volumeGroup.setHeatStackId(heatStackId);
aaiVolumeGroupResources.updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion);
} catch (Exception ex) {
@@ -296,8 +298,10 @@ public class AAIUpdateTasks {
public void updateHeatStackIdVfModule(BuildingBlockExecution execution) {
try {
+ String heatStackId = execution.getVariable("heatStackId");
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID, execution.getLookupMap().get(ResourceKey.VF_MODULE_ID));
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
+ vfModule.setHeatStackId(heatStackId);
aaiVfModuleResources.updateHeatStackIdVfModule(vfModule, vnf);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
index 0b712452fd..554af37924 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java
@@ -65,6 +65,7 @@ public class VnfAdapterImpl {
execution.setVariable("isDebugLogEnabled", "true");
execution.setVariable("mso-request-id", gBBInput.getRequestContext().getMsoRequestId());
execution.setVariable("mso-service-instance-id", serviceInstance.getServiceInstanceId());
+ execution.setVariable("heatStackId", null);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
@@ -80,23 +81,25 @@ public class VnfAdapterImpl {
String heatStackId = ((CreateVfModuleResponse) vnfRestResponse).getVfModuleStackId();
if(!StringUtils.isEmpty(heatStackId)) {
vfModule.setHeatStackId(heatStackId);
+ execution.setVariable("heatStackId", heatStackId);
}
} else if(vnfRestResponse instanceof DeleteVfModuleResponse) {
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID, execution.getLookupMap().get(ResourceKey.VF_MODULE_ID));
Boolean vfModuleDelete = ((DeleteVfModuleResponse) vnfRestResponse).getVfModuleDeleted();
if(null!= vfModuleDelete && vfModuleDelete) {
vfModule.setHeatStackId(null);
+ execution.setVariable("heatStackId", null);
}
} else if(vnfRestResponse instanceof CreateVolumeGroupResponse) {
VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
String heatStackId = ((CreateVolumeGroupResponse) vnfRestResponse).getVolumeGroupStackId();
if(!StringUtils.isEmpty(heatStackId)) {
volumeGroup.setHeatStackId(heatStackId);
+ execution.setVariable("heatStackId", heatStackId);
}else{
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "HeatStackId is missing from create VolumeGroup Vnf Adapter response.");
}
- }
- execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock());
+ }
}
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index c6a63e1431..00c85df5d3 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -136,6 +136,7 @@ public class WorkflowAction {
RequestDetails requestDetails = sIRequest.getRequestDetails();
Resource resource = extractResourceIdAndTypeFromUri(uri);
WorkflowType resourceType = resource.getResourceType();
+ execution.setVariable("resourceName", resourceType.toString());
String resourceId = "";
if (resource.isGenerated()) {
resourceId = validateResourceIdInAAI(resource.getResourceId(), resourceType,
@@ -240,7 +241,7 @@ public class WorkflowAction {
}
if (resourceType == WorkflowType.SERVICE
&& (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE))
- && !resourceCounter.stream().filter(x -> VNF.equals(x.getResourceType())).collect(Collectors.toList()).isEmpty()) {
+ && !resourceCounter.stream().filter(x -> WorkflowType.VNF.equals(x.getResourceType())).collect(Collectors.toList()).isEmpty()) {
execution.setVariable("homing", true);
execution.setVariable("calledHoming", false);
}
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 94dfdcc747..8661c8e91e 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
@@ -96,6 +96,7 @@ public class AAIObjectMapper {
map().setModelInvariantId(source.getModelInfoVfModule().getModelInvariantUUID());
map().setModelVersionId(source.getModelInfoVfModule().getModelUUID());
map().setPersonaModelVersion(source.getModelInfoVfModule().getModelInvariantUUID());
+ map().setIsBaseVfModule(source.getModelInfoVfModule().getIsBaseBoolean());
}
});