Dynamically create a maestro relationship to node and user
We already have the ability to create a drupal action to launch a maestro workflow and trigger that action from drupal. Maesto also has a trigger type task that can launch drupal actions from workflows but we did not have rules integration. We also needed a way to better track adhoc new instances of maestro processes with drupal entities like node and users.
Maestro has a content type task that automatically will create the relationship between the content node and maestro proceess information but there are cases where the maestro content type task is not used to create the content entities and we did not have an easy way to later link maestro processes with content nodes or other entities.
While we are still exploring creating a maestro entity and using hooks in the maestro module to automatically create a relationship between content entities and the workflow process, there has been some great work done on views, rules and now the relation module that I've been testing, which offers a lot of flexibily and addresses this need now.
I've put together a video that walks through creating a relation entity record that maps the node and user entity with the maestro process id. The relation entity record is created using a set of rules actions that will launch an adhoc instance of a maestro workflow and create the relationship to track the node and user with the new maestro process id.
This method can easily be used to extend the relation definition further with more fields to track state information at time of launching the maestro process. The rules integration that we have done for maestro also allows you to automatically set any maestro process variables at launch time if there is a matching variable in the set of rule actions. In the video, we have a rule variable called process_id but we could also have had one called node_type and if the maestro template had defined a variable of the same name, we could then use that for conditional testing or assignment in the maestro template.
Video Link: http://www.youtube.com/watch?v=Uu4DnA1Ikqk
Maestro Project Page: http://drupal.org/project/maestro
Relation Project Page: http://drupal.org/project/relation