EMA-XPS Online


DEFINE-TASK

DEFINE-TASK
===========

syntax: (define-task <task-name>
           <task-arguments>
           [:DOCUMENTATION <documentation>]
           [:EXPLANATION <explanation>]
           [:SUBTASKS {nil | (<task-name>*)}]
           ACTIONS <task-actions>)

Warning: The explanation facility is not sup-
         ported, hence :explanation and :subtasks
         are ignored.

With the definition of tasks can be defined,
how to get the knowledge from the base of
knowledge. A special task, which has to be
executed, when the consultation of the base
of knowledge is started, has to be given as
a starting task. Every task without parameters
can be used as a starting task. Tasks can
give parameters to other tasks and can activate
the other tasks. Tasks send back a value after
they have been executed. Tasks have names and they
always belong to a knowledge base.


ACTIONS

Describes the action part of a task. Here you
can use all babylon- and lisp-expressions and
additional 2 special lisp-expressions:

(start <task-name> [<task-argument>*])

starts the task <task-name> with the neccesary
parameters as given arguments <task-arguments>.

(stop-this-task <task-return-value>
        <task-return-code>)

Warning: the <task-return-code> is ignored,
         because EMA-XPS handles task control
         in a different way!

Stops the execution of the recent task. It has
two arguments. The first one is the value that
will be returned by the task. The second one
is setting the recent task state of the calling
task. This function is only for exceptional
cases, when the normal execution has to be
stopped.

example: >(define-task initializing-cities ()
             :subtasks ()
             actions
             (ask [AND [city _city]
               [country _city _country]] (tell
               [cities _country _city]))
             (ask [AND [city _city] 
               [offer _city _x]]
             (tell [place _x _city])))
         >(define-task CONTROLL ()
             :subtasks (INITIALIZING-CITIES
                HOLIDAYOFFER GREETINGS)
             actions
             (start 'initializing-cities)
             (start 'greetings)
             (start 'holidayoffer
                (instance-of client)))


EMA-XPS Online