diff --git a/api/src/main/resources/schema/cron/crondef.json b/api/src/main/resources/schema/cron/crondef.json new file mode 100644 index 00000000..67bb43c5 --- /dev/null +++ b/api/src/main/resources/schema/cron/crondef.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "javaType": "io.serverlessworkflow.api.cron.Cron", + "description": "Schedule cron definition", + "properties": { + "expression": { + "type": "string", + "description": "Repeating interval (cron expression) describing when the workflow instance should be created" + }, + "validUntil": { + "type": "string", + "description": "Specific date and time (ISO 8601 format) when the cron expression invocation is no longer valid" + } + }, + "required": [ + "expression" + ] +} \ No newline at end of file diff --git a/api/src/main/resources/schema/schedule/schedule.json b/api/src/main/resources/schema/schedule/schedule.json index cbff7bde..d80d9908 100644 --- a/api/src/main/resources/schema/schedule/schedule.json +++ b/api/src/main/resources/schema/schedule/schedule.json @@ -8,8 +8,8 @@ "description": "Time interval (ISO 8601 format) describing when the workflow starting state is active" }, "cron": { - "type": "string", - "description": "Repeating interval (cron expression) describing when the workflow starting state should be triggered" + "description": "Schedule cron definition", + "$ref": "../cron/crondef.json" }, "directInvoke": { "description": "Define if workflow instances can be created outside of the defined interval/cron", diff --git a/api/src/test/resources/examples/periodicinboxcheck.json b/api/src/test/resources/examples/periodicinboxcheck.json index a2b6ecdd..1c5cdfc6 100644 --- a/api/src/test/resources/examples/periodicinboxcheck.json +++ b/api/src/test/resources/examples/periodicinboxcheck.json @@ -19,7 +19,9 @@ "type": "operation", "start": { "schedule": { - "cron": "0 0/15 * * * ?" + "cron": { + "expression": "0 0/15 * * * ?" + } } }, "actionMode": "sequential", diff --git a/api/src/test/resources/examples/periodicinboxcheck.yml b/api/src/test/resources/examples/periodicinboxcheck.yml index 117b4682..162a29ff 100644 --- a/api/src/test/resources/examples/periodicinboxcheck.yml +++ b/api/src/test/resources/examples/periodicinboxcheck.yml @@ -12,7 +12,8 @@ states: type: operation start: schedule: - cron: 0 0/15 * * * ? + cron: + expression: 0 0/15 * * * ? actionMode: sequential actions: - functionRef: diff --git a/diagram/src/test/resources/examples/periodicinboxcheck.json b/diagram/src/test/resources/examples/periodicinboxcheck.json index a2b6ecdd..1c5cdfc6 100644 --- a/diagram/src/test/resources/examples/periodicinboxcheck.json +++ b/diagram/src/test/resources/examples/periodicinboxcheck.json @@ -19,7 +19,9 @@ "type": "operation", "start": { "schedule": { - "cron": "0 0/15 * * * ?" + "cron": { + "expression": "0 0/15 * * * ?" + } } }, "actionMode": "sequential", diff --git a/diagram/src/test/resources/examples/periodicinboxcheck.yml b/diagram/src/test/resources/examples/periodicinboxcheck.yml index 117b4682..162a29ff 100644 --- a/diagram/src/test/resources/examples/periodicinboxcheck.yml +++ b/diagram/src/test/resources/examples/periodicinboxcheck.yml @@ -12,7 +12,8 @@ states: type: operation start: schedule: - cron: 0 0/15 * * * ? + cron: + expression: 0 0/15 * * * ? actionMode: sequential actions: - functionRef: