use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class UserParamsServiceTraversal method setVfModuleAndConfigurationWorkFlowTypeToResourceList.
private void setVfModuleAndConfigurationWorkFlowTypeToResourceList(List<Resource> resourceList, Resource vnfResource, Service validate, Vnfs vnf, VfModules vfModule, VfModuleCustomization vfModuleCustomization) {
if ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null && vfModuleCustomization.getHeatEnvironment() != null) || (vfModuleCustomization.getVfModule().getModelName() != null && vfModuleCustomization.getVfModule().getModelName().contains("helm"))) {
foundVfModuleOrVG = true;
Resource resource = setVfModuleWorkFlowTypeToResourceList(resourceList, vnfResource, vfModuleCustomization, vfModule);
if (vnf.getModelInfo() != null) {
resource.setModelVersionId(vnf.getModelInfo().getModelVersionId());
}
resource.setVfModuleCustomizationId(vfModuleCustomization.getModelCustomizationUUID());
resource.setModelCustomizationId(vfModuleCustomization.getModelCustomizationUUID());
setConfigurationWorkFlowTypeToResourceList(resourceList, vnfResource, validate, vnf, vfModule, resource);
}
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class UserParamsServiceTraversal method setResourceListForPnfs.
private void setResourceListForPnfs(List<Resource> resourceList, Resource serviceResource, Service validate) {
for (Pnfs pnf : validate.getResources().getPnfs()) {
Resource pnfResource = new Resource(WorkflowType.PNF, pnf.getModelInfo().getModelCustomizationId(), false, serviceResource);
ModelInfo modelInfo = pnf.getModelInfo();
if (modelInfo != null) {
pnfResource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
pnfResource.setModelVersionId(modelInfo.getModelVersionId());
}
pnfResource.setProcessingPriority(pnf.getProcessingPriority());
resourceList.add(pnfResource);
}
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class UserParamsServiceTraversal method setConfigurationWorkFlowTypeToResourceList.
private void setConfigurationWorkFlowTypeToResourceList(List<Resource> resourceList, Resource vnfResource, Service validate, Vnfs vnf, VfModules vfModule, Resource resource) {
if (!vnfCustomizationUUID.isEmpty() && !vfModuleCustomizationUUID.isEmpty()) {
List<CvnfcConfigurationCustomization> configs = traverseCatalogDbForConfiguration(validate.getModelInfo().getModelVersionId());
for (CvnfcConfigurationCustomization config : configs) {
Resource configResource = new Resource(WorkflowType.CONFIGURATION, config.getConfigurationResource().getModelUUID(), false, vnfResource);
resource.setVnfCustomizationId(vnf.getModelInfo().getModelCustomizationId());
resource.setVfModuleCustomizationId(vfModule.getModelInfo().getModelCustomizationId());
resourceList.add(configResource);
}
}
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class UserParamsServiceTraversal method setResourceListForVnfs.
private void setResourceListForVnfs(DelegateExecution execution, List<Resource> resourceList, Resource serviceResource, Service validate) {
for (Vnfs vnf : validate.getResources().getVnfs()) {
setVnfCustomizationUUID(vnf);
Resource vnfResource = new Resource(WorkflowType.VNF, vnf.getModelInfo().getModelCustomizationId(), false, serviceResource);
vnfResource.setProcessingPriority(vnf.getProcessingPriority());
vnfResource.setInstanceName(vnf.getInstanceName());
ModelInfo modelInfo = vnf.getModelInfo();
if (modelInfo != null) {
vnfResource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
vnfResource.setModelVersionId(modelInfo.getModelVersionId());
}
resourceList.add(vnfResource);
setResourceListForVfModules(execution, resourceList, vnfResource, validate, vnf);
}
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class ServiceEBBLoader method traverseCatalogDbService.
public void traverseCatalogDbService(DelegateExecution execution, ServiceInstancesRequest sIRequest, List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds) throws JsonProcessingException, VrfBondingServiceException {
String modelUUID = sIRequest.getRequestDetails().getModelInfo().getModelVersionId();
org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(modelUUID);
if (service == null) {
buildAndThrowException(execution, "Could not find the service model in catalog db.");
} else {
Resource serviceResource = new Resource(WorkflowType.SERVICE, service.getModelUUID(), false, null);
resourceList.add(serviceResource);
RelatedInstance relatedVpnBinding = bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.vpnBinding);
RelatedInstance relatedLocalNetwork = bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.network);
if (relatedVpnBinding != null && relatedLocalNetwork != null) {
traverseVrfConfiguration(aaiResourceIds, resourceList, serviceResource, service, relatedVpnBinding, relatedLocalNetwork);
} else {
traverseNetworkCollection(execution, resourceList, serviceResource, service);
}
}
}
Aggregations