[Feature-18550] Add interval trigger type for schedules - #18548
[Feature-18550] Add interval trigger type for schedules#18548liang-wenjie wants to merge 25 commits into
Conversation
…y on update
Address review feedback (SbloodyS):
- Frontend: include missedFirePolicy in the schedule create/update payload
so the selected policy is actually persisted to the backend.
- Backend: distinguish an omitted JSON field from an explicit value. A new
missedFirePolicySet marker tracks field presence, because Jackson cannot
tell omission from an explicit null.
- create: omitted or explicit null falls back to FIRE_ALL_MISSED
- update: when the client omits the field (e.g. an older client), the
existing stored policy is preserved instead of being overwritten
- Add unit tests covering create/update semantics and JSON presence detection.
Co-Authored-By: WorkBuddy <workbuddy@tencent.com>
…re-policy-v2' into 2dev/feat/add-schedule-missed-fire-policy-v2
SbloodyS
left a comment
There was a problem hiding this comment.
Feature like this require e2e test. Please add the api-test or e2e test cases to verify it.
det101
left a comment
There was a problem hiding this comment.
triggerType is sent as a top-level request field, but it is omitted from the schedule JSON.
Create/update APIs only accept @RequestParam("schedule") and deserialize that string into ScheduleParam. SchedulerController has no triggerType parameter, so this extra field is dropped. ScheduleParam.triggerType then defaults to CRON.
Preview works because it puts triggerType inside the schedule JSON (getPreviewSchedule). Saving does not, so INTERVAL schedules are validated and persisted as CRON. The interval JSON in crontab is then treated as a cron expression and the save fails, or Quartz registers a cron trigger instead of a simple trigger.
Please include triggerType in the schedule payload here, the same way preview does:
schedule: JSON.stringify({
startTime: start,
endTime: end,
crontab: state.timingForm.crontab,
timezoneId: state.timingForm.timezoneId,
missedFirePolicy: state.timingForm.missedFirePolicy,
triggerType: state.timingForm.triggerType
})
SbloodyS
left a comment
There was a problem hiding this comment.
You are using AI to help you do all the work, but you have not review its results. Before that, I won't waste time reviewing.
|
I have manually reviewed the AI-assisted changes locally and will push the follow-up fixes shortly. The follow-up fixes have now been pushed in commit The changes include:
Local verification passed:
Please take another look when convenient. |
|
The description of PR is still messy. |
Thanks for the feedback. I have cleaned up the PR description and organized it into Summary, Changes, and Validation sections. I also manually reviewed the latest changes, including the Please take another look when you have time. |
Summary
Add
INTERVALas a workflow schedule trigger type.This allows workflows to run at a fixed interval without requiring a cron expression.
Changes
CRONandINTERVALtrigger types.triggerTypeand interval configuration through the schedule API, service layer, DAO, Quartz, and UI.Validation
triggerType=INTERVALis preserved when saving and querying schedules.npm run build:prod.Closes #18550