Event-driven bulk updates using VBO and Rules

Here's the situation: when a change occurs on a node, you want to modify a bunch of related nodes accordingly. On my site, when a Job's state moves from "accepting proposals" to "in progress", I want to change all pending Job Offers (those that haven't been accepted yet) to "closed".

Dynamic transitions with the Workflow module

Workflows are a basic building block of business applications. While the Workflow module provides a good base to start building workflows in Drupal, it has not kept up with the rise in complexity of Drupal application requirements.

Central to a workflow is the notion of state transition: when does a "Job Bid" node move from state "Proposed" to state "Accepted" or "Rejected"? Who can trigger this transition? There are obviously n2 possible transitions for an n-state workflow, making what is commonly called a state transition matrix.

Calling actions manually

Actions are a convenient way to package functionality in reusable chunks that can be called upon specific events. Countless modules expose actions, and at least the following consume them:

  • Trigger
  • Rules
  • Workflow
  • Views Bulk Operations

I found it useful to manually call actions in the business logic as well, typically during form submissions or in hook_nodeapi.

Syndicate content