An action consists of the following:
- The name of the action
- The actor performing the action
- The data context of the action
- The parameters of the action
- The actor performing the action
Let's look at these one at a time. First, the name of the action identifies both the handler (the class which will handle the action) and the specific action the class will take. For instance, the ``data'' handler is a front for the Workflow::wftk::Data class. The data handler knows how to add (add), modify (mod), and delete (del) records from a list. So the name of the action of adding a record would be ``data add'', with a space. Very simple.
The default action handler is the wftk's macro system. A repository may contain a macro list, the keys of which retrieve named macros. We will cover the macro system in a later section.
Next, the actor, which is the subject of the next chapter. Since any action is taken by an entity, we have to choice but to acknowledge the existence of this feature before actually describing it, but it's clear anyway: the actor is the person or program actually responsible for the action. This is one of the things used to determine whether the action will be permitted or not. If left blank (the default), then we presume this to be the anonymous user, which will suffice just fine for now. But in the next chapter we will look at this in much more detail.
Next, the data context. The data context of an action is the object in the repository that the action will take place in. That object stores the history of the action, and it provides the basis for data lookups. A data context is given as the list plus the key of an object in the system. The repository itself is the object with no list (blank) and no key (blank). A default list may be defined for the repository (e.g. ``cases'' or ``processes''), and then you can give just a key.
For actions which result in the addition of a record to a list, the key may be blank. In this case, the addition of the record will fill in the key, and the action system will pretend as though you'd meant that all along (that is, in logging and the like that key will appear).
Finally, the parameters of the action are an arbitrary record passed to it; the record can contain anything you need. The fields of the record may be templates, in which case they'll be evaluated in the context of the action.
(The action API
(Data actions
(The Perl action
