Page 1 of 1

Cron Job not running in headless client.

PostPosted: Mon May 16, 2016 12:15 pm
by sabbatarian7
Hello,
I have scheduled a cron job on solution open of a batch process.
Below is my call:
Code: Select all
plugins.scheduler.addCronJob(job_name, start_cron_timing, globals[start_method_name], null, null, [job_id]);


here, start_method_name is database field has stored the name of global method. Job is being scheduled perfectly as I have traced by setting DB Columns.
Also, this method is triggereing as smart client perfectly! but ASA I run it as batch process, it doesn't trigger.

Problem: Problem is that this method is not being triggered. despite of being in the global. What am I missing? I guess it is related to the method name.
Help is highly appreciated.

Thankyou.

Re: Cron Job not running in headless client.

PostPosted: Tue May 17, 2016 10:08 am
by jdbruijn
Couple of things you could do to check:
- does the batch processor have access to the module where your global method resides?
- does it work when you directly reference the globals function (globals.method_name)

Re: Cron Job not running in headless client.

PostPosted: Wed May 18, 2016 9:02 am
by sabbatarian7
jdbruijn,

Thanks for replying,
I figured it out, actually I was adding that cron job from a form.

My batch process flow was, OnOpen(Global) > Form > FormMethod (Schedule jobs) > Exit.

But job should be scheduled in Global method, not in form. (if that's not the only case then well, it worked for me). So I extracted all the form's working and placed it in globals and it worked perfectly.

Now flow is: OnOpen(global) > GlobalMethod > Schedule job > Exit [It is working]