After some hard work, the workflow-ng API is ready.
It features
- actions, which may be configurable
- conditions, which may also be configurable
- support for multiple arguments, for actions as well as for conditions
- condition evaluation with logical operations like OR, AND and NOR
- events, for which conditions and actions can be configured. They may be contributed by modules.
- dynamic loading of needed arguments
- ordered conditions and actions - they are evaluated like they are ordered
- form API style configuration and processing of conditions and actions
Update
There is now a project for workflow-ng: http://drupal.org/project/workflow_ng To check it out, better use the developer documentation, which is up2date.Checking it out..
So if you are interested in this all, have a look at the API. I'm developing this in my sandbox, but I'm also attaching a module preview to this post. Note, that there is no UI yet, so this is likely only for interest for developers. There is also a README describing all the stuff a bit closer. The module currently comes with some simple testing/demonstrating conditions and actions, located in workflow_ng_tests.inc. Let's take a look at one example, Configuration 4: Notify the node author about changes from other users So this is an example of a module provided configuration of conditions and actions, which may be customized with the (not yet exisiting) UI module by users. First of we specify the new configuration and that it should be processed on 'node_update', an event defined in workflow_ng_events.inc. This event provides two user arguments, the currently logged in user as wells as the node author. So we configure a condition, that compares these two users and negate it, because we want to fire the action, if the users are not equal. Then we configure the action "workflow_ng_action_mail_node", which mails the content of a node to an user, so it needs to arguments, a node and a user. The '#argument map' property of the action configuration specifies, that we want to mail to the author, and not to the currently logged in user. At last point we add the conditions and the action to the configuration and we are done :)TODO
This all is already working fine, but there is still a lot of work todo: * Try achieving compatibility with drupal 6 actions * Write a lot of conditions, actions, events.. for drupal core and states. * Write flexible, token module enabled conditions and actions. * Write docs, docs and more docs. * Write a simple UI, that allows the configuration of conditions and actions. * Write a states CCK field with configurable state changes and state changes permissions.NodeProfile demo doesnt work...
Am I being thick as I cant make head nor tail of the Node Profile demo on the site. Cant really get past page 1 to be honest.
thanks. I've recently
thanks. I've recently installed the codefilter module and misconfigured the php input filter. fixed now. thanks
One action I'll be looking
One action I'll be looking for:
Copy a (CCK) field from one content type to another, while submitting a form. This can be used for example in a cart - When the users orders an item, automatically the Price field is copied from the Product into an Order Item content type.
Cheers,
Amitai