
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 03:20 PM
I need to programmatically check if a workflow is running. I need to run a specific function when the workflow reaches the END state.
I am starting a workflow in a Script Include.
How can I check when the workflow has reached the END state in the same script?
var wf = new Workflow();
//Get the workflow id
var wfId = wf.getWorkflowFromName("Global Hostname Check if Taken");
var vars = {"u_hostname": "hostname123"};
var context = wf.startFlow(wfId, current, current.operation, vars);
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 10:03 PM
We usually glide record wf_context table and get the record using context id (you already have in above script). Now if that context is active means workflow is still running otherwise its end or canceled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 10:03 PM
We usually glide record wf_context table and get the record using context id (you already have in above script). Now if that context is active means workflow is still running otherwise its end or canceled.