Add a position field to BaseResource
[vid.git] / vid-app-common / src / main / java / org / onap / vid / job / command / ResourceCommand.kt
index 0e9ab7b..ac5c275 100644 (file)
@@ -22,6 +22,7 @@ package org.onap.vid.job.command
 
 
 import com.fasterxml.jackson.module.kotlin.convertValue
+import org.apache.commons.lang3.ObjectUtils.defaultIfNull
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate
 import org.onap.vid.changeManagement.RequestDetailsWrapper
 import org.onap.vid.exceptions.AbortingException
@@ -226,7 +227,7 @@ abstract class ResourceCommand(
                 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 +285,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")