Workflow + Events

Events happening in the community are now at Drupal community events on www.drupal.org.
bajakan's picture

I really want to make use of the workflow module just released for 5.x but must have the capability of triggering a state change based on some simple field matching criteria.

On Cron Run:
* foreach (condition) { if (condition.true) { execute state change; break; } }

I noticed a small _cron() method that is already doing state transitions based on pure schedule. I guess my main question here is what is the best way to approach this? Is someone working on something similar that I could help out with? Should I just code it up and submit it to the group for review?

This could be accomplished by adding a link to the UI to edit "triggers" for a workflow for a node type. So assuming you've setup the workflow and assigned it to a node type you could edit the triggers for that. That screen would go grab the form defined by {node-type}_form() and show a dropdown list with all the different form fields in it along with a match value to be the trigger.

Then during the nodeapi hook in workflow we test the triggers and execute the transitions very much similar to how it is currently done.

Comments

Look into the actions

mfredrickson's picture

Look into the actions module. Workflow uses actions to do specific things (e.g. email users, make a node published). Workflow itself exposes an action to "move to next workflow state". I'm not totally hot on the idea, but if you have to do a workflow transition, this can be useful.

I don't think this would be as useful in workflow, as it would be in a stand alone module.

I am very interested in your "rules" system. I'm picturing something similar for future versions of workflow. I'll be interested to see what you do here. Perhaps we can combine efforts.

Cheers,
-mark

I'm currently working on

fago's picture

I'm currently working on workflow-ng, which I think does something like you describe. The equivalent to your triggers are my "conditions" - if the conditions are matched you can fire any action, e.g. one that creates a state transition

workflow-ng trigger on cron?

tanc's picture

fago, I can't seem to find workflow-ng's cron trigger, does it exist? I want to do something very similar to what bajakan asked in the first post of this discussion. In my case I want workflow-ng to fire on each cron run, evaluate whether it is the beginning of the month and if so delete a db record.

+1

bneel's picture

+1

Workflow

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: