Hey,
As we've talked there is a strong use case for creating triggers that integrate with rules to perform back-end workflow jobs. The results of this can be highly flexible. Mails can be sent to users, messages can be sent, system messages can be set, and nodes can be flagged that can show listings of users because of flag relationships in views.
(For example: Have a hidden flag that can be triggered when a user RSVP's to a node via node invite. Using rules, that user flags the node behind the scenes (they never see it). Views are then used to show the user who has flagged that node, thus creating a list of users who have RSVP'd in views, no muss, no fuss.
The basic step that facilitates this functionality is writing some triggers that integrates with rules module. Essentially, the triggers should be as follows (in my opinion).
1. If a site user is invited to the node (via the userreference functionality).
2. If a site user replies to an invite, I.E. receives invite and RSVP's to it.
3. If a site user replies to an invite and shows interest/chooses 'maybe' option (if node invite has this, I might be getting this mixed up with RSVP).
I'll try to think of some more in a few and reply back.
What do you think about this?
Thanks!
Comments
Comment #1
rc2020 commentedThe normal trigger/actions module isn't too effective in generating complex workflow. The Rules module (http://drupal.org/project/rules) is far superior, and I think that should be the method to write the triggers.
I looked through the documentation and I have made some headway on this. I added this code at the bottom of node_invite.module and the event populates in the rules selection just fine.
Essentially, this works when a piece of code is fired in the module file. To make this trigger 'work' so I.E. rules knows when it's about to happen, this code is excecuted:
So essentially, as per the rule I wrote above, when "A user is invited to a node, execute this code." For testing purposes, where on the module is the function that invites the user to the node, so I can capture these variables for testing? (Obviously final incorporation would work differently but I want to get it working first!).
Thanks!
Comment #2
rc2020 commentedI have completed this. I'll be figuring out how to include it in a patch shortly.