Copy a worklow-ng workflow to do same actions on create content as update
Workflow-ng has no duplicate functionality at this time, nor can you have it triggered on two or more events (or even edit the event). However, you can export the current set-up (configuration) that you like.
From the export tab: admin/build/workflow-ng/0/export
array (
'cfg_3' =>
array (
'#type' => 'configuration',
'#altered' => false,
'#event' => 'node_update',
'#label' => 'Add an organization',
'#active' => 1,
'#module' => 'workflow-ng',
0 =>
array (
'#type' => 'condition',
'#name' => 'workflow_ng_condition_content_is_type',
'#settings' =>
array (
'type' =>
array (
'organization' => 'organization',
'profile' => 'profile',
),
),
'#label' => 'Content has type Profile or Organization',
'#argument map' =>
array (
'node' => 'node',
),
),
1 =>
array (
'#type' => 'condition',
'#name' => 'workflow_ng_condition_token_numeric',
'#label' => 'Is add org checkbox checked numeric comparison',
'#settings' =>
array (
'operation' => 'greater',
'used arguments1' =>
array (
0 => 'node',
),
'text1' => '[node:field_add_org-raw]',
'used arguments2' =>
array (
),
'text2' => '0',
),
),
2 =>
array (
'#type' => 'action',
'#name' => 'workflow_ng_action_drupal_goto',
'#settings' =>
array (
'path' => 'node/add/organization',
'force' => 1,
'path_args' =>
array (
),
),
),
'#name' => 'cfg_3',
),
)
Make a few key changes:
The current workflow number (cfg_N) in two places, to a higher one than presently exists, the key of the first nested array:
array (
'cfg_3' =>
array ( ...
Becomes:
array (
'cfg_5' =>
array ( ...
The same for the name:
'#name' => 'cfg_5',
And then what you actually want to modify in the workflow config. In Agaric's case, the event handler or trigger, changing from node_update to:
'#event' => 'node_insert',
You may also want to change #label.
Then copy and paste it into the import tab:
admin/build/workflow-ng/0/import
And you should have your copy of your workflow.
Comments
Post new comment