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

9.13.4 Hmax condition

A `hmax' condition is used to start a task at the specified time, even if some other conditions are not validated.

To illustrate this, we will create a task `t1' which is waiting for a `manual' condition and for an `hmax' condition. We will check that the task starts at the time specified by the `hmax' condition if the `manual' condition is not validated :

First, we start the daemons, if this's not already done :

 
$ dio87d -d
$ dio87d -d
$ dio87d -d
$ dio87d -d
$ dio87d -d
$

Now, we create a referential `r1' with a task `t1'. We add an `add always' operation to the task to select it automatically when a new day is created :

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

We create a `manual' condition and a `hmax' condition (to execute the task at 3 hours PM at the latest).

 
$ dio87c rtca r1 t1 manual "READY FOR EXECUTION"
$ dio87c rtca r1 t1 hmax "15:00" 0
$

The last parameter of the `hmax' indicates which day the condition is processed. In this example, the value of this parameter is 0 because we want that the task starts at 3 hours PM of the exploitation day. If we want to wait until 3 hours PM of the next day, we should use `1' instead.

We create a day `d1' from our referential. Then, we print the stat of the task and of its conditions :

 
$ dio87c rp r1 "2004-11-04" d1 
$   
$ dio87c -- xtl -s d1
t1       wait_for_condition
$
$ dio87c -- xtcl -s d1 t1
manual   READY FOR EXECUTION      waiting
hmax     15:00   +0             waiting
$

The task is waiting for the validation of the manual condition (`READY FOR EXECUTION') until 3 hours PM.

We validate the `manual' condition before 3 hours PM and we check that the task is running :

 
$ dio87c xtcv d1 t1 manual "READY FOR EXECUTION"
$
$ dio87c -- xtcl -s d1 t1
manual      READY FOR EXECUTION        finished
hmax        15:00     +0             waiting
$
$ dio87c -- xtl -s d1
t1          terminated
$

The task is terminated. Now, we create a second day `d2' :

 
$ dio87c rp r1 "2004-11-04" d2 
$
$ date
jeu nov  4 14:20:19 CET 2004
$
$ dio87c -- xtcl -s d1 t1
manual     READY FOR EXECUTION      finished
hmax       15:00     +0           waiting
$
$ dio87c -- xtl -s d2   
t1         wait_for_condition
$

We wait until 3 hours PM and we print the stat of the task and of its conditions :

 
$ date
jeu nov  4 15:00:02 CET 2004
$
$ dio87c -- xtcl -s d2 t1
manual      READY FOR EXECUTION     waiting
hmax        15:00     +0            finished
$
$ dio87c -- xtl -s d2 
t1          terminated
$

The `hmax 15:00 +0' condition is validated and the task `t1' is terminated.


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

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