Skip to content

feat(workflow): add WorkflowExecutorService for action dispatch#21

Draft
mpge wants to merge 1 commit intomainfrom
feat/workflow-executor
Draft

feat(workflow): add WorkflowExecutorService for action dispatch#21
mpge wants to merge 1 commit intomainfrom
feat/workflow-executor

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented Apr 24, 2026

Summary

Ports the NestJS workflow-executor.service.ts to Spring. The existing WorkflowEngine only evaluates conditions — this service parses the JSON action array on Workflow.actions and dispatches each entry against the relevant repository.

Action catalog: change_priority, change_status, assign_agent, set_department, add_tag, remove_tag, add_note, insert_canned_reply.

  • {{field}} placeholders in canned replies are interpolated via WorkflowEngine.interpolateVariables
  • One failing action does not halt the others (warn-logged, skipped) — mirrors NestJS
  • Unknown action types warn-log and skip
  • Malformed JSON returns an empty action list (no NPE)

Scope

This PR is executor only. Follow-up PRs:

  1. WorkflowRunner (loads matching workflows for a trigger event, evaluates conditions, writes WorkflowLog)
  2. Event listener that bridges TicketEvent into processEvent

Splitting keeps the diff reviewable and lets each piece land independently.

Test plan

  • Unit tests cover every action type + malformed-input paths (21 tests)
  • CI passes (checkstyle + test jobs)

Ports the NestJS workflow-executor.service.ts to Spring. The existing
WorkflowEngine only evaluates conditions; this service parses the JSON
action array on Workflow.actions and dispatches each entry against the
relevant repository.

Action catalog: change_priority, change_status, assign_agent,
set_department, add_tag, remove_tag, add_note, insert_canned_reply.
{{field}} placeholders in canned replies are interpolated via
WorkflowEngine.interpolateVariables.

One failing action does not halt the others — mirrors the NestJS
reference. Unknown action types warn-log and skip.

Follow-up PR will add the WorkflowRunner (loads matching workflows,
evaluates, writes WorkflowLog) and the event listener that bridges
TicketEvent into processEvent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant