I am attempting to create shared (sub) workflows which other users could reuse them to do common tasks. What would be the best/proper way to pass variables that would work as parameters to these sub-workflows?
Atm I am using instance variables, but I have a major issues with it. The following workflow, for example:
Both sub-workflows use the instance.vars.parameter. Internally, on my sub-workflow, I would build a logic that halts the execution if the variable/parameter is not properly set. But, if the user forgets to set it on the second fork path, it will use the same instance.vars.parameter value of the first fork path.
Does anyone have any suggestions on how to approach it?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
AFAIK it's just instance.vars available to sub-workflow, though can also use xtk:option with get/setOption().
Set a diff parameter for each path?
Thanks,
-Jon
Hi,
AFAIK it's just instance.vars available to sub-workflow, though can also use xtk:option with get/setOption().
Set a diff parameter for each path?
Thanks,
-Jon
Considering the workflow description field
As a sub-workflow is not going to be "readable" but the template, I propose another solution for the description field.
Using the sub-workflow activity, place your configuration code as JSON:
subWorkflow.desc = JSON.stringify({ myVariable: "some value" });
Then within the workflow template (sub-workflow) read that config from the description field:
var wkfConfig = JSON.parse(instance.desc);
Regards.
Views
Replies
Total Likes
I tried this approach and it did not work for me.
I would like to call a subworkflow from a campaign, send the campaign internal name to the subworkflow, and pull that into the subworkflow query which builds a report for that campaign that was passed to it.
What code can I add to the subworkflow script that would pull instance.operation.internalName
and then what code do I need in the Javascript activity in the subworkflow to pull out that internal name and pass it to the query?
Matthew
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies