- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 02:38 PM
Has anyone seen this issue when scheduling a workflow within a scoped application?:
WorkflowScheduler undefined, maybe missing global qualifier
My workflows and activities are all created on a scoped app. Is it possible to create a Workflow Schedule and alter the back-end call? In log I see the line failing is:
var ws = new WorkflowScheduler(); ws.run();
I do not see a way to change this call from the Workflow Schedule table, however. Pretty certain the solution would be to make the call "new global.WorkflowScheduler();", however I do not see a place to change this script from the Workflow Schedules table.
The end goal is to schedule the workflows that are in the scoped app to run every X minutes.
Regards,
Neema
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 01:02 PM
Hi Neema,
Can you please try with below script
if (current.sys_scope.getDisplayValue() == 'Global') current.script = "var ws = new WorkflowScheduler();
ws.run();";
else current.script = "var ws = new global.WorkflowScheduler();
ws.run();";
Please put few log statements and check which line is getting executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 03:23 PM
Hi Neema,
Under Scheduled workflows, go to business rules for that table and you should be able to spot "Set Workflow scheduler script ", if you go to the script of that business rule you should be able to edit the above line var ws = new WorkflowScheduler(); ws.run(); as it is running from there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 03:40 PM
Hi Venkat,
Thanks for the prompt response.
In an effort to not change anything globally specced within my scoped app (which I believe will fail certification if I do so), I attempted to clone this Business Rule and add the Condition where if the Application is my scoped app, it will run my Business Rule.
I edited the line to be:
current.script = "var ws = new global.WorkflowScheduler(); ws.run();";
However, when executing the Workflow Schedule, it still provides the original error:
java.lang.SecurityException: WorkflowScheduler undefined, maybe missing global qualifier
Caused by error in <refname> at line 1
==> 1: var ws = new WorkflowScheduler(); ws.run();
Additionally, I went ahead and changed the global Business Rule "Set workflow scheduler script" to include the global identifier, and still get the same error, as if the change I made never took effect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 03:52 PM
Hi Neema,
Yes, you need to use global.WorkflowScheduler() and I just checked the WorkflowScheduler (script include). But the issue here is this scheduler is not defined in your custom application. It is still defined in global application and the condition to check the application name would not help here. So you need to define the scheduler in your custom application and call the script include from there using global namespace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 04:02 PM
Hi Venkat,
I am not quite sure I understand fully... This is my setup:
I have a Workflow Schedule created within my scoped application:
I have a Business Rule also created within my scoped application that should call the "WorkflowScheduler" script include using the global namespace.
Do I also have to clone the "WorkflowScheduler" script include within my scoped app? What steps am I missing? To me it seems like my scheduler is defined in the custom application and should be using the Business Rule that has the condition which says "Application == My Scoped App".
Thanks,
Neema