diff --git a/quartz-manager-frontend/src/app/components/simple-trigger-config/simple-trigger-config.component.html b/quartz-manager-frontend/src/app/components/simple-trigger-config/simple-trigger-config.component.html
index 3be161b..fc9d603 100644
--- a/quartz-manager-frontend/src/app/components/simple-trigger-config/simple-trigger-config.component.html
+++ b/quartz-manager-frontend/src/app/components/simple-trigger-config/simple-trigger-config.component.html
@@ -100,18 +100,25 @@
>
-
+
-
Misfire Policy
-
RESCHEDULE NEXT WITH REMAINING COUNT
-
- In case of misfire event, the trigger is re-scheduled to the next scheduled time after 'now' with the repeat count set to what it would be, if it had not missed any firings.
-
- Warning: This policy could cause the Trigger to go directly to the 'COMPLETE' state if all fire-times where missed.
-
+
+ Misfire Instruction
+
+ FIRE NOW
+ RESCHEDULE NOW WITH EXISTING REPEAT COUNT
+ RESCHEDULE NOW WITH REMAINING REPEAT COUNT
+ RESCHEDULE NEXT WITH REMAINING COUNT
+ RESCHEDULE NEXT WITH EXISTING COUNT
+
+
+
-
+
(enm: { [s: string]: T}, value: string): T | undefined {
+// return (Object.values(enm) as unknown as string[]).includes(value)
+// ? value as unknown as T
+// : undefined;
+// }
+//
+// export function parseMisfireInstruction(str: string): MisfireInstruction {
+// return enumFromStringValue(MisfireInstruction, str);
+// // return (MisfireInstruction)[str]
+// // const indexOfStr = Object.values(MisfireInstruction).indexOf(str as unknown as MisfireInstruction);
+// // const key = Object.keys(Sizes)[indexOfStr];
+// // return MisfireInstruction[k]
+// // return Object.values(MisfireInstruction).find(val => val === str);
+// }
+
+export const MisfireInstructionCaption = new Map([
+ [MisfireInstruction.MISFIRE_INSTRUCTION_FIRE_NOW,
+ `The job is executed immediately after the scheduler discovers misfire situation.
+ In case of the trigger has been set with a repeat count, this policy is equals to RESCHEDULE NOW WITH REMAINING REPEAT COUNT`
+ ],
+ [MisfireInstruction.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT,
+ `First misfired trigger is executed immediately. Then the scheduler waits desired interval and executes all remaining triggers.
+ Effectively the first fire time of the misfired trigger is moved to current time with no other changes.`
+ ],
+ [MisfireInstruction.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT,
+ `First misfired execution runs immediately. Remaining misfired executions are discarded. Remaining not-yet-fired triggers are executed
+ with desired interval, starting from the recovered misfired execution.
+ Use this policy if your constraint is to honor the end date time.
+ Warning The actual number of job executions could be less than initially set,
+ because some of the misfired triggers are ignored. The end date time you set is always `
+ ],
+ [MisfireInstruction.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT,
+ `In case of misfire event, the scheduler won't do anything immediately. Instead it will wait for next scheduled time the trigger and
+ run all triggers with scheduled interval. Misfired trigger are simply post-poned but not ignored.
+ Use this policy if your constraint is to execute the job for the all times equals to the repeation counter. ' +
+ 'Warning The scheduler can completed over the end date time you set `],
+ [MisfireInstruction.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT,
+ `In case of misfire event, the trigger is re-scheduled to the next scheduled time after 'now'
+ with the repeat count set to what it would be if it had not missed any firings.
+ Use this policy if no jobs must run after the end date time.
+ Warning The actual number of job executions could be less than initially set, because the misfired trigger are ignored.
+ This policy could cause the Trigger to go directly to the 'COMPLETE' state if all fire-times where missed.`
+ ]
+]);
diff --git a/quartz-manager-frontend/src/app/model/simple-trigger.command.ts b/quartz-manager-frontend/src/app/model/simple-trigger.command.ts
index 03f1231..8df39d4 100644
--- a/quartz-manager-frontend/src/app/model/simple-trigger.command.ts
+++ b/quartz-manager-frontend/src/app/model/simple-trigger.command.ts
@@ -5,4 +5,5 @@ export class SimpleTriggerCommand {
endDate: Date;
repeatCount: number;
repeatInterval: number;
+ misfireInstruction: string;
}
diff --git a/quartz-manager-frontend/src/app/model/simple-trigger.form.ts b/quartz-manager-frontend/src/app/model/simple-trigger.form.ts
index 91e4966..a7156ea 100644
--- a/quartz-manager-frontend/src/app/model/simple-trigger.form.ts
+++ b/quartz-manager-frontend/src/app/model/simple-trigger.form.ts
@@ -7,4 +7,5 @@ export class SimpleTriggerForm {
endDate: Moment;
repeatCount: number;
repeatInterval: number;
+ misfireInstruction: string;
}
diff --git a/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/converters/SimpleTriggerCommandDTOToSimpleTrigger.java b/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/converters/SimpleTriggerCommandDTOToSimpleTrigger.java
index b918684..a82b632 100644
--- a/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/converters/SimpleTriggerCommandDTOToSimpleTrigger.java
+++ b/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/converters/SimpleTriggerCommandDTOToSimpleTrigger.java
@@ -19,14 +19,38 @@ public class SimpleTriggerCommandDTOToSimpleTrigger implements Converter misfireInstruction.getNum() == num)
+ .findFirst().orElseThrow(() -> new IllegalArgumentException(num + " is not a valid misfire instruction code!"));
+ }
+
+}
diff --git a/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/dto/TriggerCommandDTO.java b/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/dto/TriggerCommandDTO.java
index 8100820..22f6405 100644
--- a/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/dto/TriggerCommandDTO.java
+++ b/quartz-manager-parent/quartz-manager-starter-api/src/main/java/it/fabioformosa/quartzmanager/api/dto/TriggerCommandDTO.java
@@ -23,4 +23,7 @@ public class TriggerCommandDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
private Date endDate;
+
+ private MisfireInstruction misfireInstruction = MisfireInstruction.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT;
+
}
diff --git a/quartz-manager-parent/quartz-manager-web-showcase/pom.xml b/quartz-manager-parent/quartz-manager-web-showcase/pom.xml
index 0ebdb19..ad6d2bb 100644
--- a/quartz-manager-parent/quartz-manager-web-showcase/pom.xml
+++ b/quartz-manager-parent/quartz-manager-web-showcase/pom.xml
@@ -31,10 +31,10 @@
it.fabioformosa.quartz-manager
quartz-manager-starter-ui
-
- it.fabioformosa.quartz-manager
- quartz-manager-starter-security
-
+
+
+
+