diff --git a/common/src/main/java/com/netflix/conductor/common/metadata/workflow/SubWorkflowParams.java b/common/src/main/java/com/netflix/conductor/common/metadata/workflow/SubWorkflowParams.java index d17378862..ce4fe4fd8 100644 --- a/common/src/main/java/com/netflix/conductor/common/metadata/workflow/SubWorkflowParams.java +++ b/common/src/main/java/com/netflix/conductor/common/metadata/workflow/SubWorkflowParams.java @@ -46,7 +46,7 @@ public class SubWorkflowParams { private IdempotencyStrategy idempotencyStrategy; // Priority of the sub workflow, not set inherits from the parent - private Integer priority; + private Object priority; public String getIdempotencyKey() { return idempotencyKey; @@ -64,11 +64,11 @@ public void setIdempotencyStrategy(IdempotencyStrategy idempotencyStrategy) { this.idempotencyStrategy = idempotencyStrategy; } - public Integer getPriority() { + public Object getPriority() { return priority; } - public void setPriority(Integer priority) { + public void setPriority(Object priority) { this.priority = priority; } diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SubWorkflowTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SubWorkflowTaskMapper.java index fae54660b..f59d67364 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SubWorkflowTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SubWorkflowTaskMapper.java @@ -14,6 +14,7 @@ import java.util.*; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -83,8 +84,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { subWorkflowTask.addInput("workflowInput", taskMapperContext.getTaskInput()); subWorkflowTask.setStatus(TaskModel.Status.SCHEDULED); subWorkflowTask.setCallbackAfterSeconds(workflowTask.getStartDelay()); - if (subWorkflowParams.getPriority() != null) { - subWorkflowTask.setWorkflowPriority(subWorkflowParams.getPriority()); + if (subWorkflowParams.getPriority() != null && !StringUtils.isEmpty(subWorkflowParams.getPriority().toString())) { + int priority = Integer.parseInt(subWorkflowParams.getPriority().toString()); + subWorkflowTask.setWorkflowPriority(priority); } LOGGER.debug("SubWorkflowTask {} created to be Scheduled", subWorkflowTask); return List.of(subWorkflowTask);