Application calendar
Description
For tasks that are to be executed automatically in the background at certain times or that would place too heavy a load on the DP system during operation, there is the option of moving evaluation, closing and printing tasks to an application calendar. The tasks are then not executed directly, but scheduled for an automatic ClassiX service (server).
Such tasks to be executed automatically are managed by means of so-called application calendars (also known as automation calendars) and their execution steps. There are basically three different types of application calendars:
- Recurring tasks (batch run)
- Interval tasks
- One-off tasks
A task is described as "recurring" if the smallest unit for repeating the task is "one day". These are usually so-called night runs, which are started daily by the system administration. To set up such a "night run" server, a ClassiX start file (e.g. as App Suite (*.cxp) or directly the app applicationScheduleExceute.app) must be executed on a client via batch file, which checks and processes all pending tasks at a certain time (e.g. every night as a cron service of the operating system). Hence the name "batch run".
An example of an evaluation shifted to the night is the post-calculation of customer orders (this is a so-called system application). In the case of very large and complex orders, the ongoing post-calculation during daytime operations can cause considerable database blockages and waiting times. Such a post-run is activated in the client.
Users also have the option of scheduling very extensive evaluations so that these can be found in their saved lists the next morning or these saved lists can be printed out during the night directly on the user's standard printer (these are so-called user applications). Each user can also schedule each evaluation several times with different settings. For each user, a separate user group is created with his specific settings and assigned to the respective user application.
Examples of user applications:
Only user applications have subordinate user groups with the execution steps they contain. System applications directly contain the execution steps.
Once all these recurring tasks have been processed, the service terminates atomatically.
Interval tasks
If tasks are defined with an "interval", a so-called time trigger is activated internally after the call, which calls the task periodically according to the set interval (e.g. 5 min). The "Interval" specification can also be set or overwritten with the environment variable CX_APP_SCHEDULE_SNIFFER_INTERVAL.
One-off tasks
If tasks are not defined as "Recurring (batch run)" or with an "Interval", they are considered "one-off" tasks and are only executed once. Such one-off tasks are also processed in the so-called night runs or can be started directly manually.
Execution as a web service
The application calendar can be executed as a MorphIT instance.
'static': { 'request_timeout': 300*1000, "webservice": { 'enabled': true, 'registration_webservice': false, "instances": [ { 'id': 'app_schedule', // To recognize the instance in the admin console "registration_webservice": "EXECUTE_APPLICATION_SCHEDULE?USERID=cx&PASSWORD=cx", 'launch': { // Define start command for this webservice instance (first set dlls, then call start batch) 'cmd': 'Y:\\classix\\Pythia\\projects\\Pythia\\Pythia.bat', 'config': { 'env':{ // Custom environment variables 'CX_DISABLE_LOGIN_SID':'TRUE', //Set CX_DISABLE_LOGIN_SID for start batch 'CX_APP_SCHEDULE_SNIFFER_INTERVAL':'60min', //Set CX_APP_SCHEDULE_SNIFFER_INTERVAL for start batch } } } } ] } }
'static': { 'request_timeout': 300*1000, "webservice": { 'enabled': true, 'registration_webservice': false, "instances": [ { 'id': 'app_schedule', // To recognize the instance in the admin console "registration_webservice": "EXECUTE_APPLICATION_SCHEDULE", 'launch': { // Define start command for this webservice instance (first set dlls, then call start batch) 'cmd': 'Y:\\classix\\Pythia\\projects\\Pythia\\Pythia.bat', 'config': { 'env':{ // Custom environment variables 'CX_DISABLE_LOGIN_SID':'FALSE', //Set CX_DISABLE_LOGIN_SID for start batch 'CX_USER':'cx', //Set CX_USER for start batch 'CX_APP_SCHEDULE_SNIFFER_INTERVAL':'60min', //Set CX_APP_SCHEDULE_SNIFFER_INTERVAL for start batch } } } } ] } }
For the functionality described above, the SID of the user account of the MorphIT services must be stored in the database for the user cx. Accordingly, the user account must be stored manually with the services or alternatively it must be ensured that the user of the stored SID is always logged on to the computer.
An automatic login by additionally specifying the password as a variable is not possible, please use the Cloudconfig above.
Functionality
Input window
This app is used to maintain application calendar (entries).
| Menu item | Description |
|---|---|
| Edit | - |
| - | |
| : : : With OLE in the foreground | The print mask is opened, ClassiX is busy printing. You have to wait until printing is finished. |
| : : : With OLE in the background | The print mask is opened, ClassiX passes on the printing to a ClassiX instance that is started invisibly in the background. You do not have to wait until printing is finished, but can continue working with ClassiX. |
| : Switch test mode on/off | When an application calendar is executed, all errors or messages are redirected to a file. This can be very cumbersome when creating and testing a new application calendar. With this menu item, you can switch the redirection to a file on or off. |
| Search | Call up list window |
| Symbol | Description |
|---|---|
| Create new application calendar(s) | |
| Save changes | |
| Delete application calendar (entry) | |
| Print application calendar (entry) | |
| Create/edit notes |
| Field | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Details | |||||||||
| : Application calendar entry | |||||||||
| : : Indicator | Technical indicator of the task. Convention: | ||||||||
| : : Type | Type of task. Possible entries are:
| ||||||||
| : : Category | |||||||||
| : : order | |||||||||
| : : Server | Assigns the task to a server type. Possible entries are currently only "night run" and "print server". The night run server only checks every 24 hours after work, which tasks are available for it. The print server could run every hour or even more often. | ||||||||
| : : agent | Agent button: Opens the search list of employees. A staff member can be selected and assigned to the document. | ||||||||
| Agent number: Direct entry field: Here the employee number can be used for the search. After the entry, the search is to be triggered by pressing ENTER. | |||||||||
| Agent abbreviation Direct entry field: The abbreviation of the employee can be used for the search here. After the entry, the search must be triggered by pressing ENTER. | |||||||||
| : : Creation date | Date on which the application was created | ||||||||
| : : Description | The description of what the application represents. | ||||||||
| : Termination | |||||||||
| : : Start date | Only visible with type "System": The date from which the task should be started or the date of the first execution. Depending on the workload, it may happen that not all tasks can be processed during the night (data backup), so this is the earliest possible start date. If the execution has not taken place on the scheduled date, it will be executed the next day. | ||||||||
| : : Recurring | The check for execution is implemented in such a way that the new execution date calculated from the last execution date on the basis of the periodicity must be less than or equal to the current execution date. This ensures as far as possible that - even if a run fails - the application calendars are also executed subsequently. If neither this selection "Recurring" nor the selection "Interval" (see below) is made, this also means that the application calendar is only executed once. If neither the "Batch run" nor the "Interval" selection (see below) is made, the application calendar is only executed once. | ||||||||
| : : Periodicity (drop down box) | If the "Recurring" checkbox is ticked, specifies the intervals at which the task is to be performed recurrently. (e.g. daily, weekly, etc.) | ||||||||
| :: Weekday | If the "Recurring" checkbox is set, you can specify here the day of the week on which the application calendar is to be executed. This can be used, for example, to prevent the application calendar from being executed on weekends or public holidays (entries with an asterisk (*)). | ||||||||
| : : Last executed / at | Indicates the date on which this task was last completed. In the window tab "Protocol" the history of the last executions is listed. If there are too many, the entries can be marked and removed from the log. | ||||||||
| : : End date | Date of last execution. | ||||||||
| : : Interval | This checkbox is used to define that the service is to be executed several times a day at a certain interval. If an interval is defined, the system does not end automatically after the night run and executes the intervals separately. Tasks without an interval are checked or executed at the start and every e.g. 30 minutes. Tasks can also be defined. This checkbox is used to define that the service should be executed several times a day at a specific interval. For this purpose, a so-called time trigger is activated internally, which executes the task periodically at the set interval. In contrast to this are application calendars that are defined as a "batch run" (see above). For these, a so-called "cron job" must be set up in the system, which periodically calls up these application calendars from outside (then day by day or even beyond days). | If neither the "Batch run" selection (see above) nor the "Interval" selection is made, the application calendar is only executed once.||||||||
| : : Time span | Specify a time period (times) in which the task is to be executed. This can be specified as 1.00-3.00, for example, if the task is only to be executed early in the morning between 1.00am and 3.00am. If not specified, the task is executed regardless of the time. | If this field remains empty, the task is executed regardless of the time.||||||||
| : Message | |||||||||
| : : e-mail recipient | Enter one or more e-mail addresses (separated by a semicolon). In the next two checkboxes, you can select the processing status for which an e-mail is to be sent. | ||||||||
| : : on cancellation | A standardised e-mail is sent to the e-mail recipient with the information that the application calendar has been cancelled, i.e. could not be completed properly. | ||||||||
| : : on success | A standardised e-mail is sent to the e-mail recipient with the information that the application calendar has been completed correctly. | ||||||||
| : : Subject macro | At this point, a macro / procedure can be stored as InstantView code that creates a text to be entered as the subject of the email. The last executed execution step is transferred to the macro.
| ||||||||
| : Execution steps | |||||||||
| : : List | List of the individual execution steps of the application calendar.
| ||||||||
| Protocol | |||||||||
| : remove | Deletes the selected log entries. | ||||||||
| : List | Listing of all executed entries of this application. They remain in the list until they are deleted manually. | ||||||||
| Last documents | |||||||||
| List of documents that were created during the last execution. These documents can also be found in the log entries of the individual execution steps and are therefore replaced here by new documents each time the application calendar is executed again. The listing here therefore only serves to quickly display the most recently created documents. | |||||||||
| button | Description |
|---|---|
| Insert | A new entry can be added to the application calendar. |
| Remove | The selected entry(s) of the application calendar is (are) deleted - after another confirmation prompt. |
| Execute now | If one or more lines of the application calendar are selected, they are executed directly according to their order - after another confirmation question. If no line is selected, the entire application calendar is executed - again after another confirmation question. |
| Reactivate | Sets the start date to today and deletes the "last executed" date. This causes this task to be executed again during the next night run. This button is locked if the "Recurring" checkbox is not set. |
| Activate | This button is intended for starting services that are to be executed several times a day (checkbox: "Interval"). If the checkbox is not set, this button is blocked. |
List
This app is used to list all application calendar (entries).
| Menu item | Description |
|---|---|
| Edit | - |
| : Data exchange | |
| : : export | All or only the calendars selected in the list can be exported to a text file for backup reasons. The files are written to the directory ...\Appswh\Data\APP-SCHED. |
| : : Import | The previously exported calendars (see above Export) can be re-imported. |
| : Reset | The list is cleared. |
| Options | Call up the option window |
| Symbol | Description |
|---|---|
| Empty list | |
| Create new application calendar (entry) | |
| Edit application calendar (entry) | |
| Delete application calendar (entry) | |
| Create/edit notes | |
| Document history | |
| Copy to clipboard |
| Field | Description |
|---|---|
| Indicator | Indicator or number of the application calendar |
| Designation | Searches for the name of an application calendar) entry) |
| Starts on | Searches for the machine applications that should start for the first time on the entered date. (Attention: in case of recurring application calendar(s) it is not calculated whether it would be due on the date entered!) |
| button | Description |
|---|---|
| Back | The app is closed. |
| Delete | The selected app calendar (entry) is deleted. |
| New | An empty input window for entering a new application calendar opens. |
| Edit | The current application calendar (entry) is displayed in the input window. |
Position window
This app is used to edit an application calendar (entry), whether group or individual execution.
| Field | Description |
|---|---|
| Details | |
| : App. calendar entry | Displays the higher-level application calendar entry. This can be called up directly with the right mouse button |
| : Execution number | The number of the position. This is assigned automatically, but can be changed. If an entry is moved up or down in the list in the main mask, the positions are renumbered. |
| : Designation | A clear name of what this position is supposed to achieve. With user groups, the user can assign a free name here so that he knows exactly what effect which entry should have when several planned tasks on the same topic are to be carried out e.g. SCM for order 0293399 |
| : Execution | This field is only visible if it is not a user group. The programme code to be executed in this execution step is stored in this field. If an execution step is to end the execution of the application calendar, the programme code must contain the following code: 0 actualExecute Put(TopTransaction().blocked.settings) |
| : Execution details | Only for groups: Here you specify when the task is to be executed and by whom (night run, print server...) It can be specified whether the task should be moved to the log after a single execution, or executed recurrently (e.g. daily). |
| : : Start date | Only visible for type "System": The date from which the task is to be started. Depending on the workload, it may happen that not all tasks can be processed during the night (data backup), so this is the earliest possible start date. If the task has not been executed on the scheduled date, it will be executed the next day. |
| : : Recurring | If a task, such as the nightly post-calculation, must be carried out every day, a check mark can be placed here and in the "Periodicity" selection box that then becomes visible, you can set how often this task should be carried out. |
| : : Periodicity | Specifies the interval at which the task is to be performed when the "Recurring" check mark is set. |
| : : Executed | Indicates the date on which this task was last completed. In the window tab "Protocol" the history of the last executions is listed. If there are too many, the entries can be marked and removed from the log. |
| : Editor | Only for groups: Processor of the task or who created it? |
| : : Editor button | Opens the staff search list. An employee can be selected and assigned to the document |
| : : Agent number | Direct input field: Here the employee number can be used for the search. After the entry, the search is to be initiated by pressing ENTER |
| : : Editor abbreviation | Direct input field: Here the abbreviation of the employee can be used for the search. After the entry the search is to be initiated by ENTER. |
| : Tasks of the user | Only for groups |
| Other open scheduled tasks of the user of the currently displayed task to the currently displayed application calendar (entry). | |
| Entries of the application | |
| Here - only for user groups - the individual steps to be carried out for further maintenance are displayed | |
| Relationships | |
| Associations | List of associated objects that the programme should process at the time of execution. Objects can be inserted into the list using drag & drop, objects selected in the list can be removed using the "Remove" button or the Delete key on the keyboard. |
| Selected objects | Application calendars are also used to carry out automated analyses. The list shows the objects that have been selected for evaluation. |
| button | Description |
|---|---|
| OK | Confirm selection |
| Reactivate | If the task has already been executed or opened from the log, it can be copied to the active area again using this button and thus executed again. |
| Open Ben. applications | Shows all scheduled open tasks of all application calendars (entries) of the currently displayed user. |
| Delete | Deletes the displayed position |
| Close | The window is closed. |
Execution
There is a central app (applicationScheduleExecute.app) with which all pending application calendars are executed. This app can either be started directly (e.g. for night runs) or included in an app suite using the message EXECUTE_APPLICATION_SCHEDULE.
Here, a separate time trigger is set for each interval application calendar (see applicationScheduleTriggeredStart.app), all other recurring or one-time application calendars are also executed. If new application calendars are constantly coming into the system (e.g. through an API), you can start an application calendar sniffer (see cxApplicationSchedule::StartApplicationScheduleSniffer), which searches for new application calendars at specified time intervals and executes them if it is their turn.
If a task has been executed, either the task itself or, in the case of repeatable or system tasks, a copy of it is moved to the applications log.
If warning or error messages occur during the execution of a task, they are suppressed and written to files separated by month in the directory ...\System\SystemOut\AppScheduleLog\YYYY-MM\xxxx.log. However, other tasks that have not yet been executed will continue to be executed.
As there is usually only a short time window available for night runs, it is possible to start several night run instances and assign them to a category. The individual night runs then only perform the tasks that are assigned to their category. Here a main instance, e.g. category A, should be defined, which is then executed shortly before the other instances, so that it can complete leading system tasks (start statistical periods, import latest currency table), which the other instances will use later.
A category can therefore be assigned to each application. In addition, each application can be given a code number for the sequence. When the night runs are executed, all applications are sorted in ascending order. Thus, the task with the highest priority has the lowest number.
The category of the instance is assigned using the environment variable CX_BATCH_ID. This can be set before calling the system with the command "SET CX_BATCH_ID=A" or via the system environment variables!
Web service
Application calendars can also be started with the POST message EXECUTE_APPLICATION_SCHEDULE?USERID=myUserID&PASSWORD=myPassword&BATCHID=A via a web service.
This app can be used to view the log entries for the log of each executed step.
| Field | Field description |
|---|---|
| Details | |
| : Execution details | |
| : : Executed | Indicates the date and time at which the execution step (see box below) was carried out. |
| : : Remark | If there was a system message during execution, this is logged here. |
| : Execution step | |
| : : Application calendar | The executed application calendar. |
| : : Execution number | The number of the executed execution step. At the time of execution, this entry is copied from the execution step to the log entry. |
| : : Designation | The name of the executed execution step. At the time of execution, this entry is copied from the execution step to the log entry. |
| : : Description | The description of the executed execution step. At the time of execution, this entry is copied from the execution step to the log entry. |
| : : Execution | The executed programme code. At the time of execution, this entry is copied from the execution step to the log entry. |
| Documents | |
List of documents created during execution. Whether documents are created depends on the programme code being executed. | |
| Button | Button description |
|---|---|
| Back button | The app is closed. |
Pending application calendar entries
This app is used to list the application calendar entries to be executed in the near future. Here, for example, you can check what will be started today. The dates of recurring applications are also calculated and taken into account.
The user can be set as a filter. Only users for whom due applications are scheduled are displayed in the user list. If no user is registered, the pending tasks of all users are displayed.
Using the date field, the due date can also be checked for a date in the future.
| Field | Description | ||
|---|---|---|---|
| : Editor | Filters the due application calendar entries with the user set here. Only the users for whom tasks are currently pending are suggested in the selection list. If no user is selected, all pending application calendar entries are listed. By specifying the due date, the application calendar entries can be filtered by date of execution. This filter only applies if an application calendar is defined by batch run, whereby the weekday(s) of execution can be specified. | : : Agent number | Direct input field: Here the employee number can be used for the search. After the entry, the search is to be initiated by pressing ENTER |
| : : Editor abbreviation | Direct input field: Here the abbreviation of the employee can be used for the search. After the entry, the search is to be initiated by pressing ENTER. | ||
| : Examination | : : Due date | : : Due date | : : Time of execution | Restriction according to the time of execution. To also list night runs, the time must of course be set accordingly.List | List of open, scheduled tasks according to selected user and due date. |
| Button | Description | ||
|---|---|---|---|
| Remove | Only sub-items of application calendar entries can be removed, i.e. this function is only available to remove tasks from the system that you wanted to have executed with a delay. These tasks are then also permanently deleted from the application calendar. | Back | The app is closed. |
| Edit | The app for editing the selected application calendar is started. | List | The search for all due tasks is carried out on the basis of the set user and the set date. | The search for all due tasks is carried out based on the set user and the set time period.The search for all due tasks is carried out based on the set user and the set time period.The search for all due tasks is carried out based on the set user and the set time period.The search for all due tasks is carried out based on the set user and the set time period.
Related topics
Technical DocumentationApplication Calendar Module
Module name
appsched.mod - appscedt.mod - appscsel.mod - appscprn.mod
Classes
CX_COMPOUND_TXN
CX_TRANSACTION
Security
In addition to restricting access rights via the class and its data fields, the module can be restricted in its use via some of the received messages.
| Message | Parameters | Function | Security |
|---|---|---|---|
| TEST_APPLICATION_SCHEDULE | For test frameworks only | ||
| EDIT_APPLICATION_SCHEDULE | Open the editing mask of the transferred application calendar (if NULL is transferred, an empty editing mask is opened for new creation) | ||
| LIST_APPLICATION_SCHEDULE | Opens the application calendar search list | ||
| LOAD_APPLICATION_SCHEDULE | Loading message for loading the test database | ||
| CREATE_APPLICATION_SCHEDULE | Widget | Creates a new object with the transferred ID and enums. Sends the response message APPLICATION_SCHEDULE_CREATED directly back to the widget | |
| CREATE_APPLICATION_SCHEDULE_EXECUTE | Widget | Creates a new execution line under the object also transferred, with the transferred ID. Sends the response message APPLICATION_SCHEDULE_EXECUTE_CREATED directly back to the widget | |
| LOAD_APPLICATION_SCHEDULE_BY_FOLDER | Loading messages for exported application calendars | ||
| LOAD_APPLICATION_SCHEDULE_BY_FILE | Loading messages for exported application calendars | ||
| EXECUTE_APPLICATION_SCHEDULE | With this message, which is sent e.g. by a corresponding App Suite (*.cxp file), one triggers the automatic search of all application calendars for due dates and has them executed. (see applicationScheduleExecute App.) This allows so-called night runs, but also the interval tasks to be started and executed periodically. The actual execution and display of the tasks takes place in the applicationScheduleTimeTriggerStart app. | ||
| CREATE_APPLICATION_SCHEDULE_COMPOUND | Widget | Creates a new object with an automatically generated ID and the CX_STAFF_MEMBER with the transferred ID as the editor. If INTEGER 1 is passed as INTEGER 1, a new object is always created for the user. If the 0 is passed, an existing object is searched for the passed user and if necessary this is returned. Returns the response message APPLICATION_SCHEDULE_COMPOUND_CREATED directly to the widget | |
| EDIT_APPLICATION_SCHEDULE_ITEM | Opens the edit mask of the transferred item / group. This message can be triggered directly after the automatic creation of the position to the user for refinement (selection of the printer, setting the date ...). | ||
| LIST_OPEN_APPLICATION_SCHEDULE | Displays either all tasks due today, or only those of the transferred user at the transferred time. |