aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java202
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java17
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java19
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy12
6 files changed, 164 insertions, 106 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 276b8183a8..3e6b44226d 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -47,6 +47,7 @@ import org.onap.sdc.api.notification.IStatusData;
import org.onap.sdc.tosca.parser.api.IEntityDetails;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.elements.queries.EntityQuery;
+import org.onap.sdc.tosca.parser.elements.queries.EntityQuery.EntityQueryBuilder;
import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery;
import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery.TopologyTemplateQueryBuilder;
import org.onap.sdc.tosca.parser.enums.SdcTypes;
@@ -1015,17 +1016,18 @@ public class ToscaResourceInstaller {
// Check for VNFC Instance Group info and add it if there is
- List<Group> groupList =
- toscaResourceStruct.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType(
- nodeTemplate, "org.openecomp.groups.VfcInstanceGroup");
+ List<IEntityDetails> vfcEntityList = getEntityDetails(toscaResourceStruct,
+ "org.openecomp.groups.VfcInstanceGroup",
+ TopologyTemplateQuery.newBuilder(SdcTypes.VF).customizationUUID(vfCustomizationUUID), false);
- for (Group group : groupList) {
+
+ for (IEntityDetails groupEntity : vfcEntityList) {
VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization =
- createVNFCInstanceGroup(nodeTemplate, group, vnfResource, toscaResourceStruct);
+ createVNFCInstanceGroup(groupEntity, nodeTemplate, vnfResource, toscaResourceStruct);
vnfcInstanceGroupCustomizationRepo.saveAndFlush(vnfcInstanceGroupCustomization);
}
- List<String> seqResult = processVNFCGroupSequence(toscaResourceStruct, groupList);
+ List<String> seqResult = processVNFCGroupSequence(toscaResourceStruct, vfcEntityList);
if (!CollectionUtils.isEmpty(seqResult)) {
String resultStr = seqResult.stream().collect(Collectors.joining(","));
vnfResource.setVnfcInstanceGroupOrder(resultStr);
@@ -1043,82 +1045,90 @@ public class ToscaResourceInstaller {
}
private List<String> processVNFCGroupSequence(ToscaResourceStructure toscaResourceStructure,
- List<Group> groupList) {
- if (CollectionUtils.isEmpty(groupList)) {
+ List<IEntityDetails> groupEntityDetails) {
+ if (CollectionUtils.isEmpty(groupEntityDetails)) {
return Collections.emptyList();
}
ISdcCsarHelper iSdcCsarHelper = toscaResourceStructure.getSdcCsarHelper();
- List<String> strSequence = new ArrayList<>(groupList.size());
- List<Group> tempGroupList = new ArrayList<>(groupList.size());
- List<NodeTemplate> nodes = new ArrayList<>();
- tempGroupList.addAll(groupList);
+ List<String> strSequence = new ArrayList<>(groupEntityDetails.size());
+ List<IEntityDetails> tempEntityList = new ArrayList<>(groupEntityDetails.size());
+ List<IEntityDetails> entities = new ArrayList<>();
+ tempEntityList.addAll(groupEntityDetails);
+
+ for (IEntityDetails vnfcEntityDetails : groupEntityDetails) {
+
+ List<IEntityDetails> vnfcMemberNodes = vnfcEntityDetails.getMemberNodes();
- for (Group group : groupList) {
- List<NodeTemplate> nodeList = group.getMemberNodes();
boolean hasRequirements = false;
- for (NodeTemplate node : nodeList) {
- RequirementAssignments requirements = iSdcCsarHelper.getRequirementsOf(node);
- if (requirements != null && requirements.getAll() != null && !requirements.getAll().isEmpty()) {
+ for (IEntityDetails vnfcDetails : vnfcMemberNodes) {
+
+ Map<String, RequirementAssignment> requirements = vnfcDetails.getRequirements();
+
+ if (requirements != null && !requirements.isEmpty()) {
hasRequirements = true;
break;
}
}
if (!hasRequirements) {
- strSequence.add(group.getName());
- tempGroupList.remove(group);
- nodes.addAll(nodeList);
+ strSequence.add(vnfcEntityDetails.getName());
+ tempEntityList.remove(vnfcEntityDetails);
+ entities.addAll(vnfcMemberNodes);
}
}
- getVNFCGroupSequenceList(strSequence, tempGroupList, nodes, iSdcCsarHelper);
+ getVNFCGroupSequenceList(strSequence, tempEntityList, entities, iSdcCsarHelper);
return strSequence;
}
- private void getVNFCGroupSequenceList(List<String> strSequence, List<Group> groupList, List<NodeTemplate> nodes,
- ISdcCsarHelper iSdcCsarHelper) {
- if (CollectionUtils.isEmpty(groupList)) {
+ private void getVNFCGroupSequenceList(List<String> strSequence, List<IEntityDetails> vnfcGroupDetails,
+ List<IEntityDetails> vnfcMemberNodes, ISdcCsarHelper iSdcCsarHelper) {
+ if (CollectionUtils.isEmpty(vnfcGroupDetails)) {
return;
}
- List<Group> tempGroupList = new ArrayList<>();
- tempGroupList.addAll(groupList);
+ List<IEntityDetails> tempGroupList = new ArrayList<>();
+ tempGroupList.addAll(vnfcGroupDetails);
- for (Group group : groupList) {
- boolean isAllExists = true;
- ArrayList<NodeTemplate> members = group.getMemberNodes();
- for (NodeTemplate memberNode : members) {
- RequirementAssignments requirements = iSdcCsarHelper.getRequirementsOf(memberNode);
- if (requirements == null || requirements.getAll() == null || requirements.getAll().isEmpty()) {
+ for (IEntityDetails vnfcGroup : vnfcGroupDetails) {
+ List<IEntityDetails> members = vnfcGroup.getMemberNodes();
+ for (IEntityDetails memberNode : members) {
+ boolean isAllExists = true;
+
+
+ Map<String, RequirementAssignment> requirements = memberNode.getRequirements();
+
+ if (requirements == null || requirements.isEmpty()) {
continue;
}
- List<RequirementAssignment> rqaList = requirements.getAll();
- for (RequirementAssignment rqa : rqaList) {
+
+
+ for (Map.Entry<String, RequirementAssignment> entry : requirements.entrySet()) {
+ RequirementAssignment rqa = entry.getValue();
String name = rqa.getNodeTemplateName();
- Optional<NodeTemplate> findNode =
- nodes.stream().filter(node -> node.getName().equals(name)).findFirst();
- if (!findNode.isPresent()) {
- isAllExists = false;
- break;
+ for (IEntityDetails node : vnfcMemberNodes) {
+ if (name.equals(node.getName())) {
+ break;
+ }
}
- }
- if (!isAllExists) {
+
+ isAllExists = false;
break;
}
- }
- if (isAllExists) {
- strSequence.add(group.getName());
- tempGroupList.remove(group);
- nodes.addAll(group.getMemberNodes());
+ if (isAllExists) {
+ strSequence.add(vnfcGroup.getName());
+ tempGroupList.remove(vnfcGroupDetails);
+ vnfcMemberNodes.addAll(vnfcGroupDetails);
+ }
}
- }
- if (!tempGroupList.isEmpty() && tempGroupList.size() < groupList.size()) {
- getVNFCGroupSequenceList(strSequence, tempGroupList, nodes, iSdcCsarHelper);
+ if (!tempGroupList.isEmpty() && tempGroupList.size() < vnfcGroupDetails.size()) {
+ getVNFCGroupSequenceList(strSequence, tempGroupList, vnfcMemberNodes, iSdcCsarHelper);
+ }
}
}
@@ -1822,10 +1832,11 @@ public class ToscaResourceInstaller {
return collectionNetworkResourceCustomization;
}
- protected VnfcInstanceGroupCustomization createVNFCInstanceGroup(NodeTemplate vnfcNodeTemplate, Group group,
- VnfResourceCustomization vnfResourceCustomization, ToscaResourceStructure toscaResourceStructure) {
+ protected VnfcInstanceGroupCustomization createVNFCInstanceGroup(IEntityDetails vfcInstanceEntity,
+ NodeTemplate vnfcNodeTemplate, VnfResourceCustomization vnfResourceCustomization,
+ ToscaResourceStructure toscaResourceStructure) {
- Metadata instanceMetadata = group.getMetadata();
+ Metadata instanceMetadata = vfcInstanceEntity.getMetadata();
InstanceGroup existingInstanceGroup =
instanceGroupRepo.findByModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
@@ -1839,7 +1850,7 @@ public class ToscaResourceInstaller {
.setModelInvariantUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
vfcInstanceGroup.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
vfcInstanceGroup.setModelVersion(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
- vfcInstanceGroup.setToscaNodeType(group.getType());
+ vfcInstanceGroup.setToscaNodeType(vfcInstanceEntity.getToscaType());
vfcInstanceGroup.setRole("SUB-INTERFACE"); // Set Role
vfcInstanceGroup.setType(InstanceGroupType.VNFC); // Set type
} else {
@@ -1858,45 +1869,64 @@ public class ToscaResourceInstaller {
vfcInstanceGroupCustom.setDescription(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
String getInputName = null;
- String groupProperty = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group,
- "vfc_instance_group_function");
- if (groupProperty != null) {
- int getInputIndex = groupProperty.indexOf("{get_input=");
- if (getInputIndex > -1) {
- getInputName = groupProperty.substring(getInputIndex + 11, groupProperty.length() - 1);
+
+ Map<String, Property> groupProperties = vfcInstanceEntity.getProperties();
+
+ for (String key : groupProperties.keySet()) {
+ Property property = groupProperties.get(key);
+
+ String vfcName = property.getName();
+
+ if (vfcName != null) {
+ if (vfcName.equals("vfc_instance_group_function")) {
+
+ String vfcValue = property.getValue().toString();
+ int getInputIndex = vfcValue.indexOf("{get_input=");
+ if (getInputIndex > -1) {
+ getInputName = vfcValue.substring(getInputIndex + 11, vfcValue.length() - 1);
+ }
+
+ }
}
+
}
- vfcInstanceGroupCustom.setFunction(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(vnfcNodeTemplate, getInputName));
+
+ List<IEntityDetails> serviceEntityList =
+ getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VF).customizationUUID(
+ vnfResourceCustomization.getModelCustomizationUUID()), SdcTypes.SERVICE, false);
+
+ if (serviceEntityList != null && !serviceEntityList.isEmpty()) {
+ vfcInstanceGroupCustom.setFunction(getLeafPropertyValue(serviceEntityList.get(0), getInputName));
+ }
+
vfcInstanceGroupCustom.setInstanceGroup(vfcInstanceGroup);
ArrayList<Input> inputs = vnfcNodeTemplate.getSubMappingToscaTemplate().getInputs();
- createVFCInstanceGroupMembers(vfcInstanceGroupCustom, group, inputs);
+ createVFCInstanceGroupMembers(vfcInstanceGroupCustom, vfcInstanceEntity, inputs);
return vfcInstanceGroupCustom;
-
}
- private void createVFCInstanceGroupMembers(VnfcInstanceGroupCustomization vfcInstanceGroupCustom, Group group,
- List<Input> inputList) {
- List<NodeTemplate> members = group.getMemberNodes();
+ private void createVFCInstanceGroupMembers(VnfcInstanceGroupCustomization vfcInstanceGroupCustom,
+ IEntityDetails vfcModuleEntity, List<Input> inputList) {
+ List<IEntityDetails> members = vfcModuleEntity.getMemberNodes();
if (!CollectionUtils.isEmpty(members)) {
- for (NodeTemplate vfcTemplate : members) {
+ for (IEntityDetails vfcEntity : members) {
VnfcCustomization vnfcCustomization = new VnfcCustomization();
- Metadata metadata = vfcTemplate.getMetaData();
+ Metadata metadata = vfcEntity.getMetadata();
vnfcCustomization
.setModelCustomizationUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- vnfcCustomization.setModelInstanceName(vfcTemplate.getName());
+ vnfcCustomization.setModelInstanceName(vfcEntity.getName());
vnfcCustomization.setModelUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
vnfcCustomization
.setModelInvariantUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
vnfcCustomization.setModelVersion(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
vnfcCustomization.setModelName(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
- vnfcCustomization.setToscaNodeType(testNull(vfcTemplate.getType()));
+ vnfcCustomization.setToscaNodeType(testNull(vfcEntity.getToscaType()));
vnfcCustomization
.setDescription(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
- vnfcCustomization.setResourceInput(getVnfcResourceInput(vfcTemplate, inputList));
+ vnfcCustomization.setResourceInput(getVnfcResourceInput(vfcEntity, inputList));
List<VnfcCustomization> vnfcCustomizations = vfcInstanceGroupCustom.getVnfcCustomizations();
if (vnfcCustomizations == null) {
@@ -1908,9 +1938,9 @@ public class ToscaResourceInstaller {
}
}
- public String getVnfcResourceInput(NodeTemplate vfcTemplate, List<Input> inputList) {
+ public String getVnfcResourceInput(IEntityDetails vfcEntity, List<Input> inputList) {
Map<String, String> resouceRequest = new HashMap<>();
- LinkedHashMap<String, Property> vfcTemplateProperties = vfcTemplate.getProperties();
+ Map<String, Property> vfcTemplateProperties = vfcEntity.getProperties();
for (String key : vfcTemplateProperties.keySet()) {
Property property = vfcTemplateProperties.get(key);
String resourceValue = getValue(property.getValue(), inputList);
@@ -1918,7 +1948,7 @@ public class ToscaResourceInstaller {
}
String resourceCustomizationUuid =
- vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
+ vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
String jsonStr = null;
try {
@@ -2700,6 +2730,18 @@ public class ToscaResourceInstaller {
}
+ protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, String entityType,
+ TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch) {
+
+ EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build();
+ TopologyTemplateQuery topologyTemplateQuery = topologyTemplateBuilder.build();
+ List<IEntityDetails> entityDetails =
+ toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch);
+
+ return entityDetails;
+
+ }
+
protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, SdcTypes entityType,
TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch) {
@@ -2712,6 +2754,18 @@ public class ToscaResourceInstaller {
}
+ protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct,
+ EntityQueryBuilder entityType, SdcTypes topologyTemplate, boolean nestedSearch) {
+
+ EntityQuery entityQuery = entityType.build();
+ TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build();
+ List<IEntityDetails> entityDetails =
+ toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch);
+
+ return entityDetails;
+
+ }
+
protected String getLeafPropertyValue(IEntityDetails entityDetails, String propName) {
Property leafProperty = entityDetails.getProperties().get(propName);
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
index 846eaf47e2..da99efadea 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
@@ -24,6 +24,7 @@ import org.junit.Test;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
+import org.onap.sdc.tosca.parser.api.IEntityDetails;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.Property;
@@ -49,6 +50,9 @@ public class ToscaResourceInputTest {
NodeTemplate nodeTemplate;
@Mock
+ IEntityDetails entityDetails;
+
+ @Mock
Property property;
@Mock
@@ -65,16 +69,16 @@ public class ToscaResourceInputTest {
Map<String, Object> map = new HashMap<>();
map.put("customizationUUID", "69df3303-d2b3-47a1-9d04-41604d3a95fd");
Metadata metadata = new Metadata(map);
- when(nodeTemplate.getProperties()).thenReturn(hashMap);
+ when(entityDetails.getProperties()).thenReturn(hashMap);
when(property.getValue()).thenReturn(getInput);
when(getInput.getInputName()).thenReturn("nameKey");
when(input.getName()).thenReturn("nameKey");
when(input.getDefault()).thenReturn("defaultValue");
when(getInput.toString()).thenReturn("getinput:[sites,INDEX,role]");
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(entityDetails.getMetadata()).thenReturn(metadata);
List<Input> inputs = new ArrayList<>();
inputs.add(input);
- String resourceInput = toscaResourceInstaller.getVnfcResourceInput(nodeTemplate, inputs);
+ String resourceInput = toscaResourceInstaller.getVnfcResourceInput(entityDetails, inputs);
assertEquals("{\\\"key1\\\":\\\"[sites,INDEX,role]|defaultValue\\\"}", resourceInput);
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
index 09a5424d47..be53e505ac 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
@@ -104,6 +104,7 @@ public class ExecuteBuildingBlockRainyDay {
}
} catch (Exception ex) {
// keep default serviceType value
+ logger.error("Exception in serviceType retrivel", ex);
}
String vnfType = ASTERISK;
try {
@@ -115,6 +116,7 @@ public class ExecuteBuildingBlockRainyDay {
}
} catch (Exception ex) {
// keep default vnfType value
+ logger.error("Exception in vnfType retrivel", ex);
}
String errorCode = ASTERISK;
@@ -122,12 +124,14 @@ public class ExecuteBuildingBlockRainyDay {
errorCode = "" + workflowException.getErrorCode();
} catch (Exception ex) {
// keep default errorCode value
+ logger.error("Exception in errorCode retrivel", ex);
}
try {
errorCode = "" + (String) execution.getVariable("WorkflowExceptionCode");
} catch (Exception ex) {
// keep default errorCode value
+ logger.error("Exception in errorCode retrivel", ex);
}
String workStep = ASTERISK;
@@ -135,6 +139,7 @@ public class ExecuteBuildingBlockRainyDay {
workStep = workflowException.getWorkStep();
} catch (Exception ex) {
// keep default workStep value
+ logger.error("Exception in workStep retrivel", ex);
}
String errorMessage = ASTERISK;
@@ -142,6 +147,7 @@ public class ExecuteBuildingBlockRainyDay {
errorMessage = workflowException.getErrorMessage();
} catch (Exception ex) {
// keep default workStep value
+ logger.error("Exception in errorMessage retrivel", ex);
}
String serviceRole = ASTERISK;
@@ -177,14 +183,14 @@ public class ExecuteBuildingBlockRainyDay {
logger.error("Failed to update Request Db Infra Active Requests with Retry Status", ex);
}
}
- if (handlingCode.equals("RollbackToAssigned") && !aLaCarte) {
+ if ("RollbackToAssigned".equals(handlingCode) && !aLaCarte) {
handlingCode = "Rollback";
}
if (handlingCode.startsWith("Rollback")) {
String targetState = "";
- if (handlingCode.equalsIgnoreCase("RollbackToAssigned")) {
+ if ("RollbackToAssigned".equalsIgnoreCase(handlingCode)) {
targetState = Status.ROLLED_BACK_TO_ASSIGNED.toString();
- } else if (handlingCode.equalsIgnoreCase("RollbackToCreated")) {
+ } else if ("RollbackToCreated".equalsIgnoreCase(handlingCode)) {
targetState = Status.ROLLED_BACK_TO_CREATED.toString();
} else {
targetState = Status.ROLLED_BACK.toString();
@@ -204,7 +210,7 @@ public class ExecuteBuildingBlockRainyDay {
int envMaxRetries = Integer.parseInt(this.environment.getProperty(maxRetries));
execution.setVariable("maxRetries", envMaxRetries);
} catch (Exception ex) {
- logger.error("Could not read maxRetries from config file. Setting max to 5 retries");
+ logger.error("Could not read maxRetries from config file. Setting max to 5 retries", ex);
execution.setVariable("maxRetries", 5);
}
}
@@ -247,8 +253,7 @@ public class ExecuteBuildingBlockRainyDay {
request.setLastModifiedBy("CamundaBPMN");
requestDbclient.updateInfraActiveRequests(request);
} catch (Exception e) {
- logger.error("Failed to update Request db with extSystemErrorSource or rollbackExtSystemErrorSource: "
- + e.getMessage());
+ logger.error("Failed to update Request db with extSystemErrorSource or rollbackExtSystemErrorSource: ", e);
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
index b2dbd97bfc..aee28cae00 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
@@ -90,7 +90,6 @@ public class ExtractPojosForBB {
result = lookupObjectInList(serviceInstance.getConfigurations(), value);
break;
case VPN_ID:
- serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
result = lookupObjectInList(gBBInput.getCustomer().getVpnBindings(), value);
break;
case VPN_BONDING_LINK_ID:
@@ -107,8 +106,9 @@ public class ExtractPojosForBB {
} catch (BBObjectNotFoundException e) { // re-throw parent object not found
throw e;
} catch (Exception e) { // convert all other exceptions to object not found
- logger.warn("BBObjectNotFoundException in ExtractPojosForBB",
- "BBObject " + key + " was not found in " + "gBBInput using reference value: " + value);
+ logger.warn(
+ "BBObjectNotFoundException in ExtractPojosForBB, BBObject {} was not found in gBBInput using reference value: {} {}",
+ key, value, e);
throw new BBObjectNotFoundException(key, value);
}
@@ -119,13 +119,8 @@ public class ExtractPojosForBB {
}
}
- protected <T> Optional<T> lookupObject(Object obj, String value) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
- return findValue(obj, value);
- }
-
- protected <T> Optional<T> lookupObjectInList(List<?> list, String value) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+ protected <T> Optional<T> lookupObjectInList(List<?> list, String value)
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Optional<T> result = Optional.empty();
for (Object obj : list) {
result = findValue(obj, value);
@@ -137,8 +132,8 @@ public class ExtractPojosForBB {
}
- protected <T> Optional<T> findValue(Object obj, String value) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
+ protected <T> Optional<T> findValue(Object obj, String value)
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
for (Field field : obj.getClass().getDeclaredFields()) {
if (field.isAnnotationPresent(Id.class)) {
String fieldName = field.getName();
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
index 1eeba493f4..af82bf091a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
@@ -69,7 +69,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
String Prefix="DCRESIRB_"
- public void preProcessRequest(DelegateExecution execution) {
+ void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -139,7 +139,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
logger.trace("Exit preProcessRequest")
}
- public void validateSDNCResponse(DelegateExecution execution, String response, String method) {
+ void validateSDNCResponse(DelegateExecution execution, String response, String method) {
logger.trace("validateSDNCResponse")
String msg = ""
@@ -172,7 +172,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
logger.trace("Exit validateSDNCResponse")
}
- public void postProcessRequest(DelegateExecution execution) {
+ void postProcessRequest(DelegateExecution execution) {
logger.trace("postProcessRequest")
String msg = ""
@@ -206,7 +206,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
}
- public void processRollbackException(DelegateExecution execution){
+ void processRollbackException(DelegateExecution execution){
logger.trace("processRollbackException")
try{
@@ -224,7 +224,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
logger.debug("Exit processRollbackException")
}
- public void processRollbackJavaException(DelegateExecution execution){
+ void processRollbackJavaException(DelegateExecution execution){
logger.trace("processRollbackJavaException")
try{
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
index eab99df9b2..1517a335d9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
@@ -61,7 +61,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
* generate the nsOperationKey
* generate the nsParameters
*/
- public void preProcessRequest (DelegateExecution execution) {
+ void preProcessRequest (DelegateExecution execution) {
String msg = ""
logger.trace("preProcessRequest()")
try {
@@ -130,7 +130,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* create NS task
*/
- public void createNetworkService(DelegateExecution execution) {
+ void createNetworkService(DelegateExecution execution) {
logger.trace("createNetworkService")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -157,7 +157,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* instantiate NS task
*/
- public void instantiateNetworkService(DelegateExecution execution) {
+ void instantiateNetworkService(DelegateExecution execution) {
logger.trace("instantiateNetworkService")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -186,7 +186,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* query NS task
*/
- public void queryNSProgress(DelegateExecution execution) {
+ void queryNSProgress(DelegateExecution execution) {
logger.trace("queryNSProgress")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String jobId = execution.getVariable("jobId")
@@ -206,7 +206,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* delay 5 sec
*/
- public void timeDelay(DelegateExecution execution) {
+ void timeDelay(DelegateExecution execution) {
try {
Thread.sleep(5000);
} catch(InterruptedException e) {
@@ -217,7 +217,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* finish NS task
*/
- public void addNSRelationship(DelegateExecution execution) {
+ void addNSRelationship(DelegateExecution execution) {
logger.trace("addNSRelationship")
String nsInstanceId = execution.getVariable("nsInstanceId")
if(nsInstanceId == null || nsInstanceId == ""){