Skip to end of metadata
Go to start of metadata

Introduction

  • The Cycle Instruction allows repetition of all or some of the jobs and additional instructions in a workflow.
  • The Cycle Instruction can be used:
    • to spawn the complete workflow,
    • to spawn a number of instructions and jobs in a workflow,
    • in a sequential way by using a number of Cycle Instructions within the same workflow,
    • in a nested way by embedding Cycle Instructions within the same workflow.
  • The Cycle Instruction offers versatile options for repeated execution and specification of how often this should happen.
  • Cyclic workflows are an alternative to use of JS7 - Schedules for cyclic orders.

Elements of the Cycle Instruction

The Cycle Instruction allows the specification of any number of cycles that define rule sets describing when job nodes and other instructions are to be repeated.

Each cycle allows the use of one the following cycle types:

  • periodical execution: allows the specification at periodic points in time, as e.g. for the 10th, 15th, 40th minute of each hour.
  • continuous execution: allows the specification of a fixed-length pause between repeated executions of the cycle.
  • ticking execution: allows the specification of fixed-length interval for repeated starts of the cycle.

In addition to any cycles included in a Cycle Instruction the rule set specifies:

  • the period begin of the cycle considering the Daily Plan's time zone,
  • the maximum duration for which the cycle is repeated, for example for 8 hours.

Cycles take account of the weekday which an order is scheduled for:

  • if the Cycle Instruction includes a rule set for the weekday of the order's scheduled date then this is considered by the Cycle Instruction and the order is made to wait for the first cycle to start.
  • if the Cycle Instruction does not include a rule set for the weekday of the order's scheduled date then the order skips the cycle.

Periodical Execution

This cycle type allows specification of both:

  • the period by which the cycle repeats: this can be for example 1 hour, 4 hours, 1 day etc.
  • the point in time for each repeat period when cycles start.

Download Workflow Example (.json upload)pdwCyclicSimpleWorkflowPeriodical.json


Explanation:

  • The property editor displays the summary information of the period.
  • The period is configured:
    • using a frequency, for example every day:
      • if an order's scheduled date (Daily Plan date) is not matched by a frequency then the order skips the Cycle Instruction,
      • otherwise the order considers the Cycle Instruction and, for example, waits for the start of the first cycle,
    • using period details to specify the start and duration of the period, e.g. at the start of the day for 23 hours,
    • using repeat details to specify, for example:
      • the repeat period of 1 hour,
      • the minutes for which the cycle is started in each repeat period.

When creating/modifying a periodical cycle then the properties can look like:


Explanation:

  • The cycle is of the periodical type, i.e. the cycle repeats within the given period at fixed points in time.
  • The period duration is 1h. 
  • The offsets when to start the cycle within the given period are specified by minutes: at each full hour, at each 15th, 30th and 45th minute of each hour.
  • The first cycle is specified to start at midnight, i.e. at the start of the day, in the workflow's time zone, with the last cycle being started 23 hours later.

Continuous Execution

This cycle type allows specification of:

  • a fixed-length pause between the end of a cycle execution and the begin of the next cycle execution - consider that the execution time of jobs spawned by a Cycle Instruction might vary between cycles,
  • a limit defining the max. number of cycles to be executed.

Download Workflow Example (.json upload)pdwCyclicSimpleWorkflowContinuous.json


Explanation:

  • The property editor displays the summary information of the period.
  • The period is configured:
    • using a frequency, for example every day:
      • if an order's scheduled date (Daily Plan date) is not matched by a frequency then the order skips the Cycle Instruction,
      • otherwise the order considers the Cycle Instruction and , for example, waits for the begin of the first cycle,
    • using period details to specify the start and duration of the period, for example, the start of the day for 23 hours,
    • using repeat details to specify, for example:
      • a 15 minutes break between cycles,
      • a limit of 10 repeated executions of the cycle.

When creating/modifying a continuous cycle, then the properties can look like:


Explanation:

  • The cycle is of the continuous type, i.e. the cycle repeats after a fixed-length pause between executions.
  • The pause between execution of cycles within the given period is specified to be 15 minutes.
  • The cycle is repeated for a maximum of 10 times.
  • The first cycle is specified to start at midnight, i.e. begin of day, in the workflow's time zone, with the last cycle being started 23 hours later or when hitting the limit specified.

Ticking Execution

This cycle type allows specification of:

  • a fixed-length interval between cycle executions - consider that the execution time of jobs spawned by a Cycle Instruction might vary between cycles,

Download Workflow Example (.json upload)pdwCyclicSimpleWorkflowTicking.json


Explanation:

  • The property editor displays the summary information of the period.
  • The period is configured:
    • using a frequency, for example every day:
      • if an order's scheduled date (Daily Plan date) is not matched by a frequency then the order skips the Cycle Instruction,
      • otherwise the order considers the Cycle Instruction and, for example, waits for the start of the first cycle,
    • using period details to specify the start and duration of the period, for example, at the start of the day for 23 hours,
    • using repeat details to specify, for example, a 2 minute fixed-length interval between cycles.

When creating/modifying a ticking cycle then properties can look like:


Explanation:

  • The cycle is of the ticking type, i.e. the cycle repeats after a fixed-length interval between executions.
  • The interval between execution of cycles is specified to be 2 minutes.
  • The first cycle is specified to start at midnight, i.e. at the start of the day, in the workflow's time zone, with the last cycle being started 23 hours later or when hitting the limit specified.

Use of Cycles with Daylight Saving Changes

The workflow's time zone determines if and when daylight saving changes occur.

Basically any cycles are configured by the begin and duration of a period.

If the start time of a period matches a daylight saving change:

  • in which the clock is forwarded by one hour then the cycle will start immediately. Assuming the clock to be forwarded from 2am to 3am then the cycle starts at 2am with the order history indicating 3am as the start time. The duration of the cycle's period is unaffected by daylight saving changes. For example, if the duration is specified to be 3 hours, then on a day for which the clock is moved forward at 2am to 3am the cycle will be executed until 6am.
  • in which the clock is set back by one hour then the cycle will start according to its repeat interval. Assume the clock to be set back from 3am to 2am then the cycle starts at 2am with the order history indicating 2am as the start time. The duration of the cycle's period is unaffected by daylight saving changes. For example, if the duration is specified to be 3 hours, then on a day for which the clock is set back at 3am to 2am the cycle will be executed until 4am.

Cyclic Workflows vs. Cyclic Orders

Note that the Cycle Instruction allows creation of cyclic workflows as an alternative to the use of JS7 - Schedules for cyclic orders.

  • Execution
    • A Cycle Instruction spawning a complete workflow is an equivalent to a cyclic order from a Schedule.
    • In addition, a Cycle Instruction can be used to execute parts of a workflow in cycles.
  • Efficiency
    • Schedules create a number of order instances for each period in a cycle, Running a single workflow every 30s counts to 2880 orders per day.
    • Cycle Instructions cause cyclic execution of a workflow from a single order.
    • Processing of cyclic workflows is by far more efficient than the use of cyclic orders.
  • Error Handling
    • Failure
      • If a job in a workflow fails then this will occur for each individual order instance of a cyclic order.
      • If a job within a Cycle Instruction fails then, depending on the error handling in place, any cycles that would occur while an order is in a failed state will be skipped.
    • Notification
      • For each failed order instance of a cyclic order a JS7 - Notification is created.
      • For the single order of a cyclic workflow a single Notification is created.
    •  Intervention
      • Any operations on cyclic orders are applied to all order instances including, for example, resuming execution after failure. This results in parallel execution of orders previously scheduled for execution in intervals.
      • For cyclic workflows there is a single order that waits for user intervention.
  • Logging
    • For each order instance of a cyclic order a separate entry is created in the JS7 - Order History and in the JS7 - Task History.
    • For a cyclic workflow there is a single entry in the Order History. The log output of each cycle is appended to this entry. Individual entries per job execution are added to the Task History.



  • No labels