IBM Integration Bus, Version 10.0.0.17 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS


SLEEP function

The SLEEP function delays the execution of a message flow instance for a defined period of time, and returns a Boolean value to indicate whether the sleep completed without interruption.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-SLEEP--(--DurationExpression--)-----------------------------><

The SLEEP function returns TRUE if the sleep is completed for the specified duration without interruption, otherwise it returns FALSE.

The DurationExpression parameter specifies the number of milliseconds to sleep. It must be of INTEGER data type. If DurationExpression is NULL, the function returns NULL immediately without sleeping.

SLEEP cannot be called from inside an ATOMIC block because this would block other instances from having access to the shared resource. If such a call is attempted, FALSE is returned immediately.

The SLEEP function is automatically interrupted and returns FALSE, if a configuration or redeploy message for the flow arrives while the flow is sleeping.

Example

In the following example, SLEEP is called for 1000, if it is not interrupted for reconfiguration:
DECLARE returnValue BOOLEAN;
SET returnValue = SLEEP(1000); /* attempt to sleep for one second */

bk52030_.htm | Last updated 2019-07-13 08:13:49