How to get the workflow context sys_id in the workflow for run script activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 04:44 AM
Hi,
I need to populate the u_context (referenced to wf_context) in the run script activity of the workflow,
but would need a way to get this into the workflow, any inputs?
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2018 03:22 AM
You can get context sys_id using : activity.context
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2019 01:54 PM
From experimenting with activity.context (inside a workflow activity), it looks like activity.context is a wf_executing GlideRecord for the current activity (activity.getTableName() return 'wf_executing'). Since wf_executing has a reference to the associated wf_context (via wf_executing.context), as benjilali states, you can get the wf_context sys_id for the currently executing activity via activity.context.sys_id. The 'activity' variable is a global to your executing workflow activities, similar to 'workflow' being a global to those same activities.