Message:

Subscribe rss
Blog categories
All | Backendless features
Feature 110: Creating custom business logic timer with console
April 28, 2015 by markpiller
Spread the love

In my previous post I wrote about Backendless server-side timers – blocks of code which run on – pre-defined schedule. A timer is a Java class and can be created by hand. The most tedious part is figuring out the scheduling definition. Currently it is done by declaring the timer’s schedule through a JSON object in the class’ annotation. Backendless console significantly simplifies this process through a built-in code generator. To create a timer:

  1. Login to Backendless console, select your app and click the Business Logic icon.
  2. Click Timers in the menu on the left.
  3. Click the Add Timer button:
    creating timer - Feature 110: Creating custom business logic timer with console
  4.  The New Timer popup supports every single scheduling option. For example, creating a timer which runs only once:
    run once - Feature 110: Creating custom business logic timer with console 

    A timer that runs every two days:
    every 2 days - Feature 110: Creating custom business logic timer with console

    A timer that runs every 2 weeks on Mondays and Thursdays:
    every 2 weeks - Feature 110: Creating custom business logic timer with console
    A timer which runs every February, May and September on the first and last Sunday of these months:
    monthly timer - Feature 110: Creating custom business logic timer with console

Whatever the scheduling selection happens to be, enter a name for the timer, optionally select an expiration date/time and click Save.

Backendless automatically generates the source code for the timer and lets you download the entire project with all the sources and dependencies – a huge timer saver!
timer source - Feature 110: Creating custom business logic timer with console

Now that you know how to write or generate Timer code, you are ready to proceed to adding custom code to it. This will be the subject of a future post.

Enjoy!

Share this post
Tweet about this on TwitterShare on FacebookGoogle+