Hi All,
I have 2 JS activities in one workflow (Workflow A). I am trying to fetch the script within both the JS activities in another workflow (Workflow B) using [activities/js/script] field from xtk:workflow data schema using the below code.
var res = xtk.queryDef.create(
<queryDef schema="xtk:workflow" operation="select">
<select>
<node expr="[activities/js/script]"/>
</select>
<where>
<condition expr = {"@internalName = 'WKF123'"} />
</where>
</queryDef>).ExecuteQuery();
However, I see that the script field stores the code for only one JS activity. Is it possible to fetch the code within all the JS activities in one workflow?
There is another issue that I'm observing. When viewed in the Data tab of the xtk:workflow table, the [activities/js/script] field displays the code for JS activity 1. Whereas, when I fetch the same field within another workflow, I see the code for JS activity 2. Can someone please help me understand this behavior?
Thank you in advance.
Kind Regards,
Anushka RK
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hello @Anushka_RK
The activities are stored as an array.
This how you can get the code.
var workflow=xtk.workflow.load(WORKFLOW_ID);
var script1Code=workflow.activities.js[0].script;
var script2Code=workflow.activities.js[1].script;
Hello @Anushka_RK
The activities are stored as an array.
This how you can get the code.
var workflow=xtk.workflow.load(WORKFLOW_ID);
var script1Code=workflow.activities.js[0].script;
var script2Code=workflow.activities.js[1].script;
Views
Replies
Total Likes