aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
index 9023682f6..016c66cca 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
@@ -8,10 +8,12 @@ import org.onap.vid.job.impl.JobSharedData
import org.onap.vid.model.Action
import org.onap.vid.model.serviceInstantiation.BaseResource
import org.onap.vid.model.serviceInstantiation.VfModule
+import org.onap.vid.model.serviceInstantiation.VfModule.PauseInstantiation
import org.onap.vid.model.serviceInstantiation.Vnf
import org.onap.vid.mso.RestMsoImplementation
import org.onap.vid.properties.Features
import org.onap.vid.services.AsyncInstantiationBusinessLogic
+import org.onap.vid.utils.takeUntilIncluding
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.config.ConfigurableBeanFactory
import org.springframework.context.annotation.Scope
@@ -71,9 +73,14 @@ class VnfCommand @Autowired constructor(
private fun vfModulesForChildrenJobs(vfModules: List<VfModule>): List<VfModule> =
vfModules
+ .takeUntilIncluding { shoudlPauseAfterInstantiation(it) }
.filter { filterModuleByNeedToCreateBase(it) }
.map { childVfModuleWithVnfRegionAndTenant(it) }
+ fun shoudlPauseAfterInstantiation(vfModule: VfModule) =
+ (vfModule.action == Action.Create && vfModule.pauseInstantiation == PauseInstantiation.afterCompletion
+ && featureManager.isActive(Features.FLAG_2006_PAUSE_VFMODULE_INSTANTIATION_CREATION))
+
internal fun childVfModuleWithVnfRegionAndTenant(vfModule: VfModule): VfModule {
if (!shouldEntailRegionAndTenantToVfModule(vfModule)) {
return vfModule