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

9.13.3 Hmin condition

A `hmin' condition is used to hold a task until the specified time. The other conditions of the task are not evaluated before the specified time.

We create a referential `r1' with a task `t1'. We add an `add always' operation to this task to select it automatically in every new days :

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

We add a `hmin' condition to force the task to wait until 10:00 PM :

 
$ dio87c rtca r1 t1 hmin "10:00" 0

The last argument of the rtca command indicates the day where the condition is processed. In this example, the value of this parameter is 0, it indicates that we should wait until 10 hours of the exploitation day. If we want to wait until 10 hours of the next day, we should use 1. To wait until the second next day, we should use 2.

We will check that by adding a second task `t2' which will wait until 2 hours PM of the next day :

 
$ dio87c rta r1 t2
$ dio87c rtoa r1 t2 add always
$ dio87c rtca r1 t2 hmin "14:00" 1
$ 
$ dio87c rtcl r1 t2
hmin     14:00    +1
$

Now, we can create a day `d1' :

 
$ dio87c rp r1 "2004-11-04" d1 
$

If you have created this day before 10 hours AM, then the task `t1' is waiting for condition and the `hmin' condition is waiting :

 
$ dio87c -- xtl -s d1
t1	wait_for_condition
t2	wait_for_condition
$
$ dio87c -- xtcl -s d1 t1
hmin    10:00    +0    waiting
$

At 10 hours AM, the `hmin' condition of the task `t1' is validated and the task `t1' starts :

 
$ dio87c -- xtl -s d1
t1      terminated
t2      wait_for_condition
$
$ dio87c -- xtcl -s d1 t1
hmin    10:00   +0      finished
$

On the other hand, at 2 hours AM, the task `t2' is always waiting for condition and the `hmin 14:00 +1' is not validated. The task is waiting until 2 hours AM of the next day.

If you want to force the execution of a task which is waiting for a condition, you just have to validated this condition with the xtcv command. To illustrate this, we will force the condition which holds the `t2' task :

 
$ dio87c xtcv d1 t2 hmin "14:00" 1
$ 
$ dio87c -- xtcl -s d1 t2
hmin    14:00     +1     finished
$
$ dio87c -- xtl -s d1
t1      terminated
t2      terminated
$

The `t2' task, which was waiting until 2 hours PM of the next day, is now terminated.


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

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