Loading...
 

Application Calendar

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
Recurring 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.

Cloud
'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 } } } } ] } }

Local with SID - User
'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
Menu itemDescription
Edit -
: Print-
: : : With OLE in the foregroundThe print mask is opened, ClassiX is busy printing. You have to wait until printing is finished.
: : : With OLE in the backgroundThe 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/offWhen 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.
SearchCall up list window

 

Toolbar
SymbolDescription
 new.png Create new application calendar(s)
 save.png Save changes
 delete.png Delete application calendar (entry)
 CX_PRINTER_hardcopy.png Print application calendar (entry)
 pin.png  pinned.png Create/edit notes

 

If neither the "Batch run" selection (see above) nor the "Interval" selection is made, the application calendar is only executed once.If this field remains empty, the task is executed regardless of the time.

ATTENTION: The e-mail of the employee of the executing user is used as the sender. If the user does not have an employee role, the default email sender is checked.
To create a default email address, an email address with the comment "AUTOMATED_EMAIL_SENDER" must be entered in the telecommunications data in the client.

Fields
FieldDescription
Details
: Application calendar entry  
: : IndicatorTechnical indicator of the task.

Convention:
If it is a system task, the indicator starts with "GENERATE_". If it is a user task, it starts with "REPORT_". If it is a print task, it starts with "PRINT_"

: : TypeType of task. Possible entries are:
  • System - The system application is a system run that has not been registered by a user. These system runs cannot have subgroups. The execution details are managed on the header document itself (start date, execution type, recurrence...) Indicator starts with "GENERATE_"
  • User - The user application was created by this machine at the request of a user. With this type of application, the execution details are stored in the user groups. Each user who schedules a task in this application can select the date on which the task is to be executed. This can be set on the user group (CX_COMPOUND_TXN) Indicator starts with "REPORT_"
    Direct, manual entry of user applications is not provided. Supply chain management and supplier declarationsare included in the standard system.
  • Print - This is a print job. These are not implemented in the standard system, but are defined specifically for each customer.
    Indicator begins with "PRINT_"
: : Category
: : order
: : ServerAssigns 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.
: : agentAgent 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 dateDate on which the application was created
: : DescriptionThe description of what the application represents.
: Termination  
: : Start dateOnly 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.)
:: WeekdayIf 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 / atIndicates 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 dateDate 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).

: : 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.

: Message
: : e-mail recipientEnter 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 cancellationA 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 successA 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.

Examples
Field contentE-Mail Bereff
"\"PYTHIA Abgleich\""
({ "PYTHIA Abgleich" }) Execute
({ LocalVar(appStep) -> appStep appStep Copy(last.transaction.new.counter) Integer appStep Copy(last.transaction.risk.counter) Integer appStep Copy(last.transaction.changed.counter) Integer "Pythia: %i neue Treffer, %i geänderte Whitelist-Einträge, %i geänderte Blacklist Einträge" String(STACK) }) Execute

: Execution steps 
: : List

List of the individual execution steps of the application calendar.

List of the individual execution steps of the application calendar. (In the case of user applications, the individual execution steps are displayed in the form of a tree). 
IndicatorSequence number of the execution step.
DesignationDesignation of the execution step.
ExecutionInstantView programme code that is to be executed. The currently executed execution step is available as an "actualExecute" variable.

Protocol
: removeDeletes the selected log entries.
: ListListing 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.

 

Buttons
buttonDescription
InsertA new entry can be added to the application calendar.
RemoveThe selected entry(s) of the application calendar is (are) deleted - after another confirmation prompt.
Execute nowIf 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.
ReactivateSets 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.
ActivateThis 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
Menu itemDescription
Edit -
: Data exchange 
: : exportAll 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.
: : ImportThe previously exported calendars (see above Export) can be re-imported.
: ResetThe list is cleared.
Options Call up the option window

 

Toolbar
SymbolDescription
 list_clear.png Empty list
 new.png Create new application calendar (entry)
 open.png Edit application calendar (entry)
 delete.png Delete application calendar (entry)
pin.pngpinned.pngCreate/edit notes
 Document history
 Copy to clipboard

 

Search fields
FieldDescription
IndicatorIndicator or number of the application calendar
DesignationSearches for the name of an application calendar) entry)
Starts onSearches 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!)

 

Buttons
buttonDescription
BackThe app is closed.
DeleteThe selected app calendar (entry) is deleted.
NewAn empty input window for entering a new application calendar opens.
EditThe 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.

Fields
FieldDescription
Details
: App. calendar entryDisplays the higher-level application calendar entry. This can be called up directly with the right mouse button
: Execution numberThe 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.
: DesignationA 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 dateOnly 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.
: : RecurringIf 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.
: : PeriodicitySpecifies the interval at which the task is to be performed when the "Recurring" check mark is set.
: : ExecutedIndicates 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 buttonOpens the staff search list. An employee can be selected and assigned to the document
: : Agent numberDirect 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 abbreviationDirect 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 objectsApplication calendars are also used to carry out automated analyses. The list shows the objects that have been selected for evaluation.
Buttons
buttonDescription
OKConfirm selection
ReactivateIf 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. applicationsShows all scheduled open tasks of all application calendars (entries) of the currently displayed user.
DeleteDeletes the displayed position
CloseThe 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.

Scalability of night runs

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.

Fields
FieldField description
Details
: Execution details
: : ExecutedIndicates the date and time at which the execution step (see box below) was carried out.
: : RemarkIf there was a system message during execution, this is logged here.
: Execution step
: : Application calendarThe executed application calendar.
: : Execution numberThe number of the executed execution step. At the time of execution, this entry is copied from the execution step to the log entry.
: : DesignationThe name of the executed execution step. At the time of execution, this entry is copied from the execution step to the log entry.
: : DescriptionThe description of the executed execution step. At the time of execution, this entry is copied from the execution step to the log entry.
: : ExecutionThe 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.

Buttons
ButtonButton description
Back buttonThe 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.

The pending tasks can be narrowed down using the date field and the time field.FieldsThe due date can be used, for example, to see which tasks are due next week on Wednesday. However, it is possible that some of the entries displayed may have already been completed in the days before.Restriction according to the time of execution. To also list night runs, the time must of course be set accordingly.
FieldDescription
: 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 numberDirect 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 abbreviationDirect 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
List List of open, scheduled tasks according to selected user and due date.
The app for editing the selected application calendar is started.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.
Buttons
ButtonDescription
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.

BackThe app is closed.
EditThe app for editing the selected application calendar is started.
ListThe search for all due tasks is carried out on the basis of the set user and the set date.

 

Related topics

 

Technical Documentation

Application Calendar Module

Module name

appsched.mod - appscedt.mod - appscsel.mod - appscprn.mod

Classes

CX_APPLICATION_SCHEDULE

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.

Received messages
MessageParametersFunctionSecurity
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_SCHEDULEWidgetCreates a new object with the transferred ID and enums. Sends the response message APPLICATION_SCHEDULE_CREATED directly back to the widget 
CREATE_APPLICATION_SCHEDULE_EXECUTEWidgetCreates 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_COMPOUNDWidgetCreates 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. 

Operational business