Closed (works as designed)
Project:
Activity
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Jul 2010 at 05:11 UTC
Updated:
11 Sep 2010 at 22:58 UTC
How can I integrate with workflow module?
We have an internal workflow which allows the author to keep a node unpublished. We want to generate activity only after a node is published and not when it is created.
Any suggestions?
Comments
Comment #1
sirkitree commentedI think this is basically a duplicate of #582230: Add in publish/unpublish support per activity
Comment #2
ajayg commentedActually it is similar but not duplicate. Workflow publishes the node in drupal sense but keep it not accessible untll some state is reached. So just publish/unpublish won't be sufficient, but could be further extended based on that work to support workflow.
Comment #3
Scott Reynolds commentedthen it will have to be achieved with a hook_activity_record_alter(). in there you adjust the $record->status based on the custom rules. and then once the node is finally 'workflow published' db_query("UPDATE activity SET status = 1 WHERE nid = %d");
Well it might be worth while to also check the activity.uid user to make sure that that user isn't blocked.
Comment #4
Scott Reynolds commentedBTW as a matter of principle, Activity is always created when the node is created. It will though maintain a status bit so that can be adjusted and leveraged in your View(s).
Can you imagine all the crazy workflows people have and having to match all those workflows for each node?
Comment #5
ajayg commentedHmm. IMHO activity should be created when an "event" happens. And then let the integrating modules etc or a different layer decide what that "event" is. So by default node creation is an event but activity should not be tied to event creation. Because activity is just like a "watchdog" entry with some sophistication. So by allowing activity to be attached to node "creation" you are adding something in activity which does not belong there.
I can see your point about workflows. That is why actually activity should not look after node creation or node publish or whatever. You almost need a separate logical layer to define that event. And activity can ship with some default layers like node creation etc.
Comment #6
Scott Reynolds commentedIt does right, It lets the node module determine when the event happens and what the event is. Workflow Module A can do the same thing if it likes. The node module is self contains all its necessary logic. The workflow module can model the same system as well.
Comment #7
sirkitree commentedPlease reopen if you have a patch for us to look at.