In Drupal I'd like to s开发者_如何学Cet up a rule that only runs if a workflow state is changed to a specific state. For example, if an Application is marked as 'submitted' and was previous marked as 'draft', I'd like to execute a specific block of PHP.
Is this possible?
Yes, using the Rules module this is very simple. The Rules modules lets you test for the change of a specific fiel and test for its value, then run some action. You will need to create your own Action in module code and make it available to Rules so you can execute your own php code, there are some good examples, drupal.org/project/rules.
You should be able to use Rules without writing your own integration code as the Workflow Rules module, bundled with Workflow, does this.
精彩评论