- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:21 AM
Hello there, I'm trying to figure out, if there is some reliable way of finding the WF Context in BR which has no relation to running WF or RITM.
The scenario:
I have a cat item which takes an xls file, uploads this file into data source, triggers the import into target table. There is a Wait for event action inside WF, this event needs to be triggered from onComplete transform script. Now how do I find the reference to the correct WF Context when I don't know the RITM id inside this onComplete script.
The reason is that I need to update some WF scratchpad values inside the onComplete script before the WF Wait for event action is triggered.
Right now I'm storing the RITM ID inside out internal config field, which is not acceptable:
getWfContext: function() {
var contextGR = null;
var wfContextGR = new GlideRecord("wf_context");
if (wfContextGR.get("id", this.gvsIntmUtils.getConfiguration("qualys_result.load_xls.current_ritm_id"))) {
contextGR = wfContextGR;
}
return contextGR;
}
Thank you for any help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:41 AM
Hello,
If you are parsing that excel and running transform map through script after submission of catalog item you must be gliding sys_attachment table to get the attachment which is attached to that RITM that gets created after submission and copy that attachment from RITM to data source which will run the transform map
So if this is the process that you are following , we can glide to sys attachment table again with and get the RITM sys_id which is stored in table_sys_id field and use it in wf_context table
Not sure if this works but give it a try
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:24 AM
Hello,
May i know what is the target table here is it RITM ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:41 AM
Hello,
If you are parsing that excel and running transform map through script after submission of catalog item you must be gliding sys_attachment table to get the attachment which is attached to that RITM that gets created after submission and copy that attachment from RITM to data source which will run the transform map
So if this is the process that you are following , we can glide to sys attachment table again with and get the RITM sys_id which is stored in table_sys_id field and use it in wf_context table
Not sure if this works but give it a try
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 07:32 AM
Thats a good idea, thank you for your help, I'll use this solution.
Thank you for quick reply. The target table is custom table.