Skip to content

Scheduled procedures and recalculation groups#

A scheduled procedure calls, at its time, a stored procedure of the client's database: recording a load, preparing some tables, closing a period. A recalculation group chains a pre-procedure, the recalculation of several workbooks at once and a post-procedure: the typical daily close, in which the data is loaded first, then the workbooks are recalculated and finally the close is marked.

Before you start#

  • You need Workbook administration and System administration.
  • Choose the connection you are going to work in: tasks belong to the active connection.
  • The procedure has to exist in the client database and the connection's user has to be able to run it.
  • The workbooks of a group have to belong to the connection and you have to be able to open them. Only their documents that keep data are recalculated.

Create a scheduled procedure#

The New scheduled procedure dialog with the call to COMERCIAL.ANOTAR_CARGA, its two arguments and a daily schedule at 02:00The New scheduled procedure dialog with the call to COMERCIAL.ANOTAR_CARGA, its two arguments and a daily schedule at 02:00
The New scheduled procedure dialog with the call to COMERCIAL.ANOTAR_CARGA, its two arguments and a daily schedule at 02:00
  1. In Scheduling, click New and choose Scheduled procedure….
  2. Type the task's Name (up to 100 characters), for example “Nightly load log”.
  3. In Call, type the procedure's name, with the schema if needed and without parentheses: COMERCIAL.ANOTAR_CARGA.
  4. Add its arguments in order with Add argument (see the following table).
  5. In When, choose the schedule (below) and check the Upcoming runs.
  6. Leave Active checked if you want it to run by itself.
  7. Click Create procedure.

The task appears in Scheduled procedures. To test it, open it and click Run now.

The arguments#

Each argument has a type and a value, and is passed to the procedure as a parameter, never written inside the statement:

Type Value Example Passed as
Text Any text. Empty, NULL is passed. Carga nocturna 'Carga nocturna'
Number A number, with a decimal comma or point. 12.5 12.5
Date A calendar day. 09/30/2026 That date
Run day The day it runs, plus or minus a number of days (−1 is yesterday). −1 Yesterday's date on each run

In the task's detail, Call shows it in full: COMERCIAL.ANOTAR_CARGA('Carga nocturna', today − 1 day). The button with the cross on each argument removes it.

How the name is written#

The procedure's name is quoted like the connection's tables:

  • If the connection has Quote table and column names, type it exactly as it is in the database, with its capitalization.
  • If not, type a plain name (letters, digits, _); it will be written in the statement as is.

If it is missing or has parentheses, the dialog does not let you save and says “The procedure is missing” or “The procedure is its name, with the schema if needed, without parentheses”.

What happens with transactions#

Engine How it is called
PostgreSQL Outside a transaction: the CALL is its own transaction and the procedure can commit inside (for example, in batches). What it commits stays committed even if it fails afterwards.
Oracle In a transaction that is committed if it finishes well and rolled back if it fails. A COMMIT inside the procedure commits.
SQL Server In a transaction that is committed if it finishes well and rolled back if it fails. A transaction inside the procedure is nested and does not commit until the outer one does.

An error of the procedure is a failure of the run, with the database's message in its step.

Create a recalculation group#

The dialog of a recalculation group with two workbooks checked, one retry and the pre- and post-proceduresThe dialog of a recalculation group with two workbooks checked, one retry and the pre- and post-procedures
The dialog of a recalculation group with two workbooks checked, one retry and the pre- and post-procedures
  1. In Scheduling, click New and choose Recalculation group….
  2. Type the Name, for example “Daily sales close”.
  3. In Workbooks, check the group's workbooks. Search workbook filters the list by name; the checked ones stay in view. The title says how many are checked.
  4. In Retries of a failing workbook, type how many times a workbook that fails is tried again, from 0 to 10.
  5. In Procedures, check if needed:
    • Pre procedure (if it fails, no workbook is recalculated), and type its call as in a scheduled procedure.
    • Post procedure (only if all the workbooks finish well), and its call.
  6. In When, choose the schedule and leave Active checked.
  7. Click Create group.

If the name is missing or no workbook is checked, the dialog's footer says so (“The name is missing”, “Choose the workbooks of the group”) and does not let you create it.

How a group runs#

How a recalculation group runs A recalculation group runs the pre-procedure; if it ends well it recalculates all the workbooks at once, with retries, and if all of them end well it calls the post-procedure; any failure leads to Error. Yes No no workbook recalculated no post-procedure No Yes if it fails Start on schedule or Run now Pre-procedure optional Did it end well? Recalculate all the workbooks at once with retries each All workbooks successful? Error Post-procedure optional Success Without a pre-procedure, it starts with the workbooks; without a post-procedure, it ends with them. Each workbook recalculated successfully notifies the portal and the “after recalculation” subscriptions.
How a recalculation group runs A recalculation group runs the pre-procedure; if it ends well it recalculates all the workbooks at once, with retries, and if all of them end well it calls the post-procedure; any failure leads to Error. Yes No no workbook recalculated no post-procedure No Yes if it fails Start on schedule or Run now Pre-procedure optional Did it end well? Recalculate all the workbooks at once with retries each All workbooks successful? Error Post-procedure optional Success Without a pre-procedure, it starts with the workbooks; without a post-procedure, it ends with them. Each workbook recalculated successfully notifies the portal and the “after recalculation” subscriptions.
How a recalculation group runs View full size View full size
  1. If it has a pre-procedure, it calls it. If it fails, the group fails and no workbook is recalculated.
  2. It recalculates all the workbooks at once, each one in its jobs (in the normal queue, with each class's limits). A workbook that fails is retried up to the number of retries, also if it failed when launched.
  3. If any workbook still fails after its retries, the group fails and the post-procedure is not called.
  4. If they all finish well, it calls the post-procedure.

If a workbook exports its cubes and listings to files, it writes them after being recalculated, inside the group, and the post-procedure waits for them to finish. If any file fails, the group fails and the post-procedure is not called, but the workbook is not retried: the retries are for the recalculation, and its data is already good (see File export).

Each workbook recalculated successfully announces it: the portal publishes a version if the workbook is published “after each recalculation”, and subscriptions and data alerts “after the recalculation” are sent or evaluated. A workbook can be in several groups and also have its own scheduled recalculation.

The schedule#

The When section is the same in the three kinds of task:

Schedule Options
No schedule (manual only) It only runs with Run now.
Daily Start time and Every how many days; or repeated Repeat every so many minutes or hours Until a time. If the window ends at the start time, it repeats all day; if it ends earlier, it carries over to the next day.
Weekly Start time and the days of the week.
Monthly Start time and the Day of the month: the first, the last or a specific one.
Once A day and a time. Once it has passed, the upcoming runs say “None: it has already passed”.

Upcoming runs are calculated by the server with its time zone (ecenter.scheduling.zone, by default the server's; set TZ in the installation). The next run is always later than the moment the task is saved or launched. On the autumn clock change, an hour that repeats runs once; on the spring one, what falls in the hour that does not exist runs once it has passed.

Maximum times#

What Limit Property
Each attempt to recalculate a workbook 2 hours. When it runs out its jobs are canceled and it counts as failed, so it is retried. ecenter.scheduling.recalc-timeout
A scheduled procedure 2 hours ecenter.scheduling.procedure-timeout
A group's pre- or post-procedure 30 minutes ecenter.scheduling.step-timeout
The file export of each workbook, from when it starts 2 hours, apart from the recalculation ecenter.file-exports.timeout
Tasks running at once on an instance 4. Those due while 4 are running wait for the next round; Run now does not wait. ecenter.scheduling.max-running

The group has no total time: each workbook and each procedure has its own.

Modify, deactivate and delete#

  • Modify… opens the same dialog. On saving, you become the task's owner.
  • The Active switch deactivates it without deleting it: it does not run by itself, but it can be run by hand and keeps its history.
  • Delete… asks for confirmation (“It will stop running. Its run history is kept.”). A running task cannot be deleted: stop it first.
  • Deleting a workbook deletes its recalculation and removes it from the groups; a group can end up without workbooks (the detail says “None (they were deleted)”).
  • Save as on a workbook does not copy its schedule, and restoring a backup of the workbook does not change it.

See also#