From 18463785dabe925f7e76f21f28fa7551c7d559e1 Mon Sep 17 00:00:00 2001 From: "Bancala, Ben (bb3476)" Date: Thu, 3 May 2018 11:50:13 -0400 Subject: fixed bug in createvnfinfra bpmn Change-Id: I3e27ec0d1487eb68e8c54d27508b58233bf49808 Issue-ID: SO-602 Signed-off-by: Bancala, Ben (bb3476) --- .../scripts/CreateVfModuleInfra.groovy | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy index 3f0b8d11f1..797086b125 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy @@ -35,6 +35,8 @@ import org.openecomp.mso.bpmn.common.scripts.VidUtils; import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.core.json.JsonUtils +import org.openecomp.mso.bpmn.infrastructure.aai.AAICreateResources; +import org.onap.aai.domain.yang.v12.GenericVnf; public class CreateVfModuleInfra extends AbstractServiceTaskProcessor { @@ -287,6 +289,25 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage()) } } + + /** + * Query AAI for vnf orchestration status to determine if health check and config scaling should be run + */ + public void queryAAIForVnfOrchestrationStatus(DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def vnfId = execution.getVariable("CVFMI_vnfId") + execution.setVariable("runHealthCheck", false); + execution.setVariable("runConfigScaleOut", false); + AAICreateResources aaiCreateResources = new AAICreateResources(); + Optional vnf = aaiCreateResources.getVnfInstance(vnfId); + if(vnf.isPresent()){ + def vnfOrchestrationStatus = vnf.get().getOrchestrationStatus(); + if("active".equalsIgnoreCase(vnfOrchestrationStatus)){ + execution.setVariable("runHealthCheck", true); + execution.setVariable("runConfigScaleOut", true); + } + } + } /** * -- cgit 1.2.3-korg