Logical Date and Real Date
Executable objects can be configured to be executed at a specific point in time. They can also be part of other executable objects, such as Workflows and Schedules, that automate their executions. The object configuration and their Calendar and time conditions (if set), determine the date on which objects are executed. The Automation Engine uses two dates, the real date and the logical date. The real date is the actual date on which a task is generated. The logical date is an artificial date that is defined either manually by the user or by a process (a Workflow or a Schedule).
Understanding the Real Date in Objects
The real date depends on the type of object and on how it is executed:
-
The real date in all task types
The real date is the task activation time. It is used to verify the time conditions that can be used to calculate their maximum runtime. For more information, see Runtime Page.
-
The real date in Workflows
The real date is determined when the top Workflow is activated and it is passed on to all its child tasks. That is, the real date of the tasks within a Workflow is the generation time of the Workflow. It is used to calculate and verify the time conditions that can be defined in their properties:
- In the Time and Dependencies tab
- In the Runtime tab
Example:
A Workflow with many tasks usually runs for a long time. It starts everyday at 16:00. The last task in the Workflow must be executed always on the next day at 9:00. You define this time condition on the task Time & Dependencies properties tab specifying the Real Date for the task start as follows:
For more information, see Time & Dependencies and Runtime Properties.
-
The real date in restarts
The real date of the referenced run is used provided the reference task is still visible in the Process Monitoring perspective. Whether the task is visible depends on the object settings in the Automatic Deactivation Sectionof the Attributes page. Otherwise, the logical date of the referenced run is used because the task historical data in the Executions list does not include the real date.
For more information, see Restarting Tasks.
-
The real date in Schedules
The real date of tasks that have been activated through a Schedule is the start time defined for the tasks in the Schedule.
It is also used to calculate and verify the time conditions that can be defined for the tasks in the Schedule:
- In the Time and Dependencies tab
- In the Runtime tab
For more information, see Defining Schedule Objects.
-
The real date in recurring executions
The real date of tasks that are executed using the Execute Recurring option is the planned start time because this is when these tasks will be activated and generated.
For more information, see Executing Objects - Recurring.
-
The real date in executions with the Once option
The real date of tasks that are executed once at a certain time in the future depends on the generation time that is specified on its Attributes Page.
-
Generate Task at: Activation time
The real date is the activation time.
-
Generate Task at: Runtime
The real date is the planned start date of the task, because this is when it is activated.
-
Understanding the Logical Date in Objects
Logical dates are used for Calendar calculations in situations in which you must specify a point in time for an execution. This point in time can be in the future or in the past. For example, a Workflow that should have been executed yesterday has failed and you need the report that results from its execution today. You can execute the Workflow manually using the Execute Once option and set the Logical date to yesterday.
If you do not specify a particular date for the execution of an object, the logical date coincides with the real date. In Workflow tasks, the logical date is inherited from the parent Workflow. This is also true for Workflows that are embedded in Workflows. The top Workflow determines the logical date for the whole structure.
The logical date includes a date and a time. Only the date is important for the calendar calculations. The time is used to handle date changes that can result from time zone or time differences.
-
In Schedules
In Schedule objects, you can define a period duration of several days. The tasks in the Schedule can be executed on different days in that period. For example, you can define a Schedule to automate weekly operations. Once you have defined the Schedule and added the tasks, you must activate it. To do so, you execute the Schedule. To determine the beginning of the period, you use the logical date. In our example, it could be on Monday because it is a weekly Schedule. In this case, you use the Execute Once option, which allows you to set the logical date and time.
-
In restarts
In restarts, the logical date corresponds to the reference execution. In restarted workflows, it is passed on to all subordinate tasks as in normal activations.
Example:
You start a long-running Workflow everyday at 16:00. The last task of the Workflow must be executed only once a week on Fridays and, therefore, it has a Calendar condition that is assigned to it. Today is Friday and the Workflow runs much too long. It is already Saturday when the second to last task is finished. The Workflow is executed including the last task because the logical date of all its tasks is inherited from the Workflow. In this case, it is Friday. If you need the Friday run of the Workflow on Saturday, you can execute the Workflow using the Execute Once option. On the dialog, activate the Use logical date on the dialog checkbox and select the previous Friday and an earlier time. The Workflow is executed as if it were Friday and also the last task will be processed.
Usages of the Logical Date
The logical date is used for the following functions:
- Starting tasks, see Executing Objects Once and Executing Objects - Recurring
- Forecasts, see Forecasts
- Script elements, see ACTIVATE_UC_OBJECT and FORECAST_OBJECT
Functions for Retrieving Date and Time
- SYS_LDATE returns the logical date.
- SYS_TIMESTAMP_PHYSICAL provides the current date and time.
- SYS_TIME_PHYSICAL determines the current time of the day.
- SYS_DATE_PHYSICAL determines the current date.
- SYS_TIME returns the current time of day at the beginning of script processing.
- SYS_DATE returns the current date at the beginning of script processing.
- CALE_LOOK_AHEAD returns the next date based on calendar conditions.