Hold job



Hold job is a processor that offers various time-based schemes for holding and releasing jobs and for distributing jobs across multiple outgoing connections.

Keywords

Keywords can be used with the search function above the Elements pane.

The keywords for the Hold job element are:


Connections

Hold job allows any number of outgoing move connections and offers additional properties on each of those connections.

Properties

Properties

Description

Job priority

The priority assigned to each incoming job; jobs with higher priority are released first; a greater number indicates a higher priority

Default means: use the job priority defined in the job ticket

The value of this property is converted to a floating point number; the Boolean value True and string values that commonly represent True convert to 1, the Boolean value False and any string values that don't represent a number or True convert to 0

Delay scheme

Select "Delay", "Release condition" or "None" in this drop-down menu to define the type of delay scheme you want to define

Delay: When you select "Delay", jobs are delayed for a certain period of time (specified in the subordinate properties), and a job becomes eligible for release only after it has resided in the input folder for at least the specified period of time

Release condition: When you select "Release condition", jobs become eligible for release only after the release condition has been evaluated to true (that is, it has satisfied the conditions which have been set in the subordinate properties)

Unit Select the unit for the time delay: Seconds, Minutes, Hours, Days
Delay Provide the job delay in the units indicated by the previous property.

You can enter an explicit value in the field or specify using the Define single-line text with variables or Define script expression dialogs available from the pop-up menu

Release condition

Specify the condition which should be evaluated to true before the job is released.

You can specify the value using the "Define condition with variables" or "Define script expression" dialogs available from the pop-up menu (making it possible for you to use values from Switch variables, metadata, a database or script expressions).

The release condition is executed repeatedly using N units. For example: if we set the delay as 5 minutes, the release condition will be checked every 5 minutes

Output order

Determines the order in which outgoing connections receive jobs (relevant only if there is more than one):


  • Cyclic: always in the same cyclic order

  • Random: in pseudo-random order

Outgoing connection properties

The following properties are provided for each of the outgoing connections in addition to the basic connection properties.

Property

Description

Connection priority

The priority of this connection; a greater number indicates a higher priority; at any given time only the eligible connections with the highest priority will receive jobs

Folder constraint

If set to yes, this connection is eligible to receive jobs only when certain constraints on the target folder (specified in the subordinate properties) are met

Maximum job count

This connection receives a job as long as its target folder contains no more than this number of jobs after adding the job; a zero value means this constraint is disabled

Maximum file count

This connection receives a job as long as its target folder contains no more than this number of files after adding the job; a zero value means this constraint is disabled

Maximum folder size (MB)

This connection receives a job as long as its target folder's size does not exceedthis limit after adding the job; a zero value means this constraint is disabled

Target folder

The absolute path of the folder that should be checked for job count and/or size; Default means the connection's target folder
Note: Whenever a job arrives in the Hold job tool, Switch checks the Target folder. Jobs that are in between the Hold job tool and the Target folder are not taken into account for the constraint. To make sure that there are no jobs in between the Hold job tool and the Target folder, space the jobs apart for a certain period of time.

Time-of-day window

If set to yes, this connection is eligible to receive jobs only during a certain time of the day (specified in the corresponding properties)

Allow from (hh:mm)

The time-of-day window during which to receive jobs; the values are structured as "hh:mm" (hours, minutes) indicating a time of day on a 24 hour clock; an empty value means midnight; two identical values mean the connection is always eligible

Allow to (hh:mm)

Day-of-week window

If set to yes, this connection is eligible to receive jobs only during certain days of the week (specified in the subordinate properties)

Allow from

The days of the week (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) during which to receive jobs; two identical values mean the connection is eligible for that 1 single day

Allow to

Day-of-month window

If set to yes, this connection is eligible to receive jobs only during a certain day of the month (specified in the subordinate properties)

Day

The day in the month during which to receive jobs, as a number in the range [1 .. 31]; the default value of one means the first or the last day of the month (depending on the following property)

Relative to

Determines whether the day of the month is relative to "Start of month'" or "End of the month"

Space jobs apart

If set to yes, jobs moving over this connection are spaced apart by a minimum period of time (specified in the subordinate properties); example: after the connection receives a job it becomes eligible to receive another job only after the specified period of time has passed

Unit Select the unit for the subsequent property: Seconds, Minutes, Hours, Days
Delay The spacing delay in the units indicated by the previous property

Scheduling algorithm

The scheduling algorithm is executed whenever a new job arrives, at regular intervals:


  1. Determine J, the set of eligible jobs, to include all incoming jobs that have fully arrived and that have waited for at least the delay specified for the job (if any).

  2. If J is empty, there are no jobs to be moved – terminate.

  3. Sort the jobs in J on priority (higher priority first) and within the same priority on arrival stamp (earliest arrival first).

  4. For each job in J, in the sorted order, perform these steps:


    1. Consider A to be the set of outgoing connections.

    2. Determine B as the subset of A containing connections that can accept the job at this time (that is, the connection is not on hold and none of its constraints are violated).

    3. If B is empty, the job can not be moved at this time – skip to next job.

    4. Determine C as the subset of B containing all connections with the highest priority that occurs within B. By definition all connections in C have the same priority and C is non-empty.

    5. Select one of the connections in C according to the selected algorithm (cyclic or random).

    6. Move the job along this connection.