1. Time operations

    Article: AN0002031Updated: 29.03.2019

    ObjectGears system enables to define various operations, that shall occur depending on class/query data, namely on value in a column of type Date and time. These can be various email notifications, start of workflow or actions performed by means of script.

    Each time operation is defined on a certain class/query, that contains column of type Date and time. Each class/query can have more time operations. There can be up to five operations (0-4) defined in each time operation, that differ in relation to the column controlling execution of time operation for the given record (Record column with date in the properties of the time operation). This enables e.g. to send a notification in advance before the date defined in the column in the first operation. If the user does not respond, next operations can send escalation email, start workflow or execute actions defined by script.

    Evaluation of time operation start

    The time operations are not evaluated for all the records in classes/queries automatically and regularly like jobs, workflow or reading emails from mailboxes, but according to the settings in particular time operations. The date of evaluation can be defined in the time operation by stating days in months or days in week, when the operation shall be started. If more records are entered, evaluation takes place each day complying with at least one definition. Also hour (more values can be selected) and minute of start are defined.

    ObjectGears system checks every 15 minutes, wheather particular time operations meet condition for their start. If this happens, then the respective time operations are started.

    This means you can perform control each date in week or e.g. only on Monday morning or the last day in month. 

    Start of time operation

    Start of time operation leads to comparing values in column controlling the time operation (Record column with date) at particular records in the class with:

    1. settings of time operation in properties Active from date and Active till date - this enables e.g. to skip records with an old date. This setting is useful, if you want to use the time operation only for new records (e.g. only from the following month).

    These two properties are compared only with the value in column with date with no regard to the shift in particular operations. If you have set some operation e.g. for sending a notification 30 days after the date, the system will send this notification, even if current date is greater than the property Active till date. If you have activity in range 1.4. - 10.4. and the record with date 7.4. and operation configured to +30 days, then the given operation will be triggered on 7.5., even if the activity is only till 10.4..

    2. setting of time operation in properties Start type and Start every time - min. after days - this enables to perform each operation (0-4) from the given time operation to be performed for each record no more than once. However, if the value in column Record column with date is changed, operation will be executed again. Alternatively, operations can be started for particular records repeatedly. In this case you can use setting of a minimal number of days, after which the given operation can be started again.

    When using Start only once for each identifier each operation (0-4) will be started only once, if the are configured. When using Start every time operations will be started at each start of time operations and complying date.

    Use the first option when one-time notification or processing is required. The second option is suitable for a regular notification of users, e.g. about error in data, that has to be corrected. User then will be periodically notified till correcting the error.

    3. setting of time operation in properties Shift in days against date at particular operations (0-4) - this enables particular operations to be performed with a certain shift in relation to the date in the record in Record column with date. In case of a negative number the operation will be executed the given number of days before the date in Record column with date, in case of a positive number then the given number of days after this date. If 0 is set, the operation will be performed on the day according to the value in Record column with date.

    Execution of operations (0-4)

    Within start of the time operation it can be evaluated that a certain operation (0-4) shall be executed. At this moment email notifications are sent, workflow started, script executed or combination of these action is performed. More operations (0-4) can be performed for a single record within one time operation start, if they comply with the condition for execution.

    It is necessary to be aware that a prerequisite for an operation execution is evaluation of the time operation start. This is why particular operations are in fact performed at the next start of time operation after the time, when the time operation could be started according to the Record column with date and settings of the time operation.

    Identifier

    In order to ensure only one processing of the record with setting Start only once for each identifier it is necessary to define an identifier for the class/query. It is a column that will uniquely identify the record for its whole life cycle. In case of class it is column Id. In case of query you have to determine this column. In case this identifier changes during the life cycle of the time operation (even after severeal months or years of using the time operation), the respective record will be processed again by the time operation.

    Script

    You can execute a script in each operation. You have several objects available in this script:

     

    Name Description
    ActualTimeOperation OGActualAto Definiction of the time operation.
    int OGActualAtoOperation Number of operation (0-4), for which the check is executed.
    DataRow OGActualDataRow Record that is processed.

    Email notifications

    When sending an email notification you can use below variable in the notification:

    Name Description
    DataRow.Url Reference to the detailed form with a record.

    Example:

    {{datarow.url}}

×