Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

TaskMapperContext refactoring. #2872

Merged
merged 4 commits into from
Mar 30, 2022
Merged

TaskMapperContext refactoring. #2872

merged 4 commits into from
Mar 30, 2022

Conversation

aravindanr
Copy link
Collaborator

@aravindanr aravindanr commented Mar 24, 2022

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew generateLock saveLock to refresh dependencies)
  • WHOSUSING.md
  • Other (please describe):

Changes in this PR

  1. taskToSchedule -> workflowTask.
  2. workflowInstance -> workflowModel.
  3. Removed unused workflowDefinition.
  4. Changed bean name from taskProcessorsMap to taskMappersByTaskType.
  5. Added TaskMapperContext#createTaskModel() which creates a basic TaskModel with properties copied from WorkflowTask and WorkflowModel.
  6. FORK_JOIN_DYNAMIC now sets startTime.
  7. TaskMapper implementations set the time fields in TaskModel corresponding to its status.
  8. Removed start and execute methods from Wait.

1. taskToSchedule -> workflowTask
2. workflowInstance -> workflowModel
3. Removed unused WorkflowDefinition.
4. Changed bean name from taskProcessorsMap to taskMappersByTaskType.
@aravindanr aravindanr marked this pull request as ready for review March 25, 2022 19:00
@aravindanr
Copy link
Collaborator Author

@apanicker-nflx @jxu-nflx PR will be easier to review if each commit is reviewed separately.

long epochMillis = System.currentTimeMillis();
forkTask.setStartTime(epochMillis);
forkTask.setEndTime(epochMillis);
forkTask.setEndTime(epochMillis);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate setEndTime

dynamicTask.setTaskDefName(taskToSchedule.getName());
dynamicTask.setCorrelationId(workflowInstance.getCorrelationId());
dynamicTask.setScheduledTime(System.currentTimeMillis());
dynamicTask.setTaskType(workflowTask.getType());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dynamicTask.setTaskType(workflowTask.getType()); this line can be removed

* @param joinWorkflowTask: A instance of {@link WorkflowTask} which is of type {@link
* TaskType#JOIN}
* @param joinInput: The input which is set in the {@link TaskModel#setInputData(Map)}
* @return a new instance of {@link TaskModel} representing a {@link TaskType#JOIN}
*/
@VisibleForTesting
TaskModel createJoinTask(
WorkflowModel workflowInstance,
WorkflowModel workflowModel,
WorkflowTask joinWorkflowTask,
HashMap<String, Object> joinInput) {
TaskModel joinTask = new TaskModel();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be replaced with createTaskModel as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Conflicts:
#	core/src/main/java/com/netflix/conductor/core/execution/mapper/SubWorkflowTaskMapper.java
@aravindanr aravindanr merged commit 91adde7 into main Mar 30, 2022
@aravindanr aravindanr deleted the taskmapper_refactoring branch March 30, 2022 16:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants