Cron Job not running in headless client.

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Cron Job not running in headless client.

Postby sabbatarian7 » Mon May 16, 2016 12:15 pm

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.
Talha,
Servoy Developer.
Servoy version 5.2.11
sabbatarian7
 
Posts: 4
Joined: Wed Feb 24, 2016 8:25 am

Re: Cron Job not running in headless client.

Postby jdbruijn » Tue May 17, 2016 10:08 am

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)
Jos de Bruijn
Focus Feedback BV
Servoy Certified Developer
Image
jdbruijn
 
Posts: 492
Joined: Sun Apr 11, 2010 6:34 pm

Re: Cron Job not running in headless client.

Postby sabbatarian7 » Wed May 18, 2016 9:02 am

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]
Talha,
Servoy Developer.
Servoy version 5.2.11
sabbatarian7
 
Posts: 4
Joined: Wed Feb 24, 2016 8:25 am


Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 2 guests