Skip to content

How it Works

Overview diagram of schedule, parameters and the created limeobjects

For every recurrence of the schedule one lime object is created for each parameters row.

  • The schedule contains the scheduling parameters. When should objects be created? How often? And for how long? For instance: Every 2nd week.
  • The parameters contains values and relations that are different. Which lime objects should be related to the created lime objects? For instance: Company Contoso, Lime and Vandelay Industries are affected by the schedule.
  • The created limeobjects is the resulting limeobjects that are created based on the schedule. For instance: These work orders were created by this schedule.

Main Loop

The package has a scheduled task that runs every hour. It processes the the schedules using the following psuedo code:

  1. Foreach lime type that has been configured
    1. Foreach schedule of that lime type
      1. Skip if schedule not active
      2. Foreach date in that schedule
        1. Skip date if date <= lastcreated (meaning it has been run before)
        2. Exit loop if date > today() - createdaysbefore (meaning its not time to create it yet)
        3. Foreach parameter record of that schedule
          1. Create a new limeobject for the date and parameter
      3. Update lastcreated
      4. (optional) Create automatic history note

Recurrence

To support a wide range of complex schedules this package uses Recurrence Rules as described in the iCalendar Specification. This allows for great expressiveness of recurrence, such as:

  • Recur every year, month, week or day
  • Only on certain week days, months or week numbers
  • Max N times
  • Every other/second/third day, week, month, etc
  • Specific dates every month
  • Specific recurrences within a period, for example first/second/last day in a month

For example

  • Every second week
  • Last day every month
  • Second tuesday every month in june, july and august
  • The 5th and 25th every month
  • Wednesday week 5 and week 17

The details for the implementation in this package can be found in the technical section.

Schedule Editor

Editing the schedules in the web client is easily done with a purpose built web component. It includes an interactive preview of the dates.

Screenshot of the schedule editor

Automatic creation of history notes

If history configuration is set up in Lime Admin, a history note will be created and linked to the schedule when the schedule is run with information on how many limeobjects that were created for each date.

Created 1 Work order for 2021-05-01.

Templating

The limeobjects that are created from the schedule can be assigned values and relations from both the schedule and the parameters.

Which such properties that are copied can be configured through Lime Admin, it should work for any property type except hasmany.

There is also string substitution that takes place during this step, for example the title of a scheduledtodo could be set to Visit ${company} and the title of the todo would be Visit Lime Technologies.

Read more about the templating and substitution in the technical section.

Back to top