
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2015 01:06 AM
Hi all
I do want to trigger a sub-workflow out of a workflow. The workflow shall pass two parameters to the sub-workflow. How can this be achieved?
Input 1: action, select box, choices('create','update','delete');
Input 2: CI, list collector pointing to cmdb_ci
The Parallel Flow Launcher should trigger one sub-workflow for every CI selected in the list collector.
I did check the "Scrpt Workflow" checkbox. Inputs seems to be quite static, isn't it?
javascript:
coordinator = new WorkflowCoordinator( {workflow:'Workflow - Sub'} );
for (var i = 0; i < current.variables.var_list.length; i++) {
coordinator.add( {u_action: 'delete'} )
coordinator.add( {u_cmdb_ci: current.variables.var_list[i]} )
workflow.debug(current.variables.var_list[i]);
}
coordinator;
While testing the workflow the Parallel Flow Launcher fails: "Cannot start: no flows or already running? flows: 0, running: 0".
What is the proper way to trigger n sub-workflows passing multiple inputs?
Cheers
-Luca.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2015 08:49 AM
I'm not sure which field you have this script in, Inputs or Workflow script field that appears after checking the Advanced checkbox? Make sure its in that Workflow script field, and you'll need to take out the javascript: line
Also, your loop is adding 2 subflows to the coordinator every pass through. I think what you want to do is add 1 subflow with 2 inputs.
coordinator.add( {
u_action : 'delete',
u_cmdb_ci : current.variables.var_list[i]
});
It should look something like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2018 12:37 PM
Hi: Where do you declare the inputs (such as u_action & u_cmdb_ci mentioned here) in the sub workflow? I'm not seeing where that's done. Thank you.