Rule groups

Rules > Rules manager > Rule groups

A rule group is a way to locate several rules together that eases the organization of such rules, or a way to schedule some of them. The groups are shown as a list in the Groups section of the Rules manager.

Create a group

Click on the New button and type a name. You can later double-click it to change it.

Expand the Groups section to display the Type column and note that the group has been created as Type Normal by default.

There are three different types of group:

  • Normal. Its function is to simply organize rules. For example, the application administrator creates a group called "Product" to store several rules that act on fields of the "Product" table.

  • Only scheduled. A scheduled group is used to put together a number of rules that need to be periodically triggered and evaluated by the server at a certain interval of time (Hour, Day, Week, Month or Year, server time), based on the specified criteria. Note that all rules in this group are scheduled at the same time, i.e., a rule cannot be individually scheduled. Naturally, if desired, it is possible to define a scheduled group that contains a single rule.

  • Normal and scheduled. Similar to the one above, but the rules placed into this group will not only be triggered on a regular basis by the server, but also by the users on forms or via imports whenever the conditions are met.

Example of how "Normal and scheduled" rules are evaluated depending on their interval and user triggering
Server date and time Case

31-Aug-15 22:58

Scheduled rule "SchR1" was saved in Rule group "N&SchGH" with Hour interval.

Scheduled rule "SchR2" was saved in Rule group "N&SchGM" with Month interval.

31-Aug-15 23:00

New hour, but no evaluation is done by the server as the scheduler polls every 5 minutes (default time, but configurable per server, counted from the moment the scheduler was activated by the server administrator).

31-Aug-15 23:01

5 minutes have passed from the last poll (simulating it was a couple of minutes before saving the rules), and the scheduler now detects that an hour have passed. The server triggers "SchR1" and all other active rules in scheduled groups set to Hour interval.

31-Aug-15 23:02

The "SchR1" rule is triggered by a user fulfilling its criteria from an application form.

31-Aug-15 23:06

...23:11

...23:16 and so on

5 minutes have passed from the last poll, but the scheduler does not detect any new hour, day, month, etc. The server does not trigger any rule.

01-Sep-15 00:01

5 minutes have passed from the last poll, and the scheduler now detects that an hour and a month have passed. The server triggers "SchR1" and "SchR2" and all other active rules in scheduled groups set to Hour and Month interval.

If you decide to change the group to Type Normal and scheduled or Only scheduled, choose the time Interval and optionally set up a Cron expression. Note that the latter setting changes depending on the Interval chosen. This is an optional setting to specify when to trigger the rule in a precise way. The syntax consists of 4 digits [ * * * ? ] to specify, respectively:

Position:

*

*

*

*

Represents:

Hour

Day of month

Month

Day of week

Allowed values:

0-23

1-31

1-12

1-7

Allowed special characthers:

, - *

, - * ?

, - *

, - * ?

"" means “all values”, while "?" means "no specific value". For example, in the *Hour interval, the default Cron is * * * ? meaning that the rule will be triggered every hour, every day, every month, but without considering the day of the week.

Be aware that the character "?" can only be placed either on the second or fourth position, not both. In general, note that Cron expressions are not validated, so type them with caution.

Day shows 0 * * ? which means that the rule will be triggered every day at midnight (the "0" hour). If you modify it to 12 * * ? then it will be triggered every day at midday instead.

Month shows 0 1 * ? so the rule will be triggered at midnight of the first day of every month. Typing 0 15 * ? will trigger it at midnight on the fifteenth of every month instead.

Week shows 0 ? * 1 meaning it will be triggered every Sunday (day 1 of the week) at midnight.

Year shows 0 1 1 ? which triggers the rule once a year, right starting the 1st of January.

Custom example: 8,12,18 ? * 1-5 to trigger during Monday and Friday at 8am, 12pm and 6pm.

Rules that contain the keywords Changed, Updated, Inserted and Deleted are not supported in scheduled rule groups.

Rules are meant to be scheduled only if:

  • Need to manage expiration or due dates that not always can be triggered by the user in an application form. As an example, let’s say that a user needs to receive an e-mail, notifying that shipments are about to be delivered, as a warning, a couple of days before arrival. But the user counts only with two fields in the application form: "ETA" (Estimated time of arrival) and "Arrival date", where the first one is entered only once and long before the warning e-mail is needed. Therefore, unless this rule is set as scheduled, the e-mail sending would not be possible with a one-time trigger event in the application form. See this example in more detail.

  • Need to re-assign existing records to a different record group in a massive way. In this case, by using a rule (with an action of type Set access rights on record) in a scheduled group (Hour interval), that you inactivate immediately after editing the group of the desired records.

The usage of scheduled rules may notably affect the performance of the application, due to the evaluation periodically executed by the system throughout the criteria of all records of the trigger table. In case they take a long time to be executed and overload the server resources, the rules will be automatically stopped, and the application administrators will be notified.

Use the Rules monitor form to analyze scheduled rule execution.

Add existing rules into a group

Right after the Rules manager is loaded, all existing rules are displayed under the Rules section. First, select the rules you want to move and then drag the DottedSquare next to the Name of the rule and drop it to the proper group.

Delete a rule group

Select the group and click on the Delete button.

Deletion of a rule group will cause the cascade deletion of any rules currently in the group. A warning message will pop up notifying this.

If you want to delete the group, but not its rules, you must first move the rules into "Ungrouped" or another group and, once empty, proceed with the deletion.

Rename a rule group

Double-click the group, type the new name and hit Enter. Click on the Save all button.