So I am having a weird issue with the Actions + Workflow + Node Queue modules together that I hope you gurus out there can help me with.

I've got my node queue's setup, no problem, those work. I've got my workflows setup, no problem, that works. What I am having trouble with is adding the actions to the workflows. I add custom actions in the /admin/settings/actions/manage section - I have 6 actions created, all involving node queue adding/removing. Each Add/Remove set uses a different queue. What I'm not seeing is in the workflow actions - in the dropdown from transition changes ... is my custom actions. Has anybody ran into this?

Here's a couple of my MySQL tables showing the queue assignments of the actions:

 select * from actions_assignments;
+----------+--------------------------+-----------------------------------+--------+
| hook     | op                       | aid                               | weight |
+----------+--------------------------+-----------------------------------+--------+
| workflow | workflow-fitness-3       | workflow_select_next_state_action |      1 |
| workflow | workflow-video_article-5 | workflow_select_next_state_action |      1 |
| workflow | workflow-video_article-7 | workflow_select_next_state_action |      1 |
+----------+--------------------------+-----------------------------------+--------+

 select * from actions;
+-----------------------------------+---------+-----------------------------------+-------------------------------------+---------------------------------------------+
| aid                               | type    | callback                          | parameters                          | description                                 |
+-----------------------------------+---------+-----------------------------------+-------------------------------------+---------------------------------------------+
| 1                                 | node    | nodequeue_add_action              | a:1:{s:4:"qids";a:1:{i:1;s:1:"1";}} | Add to Articles Queue                       |
| 2                                 | node    | nodequeue_remove_action           | a:1:{s:4:"qids";a:1:{i:1;s:1:"1";}} | Remove from Articles Queue                  |
| 3                                 | node    | nodequeue_add_action              | a:1:{s:4:"qids";a:1:{i:2;s:1:"2";}} | Add to Videos Queue                         |
| 4                                 | node    | nodequeue_remove_action           | a:1:{s:4:"qids";a:1:{i:2;s:1:"2";}} | Remove from Videos Queue                    |
| 5                                 | node    | nodequeue_add_action              | a:1:{s:4:"qids";a:1:{i:3;s:1:"3";}} | Add to Real Stories queue                   |
| 6                                 | node    | nodequeue_remove_action           | a:1:{s:4:"qids";a:1:{i:3;s:1:"3";}} | Remove from Real Stories queue              |
+-----------------------------------+---------+-----------------------------------+-------------------------------------+---------------------------------------------+

I have obviously snipped out the default actions from the query on the actions table to just show my custom ones.

Any help would be appreciated!

Comments

weevilofdoom’s picture

Updating the aid in the database manually for the actions_assignments table seemed to do what I wanted - but anybody know why I can't select my action from the dropdown?

socialnicheguru’s picture

I am also interested in this

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.

weevilofdoom’s picture

I never did figure out why they don't add to the dropdown, but they do work if you update the assignments table with the correct actions id.

What you do is add the default action to the workflow - which is select next state. This adds the workflow and actions id to the actions_assignments table, then what you do is update the AID in the actions_assignments table with the AID of your custom action.

So in my case, you end up with:

select * from actions_assignments;
+----------+--------------------------+-----------------------------------+--------+
| hook     | op                       | aid                               | weight |
+----------+--------------------------+-----------------------------------+--------+
| workflow | workflow-fitness-3       | workflow_select_next_state_action |      1 |

As your default actions assignment. Assuming you have an aid of 1 as a custom action in the actions table as such:

+-----------------------------------+---------+-----------------------------------+-------------------------------------+---------------------------------------------+
| aid                               | type    | callback                          | parameters                          | description                                 |
+-----------------------------------+---------+-----------------------------------+-------------------------------------+---------------------------------------------+
| 1                                 | node    | nodequeue_add_action              | a:1:{s:4:"qids";a:1:{i:1;s:1:"1";}} | Add to Articles Queue                       |

You would then do a:

update actions_assignments SET aid=1 WHERE op='workflow-fitness-3';

(assuming you are using MySQL, change to fit DB type if you need).

This will set the correct action to the workflow - a little extra work, but at least it doesn't leave you stuck.