Skip to content

Commit

Permalink
Merge pull request #216 from rq-dbrady/rq-dbrady/isolationGroupsForSy…
Browse files Browse the repository at this point in the history
…stemTasks

Feat: Added isolation groups for commonly used internal tasks
  • Loading branch information
v1r3n authored Jul 22, 2024
2 parents 4df0e80 + bfa0931 commit 7230de1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

import org.slf4j.Logger;
Expand Down Expand Up @@ -75,6 +76,10 @@ public List<TaskModel> getMappedTasks(TaskMapperContext taskMapperContext) {
inlineTask.setTaskType(TaskType.TASK_TYPE_INLINE);
inlineTask.setStartTime(System.currentTimeMillis());
inlineTask.setInputData(taskInput);
if (Objects.nonNull(taskMapperContext.getTaskDefinition())) {
inlineTask.setIsolationGroupId(
taskMapperContext.getTaskDefinition().getIsolationGroupId());
}
inlineTask.setStatus(TaskModel.Status.IN_PROGRESS);

return List.of(inlineTask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

import org.slf4j.Logger;
Expand Down Expand Up @@ -65,6 +66,10 @@ public List<TaskModel> getMappedTasks(TaskMapperContext taskMapperContext) {
TaskModel jsonJQTransformTask = taskMapperContext.createTaskModel();
jsonJQTransformTask.setStartTime(System.currentTimeMillis());
jsonJQTransformTask.setInputData(taskInput);
if (Objects.nonNull(taskMapperContext.getTaskDefinition())) {
jsonJQTransformTask.setIsolationGroupId(
taskMapperContext.getTaskDefinition().getIsolationGroupId());
}
jsonJQTransformTask.setStatus(TaskModel.Status.IN_PROGRESS);

return List.of(jsonJQTransformTask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@

import java.text.ParseException;
import java.time.Duration;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -79,6 +76,10 @@ public List<TaskModel> getMappedTasks(TaskMapperContext taskMapperContext) {
waitTask.setInputData(waitTaskInput);
waitTask.setStartTime(System.currentTimeMillis());
waitTask.setStatus(TaskModel.Status.IN_PROGRESS);
if (Objects.nonNull(taskMapperContext.getTaskDefinition())) {
waitTask.setIsolationGroupId(
taskMapperContext.getTaskDefinition().getIsolationGroupId());
}
setCallbackAfter(waitTask);
return List.of(waitTask);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public Wait() {
super(TASK_TYPE_WAIT);
}

@Override
public void start(WorkflowModel workflow, TaskModel task, WorkflowExecutor executor) {
task.setStatus(TaskModel.Status.IN_PROGRESS);
}

@Override
public void cancel(WorkflowModel workflow, TaskModel task, WorkflowExecutor workflowExecutor) {
task.setStatus(TaskModel.Status.CANCELED);
Expand Down

0 comments on commit 7230de1

Please sign in to comment.