Rules development status

fago's picture

This page will be updated, so you can track the development status here.

Improvements in comparison to workflow-ng:

Data Types:
Arguments had an "entity type" in workflow-ng. This has been changed to data types, so that it fits also for primitive data types like strings and numbers. So rules contains support for the usual data types like node and user, but in contrast to workflow-ng it also treats strings as data types.
Also a lot of internal code has been restructured and improved - now rules is keeping an internal array of variables.
Status: implemented

Writing conditions / actions:
Writing conditions and actions has become even easier. Thanks to input evaluation system (see below) you don't have to care about token or php evaluation yourself. Furthermore you don't need to specify the to be saved settings like before in workflow-ng anymore, as rules will generate useful default settings for you, which can be altered if desired.
As now data types like "string" are also supported one can also add needed strings to the argument list. For such primitive data types rules will provide a form for entering the data, which can be overridden and customized by the action. You need not do this, but in some cases it can be useful, e.g. for integrating with existing systems already specifying these arguments like the services module.
Also providing new variables has been simplified and works more straight forward.
Status: implemented

Evaluated input:
For the token integration rules will come with an input evaluation API and implementations for token and PHP input evaluation. So you can also do some simple php calculation in the input fields. Strings (and possible other data types) will be automatically evaluated so you don't have to care about this when writing actions.
Status: implemented. For token integration see this issue.

Rule Sets
The whole API has been overhauled to also work with rule sets - this are set of rules that work independent from events. So they are like a subroutine, which can be customized or also added by the UI.
Status: implemented

Rules supports an improved file inclusions system, which only includes the module integration files if necessary. Furthermore the internal caching system has been improved.
Status: Implemented, needs documentation.

Rules supports scheduled rule evaluation - so you'll be able to schedule everything.
Status: implemented, views integration is missing

Label callbacks:
Now label callbacks are supported for conditions, actions and new variables. So one can specify a better suiting label for configured conditions/actions, e.g. the "content is type" condition set to "page" will get the label "content is page". Of course one can still customize the labels per UI too.
Status: implemented

Drupal 6.x Actions support
Status: implemented

The previously just for developers logging of rule execution has been improved to look better and provide a better overview. There will be a setting for enable this logging, so this assists one during the creation of rules.
Status: implemented

Simple Tests
Rules comes with a small module, which comes with some simple tests - which test the API to work correctly.
Status: implemented

Port from workflow-ng status

  • Evaluation Engine [done]
  • Basic UI [done]
  • Port the whole module integration [done]
  • States [TODO]
  • CClinks [TODO]
  • Per Entity Logs [TODO]
  • Upgrade procedure [done]

Modules shouldn't start porting their integration not before the first BETA release is there.

Todo list before a first BETA release:
* write developer documentation [in done]
* implement scheduling [done]

Module integration status:
Node: ported
User: ported
System: ported
Comment: ported
Path: ported


Rules module - How to implement States ?

dooug's picture

Port from workflow-ng status

  • Evaluation Engine [done]
  • Basic UI [done]
  • Port the whole module integration [done]
  • States [TODO]

It appears the "States" from workflow-ng are still not ported to Rules?

Is there another way to accomplish a States driven workflow with Rules?

I found that the Workflow module handles workflow states well and integrates with Rules enough to accomplish what I was looking for.

D6 Workflow + Rules = almost there

dooug's picture

So using the Workflow and Rules modules gets me most of the way. I'm still blocking on a way to have a Rule based on a change in Workflow state. For instance, if the workflow on a node is pushed from "(created)" to "Approved", can I use that to trigger a rule?

Is it possible, by using mentioned modules or others, to set up a workflow that will trigger a Rule (or Action) when the workflow state is changed?

Rules + Workflow: Check state change

dooug's picture

Sorry, I keep answering my own questions. And these comments probably would make more sense somewhere else.

This page helped me out:

Brief summary of the solution I found:

  1. Use the "After updating existing content" Event.
  2. Set the condition to "Textual comparison".
  3. Compare values of the tokens [node:workflow-old-state-name] and [node:workflow-current-state-name] and negate.

This will check the condition that the workflow state is different. Other conditions might be necessary to limit to only when the state was just updated.

Catch: (this took me a bit to notice)
The Rules module Installation notes indicate:

To get token replacements in your actions, install the latest development snapshot of token! You need a snapshot which stems from >27.08.08

Quite Helpful

leoklein's picture

I found your one-way communication quite helpful :-)