Alerts and notifications
I toyed with the idea of considering notifications part of the normal process, but actually I don't think they should be.
First, a notification is not the same as a task -- it isn't something which hangs on the database until it's complete.
Instead, it executes conceptually instantaneously, sending a message at a particular point in time.
In general, then, I'd like to see two kinds of alert: one would simply be embedded somewhere (anywhere) and would send a
message whenever the control flow hit that point. The other kind would be analogous to a trigger, and would send a message
whenever a particular situation obtained. (Naturally, this would require a table of conditions to be maintained by the
engine, which would be scanned each time anything happened during the process. This needn't be considered horribly expensive,
as workflow processes are presumed to be very long in duration anyway.)
Logically it would be reasonable, given the presence of this condition-scanning table, to allow the administrator or
manager to attach an alert to any process or class of processes. In fact, it makes sense to allow that functionality to
anybody who can see a process. Thus if I'm following a process, I can simply tell the system, "Tell me when this
step completes" and this will create an alert for this particular process. If two alerts fire at the same time and should
go to the same person with the same method, then they are combined into a single message.
Which brings up the question as to how the alerts are actually done. Email is, of course, the obvious choice, but it may
also make sense to provide other mechanisms: perhaps a POST to a particular URL (convenient for alerting other systems),
or simply an entry in a task list local to the system. Another I've seen is the use of pagers, which would be supportable
using a POST to a URL but would be convenient to label as "page me". And another which makes sense to me is simply to
write some HTML to a file, to provide a status page. And finally, if we allow an alert to create a process or ad-hoc task,
then this alert mechanism is an excellent way to specify exception handling.
Anyway, an alert consists of fields, which are values or text. It also specifies its type (which allows the system to
find out how to perform the notification) and possibly a condition. If no condition is specified, then the alert fires
immediately; otherwise, it waits for its condition to become
true (or it waits until the block it occurred in goes out of scope; so for instance, a watch can be placed on a
particular sequence and it will disappear if its condition doesn't occur before the sequence ends.)
So the specification for the
<alert> tag is complicated enough that I'm giving it
its own page, too.
At various points, then, we've run into things that evaluate variables. For instance, a conditional construct has to test
the value of a variable. Whenever this is the case, we have to evaluate an expression. So how should expressions be
encoded? Well, the short answer at this point is, I don't know. It's not part of the XML specification, fortunately,
because XML doesn't support expression syntax well (there's no room for more than one complex parameter, for instance.)
Currently I'm thinking about Tcl. This is partly because I know it, partly because I'm intending to write the engine in C,
and partly because Tcl is easy to embed. However, embedding a full-scale scripting language in the engine means some
serious thought has to go into how it would interface and what it could do. So that might be overly ambitious. But the
fact remains that some way of expressing calculations like "a > 4 or b < 2" has to be included in a reasonable
implementation of a conditional. And if the conditional needs it then it might as well be available to everybody else.
This may have to wait until wftk 2.0, for all I know. If I come up with a good plan, you'll be the first to know -- and if
you come up with a good plan, I'd like to hear it.
The logical examples will be, of course, renderings of our usage
scenarios. Those are as follows:
(2/24/00) The DTD can be found here. I haven't tested it yet.