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

9.13.1 Manual condition

A `manual' condition holds a task until an external confirmation is given. This confirmation should come from an human or from an external program.

In this example, we will create a task which is holded by a `manual' condition.

If this is not already done, start each daemons:

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

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

Then we create a `manual' condition with the rtca command. The last parameter of the rtca command is a sentence which explains why this task is waiting :

 
$ dio87c rtca r1 t1 manual "READY FOR EXECUTION ?"

The rtcc returns the number of conditions of the task and the rtcl command print the list of conditions :

 
$ dio87c rtcc r1 t1
1
$ dio87c rtcl r1 t1
manual    READY FOR EXECUTION ?
$

We create a new day from our referential :

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

With the xtl -s command, we check that the task is waiting for condition and with the xtcl -s command, we print the list of conditions with the state of each condition :

 
$ dio87c -- xtl -s d1
t1         wait_for_condition
$
$ dio87c -- xtcl -s d1 t1
manual     OK      POUR EXECUTION ?      waiting
$

We validate the condition with the xtcv command. This command requieres the type of condition and the sentence which identifies it.

 
$ dio87c xtcv d1 t1 manual "READY FOR EXECUTION ?"

Now, we check that the condition is validated (`finished') and that the task is not waiting :

 
$ dio87c -- xtcl -s d1 t1
manual       READY FOR EXECUTION ?       finished
$
$ dio87c -- xtl -s d1
t1           terminated
$

You can add more than one `manual' condition to a task. The task will wait until all conditions are validated.

To illustrate this, we will remove the condition we just created and we'll replace it by two manual conditions. The command which kill a condition is xtck :

 
$ dio87c rtck r1 t1 manual "READY FOR EXECUTION ?"
$
$ dio87c rtca r1 t1 manual "CONDITION 1" 
$ dio87c rtca r1 t1 manual "CONDITION 2"
$
$ dio87c rtcl r1 t1
manual	CONDITION 1
manual	CONDITION 2
$

We create a day `d2' from our referential and we print the state of the task and the state of its conditions.

 
$ dio87c rp r1 "2004-11-04" d2 
$
$ dio87c -- xtl -s d2
t1       wait_for_condition
$
$ dio87c -- xtcl -s d2 t1
manual   CONDITION 1    waiting
manual   CONDITION 2    waiting
$

The two conditions are waiting. We validate the condition 2 with the xtcv command and we print the state of the task and of its conditions :

 
$ dio87c xtcv d2 t1 manual "CONDITION 2"
$
$ dio87c -- xtcl -s d2 t1
manual   CONDITION 1    waiting
manual   CONDITION 2    finished
$
$ dio87c -- xtl -s d2
t1       wait_for_condition
$

The condition 2 is validated (`finished'), but the task doesn't start because it's waiting for the condition 1. We validate this condition :

 
$ dio87c xtcv d2 t1 manual "CONDITION 1"
$
$ dio87c -- xtcl -s d2 t1
manual   CONDITION 1    finished
manual   CONDITION 2    finished
$
$ dio87c -- xtl -s d2
t1       terminated
$

All conditions are validated and the task can run.


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

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