diff options
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt index 0e9ab7b7a..2c50e03cd 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt +++ b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt @@ -222,11 +222,16 @@ abstract class ResourceCommand( else -> InternalState.IN_PROGRESS } + InternalState.REPLACE_MYSELF -> when (jobStatus) { + JobStatus.IN_PROGRESS -> InternalState.REPLACE_MYSELF + else -> InternalState.IN_PROGRESS + } + InternalState.IN_PROGRESS -> { when { jobStatus != JobStatus.COMPLETED -> InternalState.IN_PROGRESS isDescendantHasAction(Action.Create) -> InternalState.CREATING_CHILDREN - isDescendantHasAction(Action.Replace) -> InternalState.CREATING_CHILDREN + isDescendantHasAction(Action.Upgrade) -> InternalState.CREATING_CHILDREN else -> InternalState.TERMINAL } } @@ -284,7 +289,7 @@ abstract class ResourceCommand( isNeedToResumeMySelf() -> InternalState.RESUME_MYSELF isNeedToReplaceMySelf() -> InternalState.REPLACE_MYSELF isDescendantHasAction(phase) -> InternalState.CREATING_CHILDREN - isDescendantHasAction(Action.Replace) -> InternalState.CREATING_CHILDREN + isDescendantHasAction(Action.Upgrade) -> InternalState.CREATING_CHILDREN else -> InternalState.TERMINAL } else -> throw IllegalStateException("state $internalState is not supported yet") |