[Gbbopen-list] agenda-shell trigger-event spec

Dan Corkill corkill at gbbopen.org
Sat Nov 10 03:29:56 EST 2007


Paul Werkowski wrote:
> So, lets say I have the agenda-shell running and one thing that can
> happen as a result of a KS execution is that a new space instance is
> created. I have a KS that has this:
> :trigger-events ((add-instance-to-space-instance-event
>                      unit-class :path (static foo-space)))
> 
> but I am stuck trying to figure out how to specify my dynamically
> created space. Can I use the wild card path markers in the :path
> specification? Something like :path (* dynamic foo-space)  ??

Yes.  The :path (or :paths) specification in a KS definition's
:trigger-events (and :obviation-events and :retrigger-events) is a
space-instance-path regular expression.  So, it is consistent with
add-event-function (and friends) and with space-instance-paths.
Specifically:

  The paths value is either the symbol t (indicating all
  space instances) or a list representing a regular expression
  where the following reserved symbols are interpreted as follows:
    =   matches one occurrence in a space-instance path
    ?   matches zero or one occurrence in a space-instance path
    +   matches one or more occurrences in a space-instance path
    *   matches zero or more occurrences in a space-instance path
    ^   move to parent

Unlike space-instance-paths, however, the :path/:paths in
add-event-function and in the three :xxx-events specifications in
define-ks are also matched against each space instance that is created
*after* the add-event-function or define-ks have been performed.  So,
you can specify an absolute path for a space instance that doesn't exist
but may be created later (as well as using a regular expression that
matches one or more space instances that may exist or be created in the
future).  The GBBopen Reference documentation for define-ks should
probably make clearer this parallel with the :path/:paths specification
used in add-event-function (and the add-event-function documentation
should probably make clearer the matching with yet-to-be-created space
instances).

Finally, note that you can also use ensure-ks to define/redefine a KS
programmatically, but I would recommend using ensure-ks only when the
above approaches do not accomplish your dynamic triggering requirements.

-- Dan


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Gbbopen-list mailing list