Show TOC

Procedure documentationPrecondition Functions Locate this document in the navigation structure

 

Preconditions are used to determine if a step or job in a job chain is to be started or skipped.

The precondition is a boolean function (it returns "true" or "false") which is written in Redwood Expression Language.

When the precondition function returns:

  • "true" or no precondition is defined, the step or job is started.

  • "false", the step or job is skipped.

Note Note

Expressions always start with an equals sign (=).

End of the note.

Procedure

  1. Choose   Definitions → Job Chains  

  2. From the context menu, choose Edit.

  3. Select a step or job and choose Edit Step or Edit Job

  4. Choose Precondition and fill in an expression

  5. Choose Save and Close

Example

In this example, a test is done to see if the time window System_WorkDays is open at this time. The function Time.now() returns the current system date time in the specified time zone. The function Time.isTimeWindowOpen(time, time_window ) tests if the time window time_window is open at a given time time.

In the below example the following is true:

  • Time window System_Week_WorkDays is open on workdays only

  • The time now Time.now('GMT') is 2009/08/23 10:50:44,910 GMT

If the following expression is false the job is skipped:

=Time.isTimeWindowOpen(Time.now('GMT'), 'System_Week_WorkDays')