[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.13.5 Hlate condition

An `hlate' condition is used to cancel a task execution at a specified time if other conditions are not validated.

To illustrate this, we will create a referential with two tasks `t1' and `t2', which will wait a `manual' condition and an `hlate' condition. Then, we will validate the `manual' condition of the first task. This task will start immediatly. Then, we'll wait until the time which is defined in the `hlate' condition, and we'll see that the task is canceled.

First, we start the deamons, if this is not already done. Then, we create the referential and the first task `t1'.

 
$ dio87c ra r1
$ dio87c rta r1 t1
$ dio87c rtoa r1 t1 add always
$ 

We add the two conditions to the task `t1'. The first is a `manual' condition and waits for a external confirmation. The second is a `hlate' condition : the task will wait until 5:55 PM and will be canceled.

 
$ dio87c rtca r1 t1 manual "READY FOR EXECUTION"
$ dio87c rtca r1 t1 hlate "17:55" 0
$

When we add the `hlate' condition, the last parameter (`0') indicates for which day this condition must be evaluated. Here, the value `0' indicates that we are waiting 5:55 PM the first day. If we want to wait until 5:55 PM of the next day, we should use `1' instead.

Now, we create the task `t2' by copying the task `t1' (rtd). Then, we create a day `d1' from our referential :

 
$ dio87c rtd r1 t1 t2
$ dio87c xdl
$ dio87c rp r1 "2004-11-04" d2 
$

The two tasks are waiting for conditions :

 
$ dio87c -- xtl -s d2 
t1      wait_for_condition
t2      wait_for_condition

We validate the `manual' condition (`READY FOR EXECUTION') of the first task and we check that the task `t1' is running :

 
$ dio87c xtcv d2 t1 manual "READY FOR EXECUTION"
$
$ dio87c -- xtcl -s d2 t1
manual     READY FOR EXECUTION    finished
hlate      17:55     +0         waiting
$
$ dio87c -- xtl -s d2 
t1      terminated
t2      wait_for_condition
$

We wait until 5:55 PM and we check that the task `t2' is canceled :

 
$ date
jeu nov  4 17:55:29 CET 2004
$
$ dio87c -- xtcl -s d2 t2
manual     READY FOR EXECUTION    waiting
hlate      17:55   +0           finished
$
$ dio87c -- xtl -s d2 
t1        terminated
t2        canceled
$


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by dom on September, 11 2005 using texi2html