> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/sterowanie-dostepnoscia-wniosku.md).

# Controlling request availability

**Temporary lock mechanism** allows you to control the availability of the application based on business configuration parameters. It can be used for business or technical reasons. When the lock is active, the user cannot start submitting the application and is redirected to a page with an unavailability message.

Examples of use:

* Failures and critical errors - disabling the application when an error is found. This prevents customers from using a faulty process, and gives developers time to analyze and implement a fix before it is relaunched.
* Technical and maintenance breaks - temporarily disabling the application due to planned unavailability of internal or external systems on which the application depends (e.g. service maintenance break on 12.08 from 21:00–00:00).
* Periodic availability - limiting the ability to submit the application only to strictly defined time windows (e.g. time-limited deposits, government applications).

**Availability control parameters** of the application can be defined and edited in the **Configuration** tab in the application view in Eximee Designer. Details: [Low-code configuration](/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/konfiguracja-aplikacji-biznesowej-serwer-konfiguracji/konfiguracja-z-poziomu-low-code.md).

To change the parameter values at any time, without having to release a new version of the application, you can override them in the **Application configuration** tab in Eximee Dashboard. The operation is available to users with the appropriate permissions. More information: [Modifying (runtime) business configurations](/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/konfiguracja-aplikacji-biznesowej-serwer-konfiguracji/modyfikacja-runtime-konfiguracji-biznesowych.md).

## Example configuration structure

The configuration is divided into three logical blocks, relating to the type of application unavailability:

* global status - related to a sudden failure,
* maintenance break - concerning a planned, time-bounded blocking of the process,
* schedule - availability according to specific dates (and times).

```js
# --- 1. GLOBAL STATUS (FAILURE) ---
form.globalStatus.isOutage=false
form.globalStatus.textContent=formUnavailabilityFailure-*

# --- 2. MAINTENANCE BREAK (MAINTENANCE) ---
form.maintenance.isScheduled=true
form.maintenance.startDate=2026-07-22T13:00:00
form.maintenance.endDate=2026-07-22T15:00:00
form.maintenance.textContent=formUnavailabilityMaintenance-*

# --- 3. SCHEDULE (SCHEDULE) ---
# Values: ALWAYS_AVAILABLE, EXACT_DATE_TIME, YEARLY_RECURRING
form.schedule.ruleType=YEARLY_RECURRING
form.schedule.textContent=formUnavailabilityScheduled-*

# For rule: EXACT_DATE_TIME
form.schedule.exact.startDateTime=2026-01-01T08:00:00
form.schedule.exact.endDateTime=2026-12-31T23:59:59

# For rule: YEARLY_RECURRING (MM-DD format)
form.schedule.recurring.startMonthDay=07-01
form.schedule.recurring.endMonthDay=11-30
```

## Validation rules and priorities

The mechanism operates on a cascading architecture. It checks conditions from the most critical to the most general. Meeting a blocking condition causes form processing to be interrupted and the user to be shown the appropriate unavailability message.

| Parameter                                           | Format / Values                                                           | Description                                                                                                                                                                                 |
| --------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| form.globalStatus.isOutage                          | true / false                                                              | Priority 1: Immediate blocking of the application, ignores the remaining settings.                                                                                                          |
| form.maintenance.isScheduled                        | true / false                                                              | Priority 2: Blocking the application within the defined maintenance break time window.                                                                                                      |
| form.schedule.ruleType                              | <p>ALWAYS\_AVAILABLE<br>EXACT\_DATE\_TIME<br>YEARLY\_RECURRING</p>        | Priority 3: Schedule rule checked when there is no failure or maintenance break.                                                                                                            |
| form.\*.textContent                                 | <p>artifact name<br>(in the format <code>artifactName-version</code>)</p> | <p>The content of the appropriate error message displayed to the user.<br><em>The notation artifactName-\* means the latest available version of the artifact with the given name</em>.</p> |
| form.maintenance.startDate / endDate                | <p>date and time (in the format<br><code>YYYY-MM-DDTHH:MM:SS</code>)</p>  | Start and end of the planned maintenance break.                                                                                                                                             |
| form.schedule.exact.startDateTime / endDateTime     | <p>date and time (in the format<br><code>YYYY-MM-DDTHH:MM:SS</code>)</p>  | Start and end of the strict, one-time schedule of application availability.                                                                                                                 |
| form.schedule.recurring.startMonthDay / endMonthDay | date (in the format `MM-DD`)                                              | Month and day of the start and end of the recurring application availability.                                                                                                               |

If no condition is met, the script finishes without an error, which the system interprets as full availability of the application.

## Configuration for individual environments

Configuration parameters can take different values depending on the environment. This is useful, for example, when the application should be blocked in the production environment, but still available in development and test environments to allow it to be run and verified by low-code developers and testers.

For example, the global lock parameter may have the value `true` only in the production environment:

```
form.globalStatus.isOutage=false
form.globalStatus.isOutage|prod=true
```

The values of the availability control parameters should be assigned to the appropriate environments. The way the environment is marked in the configuration key and the rules for selecting values are described on the page: [Low-code configuration](/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/konfiguracja-aplikacji-biznesowej-serwer-konfiguracji/konfiguracja-z-poziomu-low-code.md#konfiguracjazpoziomulowcode-ustaleniesrodowiska).

## Example script controlling application availability

The script verifies whether the client can open the application form, based on the declared configuration. Validation is based on a cascading (priority) structure, where meeting one of the blocking conditions immediately interrupts processing and displays the appropriate error screen.

```js
function callService(context) {
   const globalStatusFlag = api.config.v1.getOrDefault('form.globalStatus.isOutage', 'false');
   const maintenanceFlag = api.config.v1.getOrDefault('form.maintenance.isScheduled', 'false');

   const maintenanceStartDate = api.config.v1.getOrDefault('form.maintenance.startDate', '');
   const maintenanceEndDate = api.config.v1.getOrDefault('form.maintenance.endDate', '');

   const scheduleRuleType = api.config.v1.getOrDefault('form.schedule.ruleType', 'ALWAYS_AVAILABLE'); 
   const scheduleExactStartDateTime = api.config.v1.getOrDefault('form.schedule.exact.startDateTime', ''); 
   const scheduleExactEndDateTime = api.config.v1.getOrDefault('form.schedule.exact.endDateTime', ''); 
   const scheduleRecurringStartMonthDay = api.config.v1.getOrDefault('form.schedule.recurring.startMonthDay', ''); 
   const scheduleRecurringEndMonthDay = api.config.v1.getOrDefault('form.schedule.recurring.endMonthDay', '');

   const globalStatusTextContent = api.config.v1.getOrDefault('form.globalStatus.textContent', 'formUnavailabilityFailure-*');
   const maintenanceTextContent = api.config.v1.getOrDefault('form.maintenance.textContent', 'formUnavailabilityMaintenance-*');
   const scheduleTextContent = api.config.v1.getOrDefault('form.schedule.textContent', 'formUnavailabilityScheduled-*');

   const now = new Date();

   // Priority 1: Failure
   if (globalStatusFlag === 'true') {
       Logger.info("Access to the application has been blocked. " + "globalStatusFlag=" + globalStatusFlag);
       throwBusinessError(globalStatusTextContent, "Application unavailable due to a failure");
   }

   // Priority 2: Maintenance break
   if (maintenanceFlag === 'true') {
       const maintenanceStart = new Date(maintenanceStartDate);
       const maintenanceEnd = new Date(maintenanceEndDate);

       if (now >= maintenanceStart && now <= maintenanceEnd) {
           Logger.info(
               "Access to the application has been blocked. " +
               "maintenanceFlag=" + maintenanceFlag +
               ", maintenanceStartDate=" + maintenanceStartDate +
               ", maintenanceEndDate=" + maintenanceEndDate
           );
           throwBusinessError(maintenanceTextContent, "Application unavailable due to a planned maintenance break");
       }
   }

   // Priority 3: Schedule
   if (scheduleRuleType === "EXACT_DATE_TIME") {
       const startDateTime = new Date(scheduleExactStartDateTime);
       const endDateTime = new Date(scheduleExactEndDateTime);

       if (now < startDateTime || now > endDateTime) {
           Logger.info(
               "Access to the application has been blocked. " +
               "scheduleRuleType=" + scheduleRuleType +
               ", startDateTime=" + scheduleExactStartDateTime +
               ", endDateTime=" + scheduleExactEndDateTime
           );
           throwBusinessError(scheduleTextContent, "Application unavailable outside the configured availability period");
       }
   } 
   // Note: no support for a date range that crosses the new year (e.g. December 2026 - February 2027)
   else if (scheduleRuleType === "YEARLY_RECURRING") {
       const currentYear = now.getFullYear();
       const cycleStart = new Date(`${currentYear}-${scheduleRecurringStartMonthDay}T00:00:00`);
       const cycleEnd = new Date(`${currentYear}-${scheduleRecurringEndMonthDay}T23:59:59`);

       if (now < cycleStart || now > cycleEnd) {
           Logger.info(
               "Access to the application has been blocked. " +
               "scheduleRuleType=" + scheduleRuleType +
               ", recurringStartMonthDay=" + scheduleRecurringStartMonthDay +
               ", recurringEndMonthDay=" + scheduleRecurringEndMonthDay
           );
           throwBusinessError(scheduleTextContent, "Application unavailable outside the recurring availability period");
       }
   }

   /**
   * Throwing a business error
   */
   function throwBusinessError(textcontentName, errorDescription) {
       const builder = context.getErrorPageDefinitionBuilder();
       builder.bodyTextContent(textcontentName);
       builder.msg(errorDescription);
       context.throwBusinessException(builder);
   }
}
```

{% hint style="info" %}
The method `getOrDefault()`was used to retrieve configuration parameters. If the specified key does not exist, the method returns the default value defined in the script.
{% endhint %}

{% hint style="info" %}
A good practice is to use the method `.msg` when invoking a business error. A clear business message should be passed there - e.g. `.msg("Application unavailable")`. The defined message will be written to the logs, which will make it easier to analyze and identify errors. More information about business errors: [Error pages](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/tworzenie-formularza/strony-bledow.md).
{% endhint %}

To ensure the proper operation of the mechanism, the described script should be attached to the application as **EntryService** (Properties tab).

<figure><img src="/files/92bfbecf02ce46fc2e4fcabaabe5d239356fdde1" alt=""><figcaption><p><em><strong>Figure 1.</strong> Attaching the script as the application entry service</em></p></figcaption></figure>

## Usage examples (Business scenarios)

| Business situation                                        | Configuration                                                                                                                                                                                           | Result                                                                                                                           |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Sudden database error                                     | <ul><li><code>form.globalStatus.isOutage=true</code></li><li>Other parameters unchanged</li></ul>                                                                                                       | The application becomes unavailable immediately.                                                                                 |
| Deployment of a new version scheduled for the weekend     | <ul><li><code>form.maintenance.isScheduled=true</code></li><li><code>form.maintenance.startDate=2026-07-22T13:00:00</code></li><li><code>form.maintenance.endDate=2026-07-22T15:00:00</code></li></ul>  | The application will be unavailable during the indicated period, and once it ends it will be automatically made available again. |
| Recurring availability of the “Good Start” program (300+) | <ul><li><code>form.schedule.ruleType=YEARLY\_RECURRING</code></li><li><code>form.schedule.recurring.startMonthDay=07-01</code></li><li><code>form.schedule.recurring.endMonthDay=11-30</code></li></ul> | The application will be available every year during the indicated period.                                                        |
| Standard application with no time restrictions            | <ul><li><code>form.schedule.ruleType=ALWAYS\_AVAILABLE</code></li><li><code>form.globalStatus.isOutage=false</code></li><li><code>form.maintenance.isScheduled=false</code></li></ul>                   | Application available without restrictions.                                                                                      |

## Examples of unavailability messages

In electronic and mobile banking, word choice in messages (so-called **UX writing**) directly affects the sense of security and customer trust. In Eximee Designer, the content of the displayed message is defined in the artifact **Formatted content** ([TextContent](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/4-tresci/tresc-formatowana-textcontent.md)) specified in the configuration of the appropriate lock type.

### Application availability every year on a specific date

The message should inform the user during which period the application is available and encourage them to use it again at that time.

* **Title:** The application will be available from July 1
* **Content:** You can submit this application from July 1 to November 30. Please come back during this period.

<figure><img src="/files/14cc96ac4c3bdd213924138ab808c76b4a1e5cfb" alt=""><figcaption><p><em><strong>Figure 2.</strong> Example of a schedule-based application unavailability message</em></p></figcaption></figure>

### Failure (“We’re working on it”)

The message should briefly explain the situation, inform the user about the ongoing work to resolve the problem, and indicate what they should do next. Do not include technical details or error codes.

* **Title:** The application is temporarily unavailable<br>
* **Content:** Sorry, we are experiencing technical difficulties. Submitting the application is currently impossible. We are aware of the problem and are working to resolve it. Please try again later.

<figure><img src="/files/42642e08e7368e9d17d2464ee52d3852562d3608" alt=""><figcaption><p><em><strong>Figure 3.</strong> Example of an application unavailability message due to a failure</em></p></figcaption></figure>

### Maintenance break

The content of the message during the maintenance break should clearly state when the application will be available again.

* **Title:** Maintenance work in progress<br>
* **Content:** This application is unavailable due to planned maintenance work. The work will last until 16:00. We apologize for the inconvenience and invite you to come back after that time.

<figure><img src="/files/063d115c51e0b3df09953c0f012df76a5f931e40" alt=""><figcaption><p><em><strong>Figure 4.</strong> Example of an application unavailability message due to a maintenance break</em></p></figcaption></figure>

{% hint style="info" %}
Demo application: demoFormUnavailability\_app
{% endhint %}

{% hint style="info" %}
Download the file and import it into Eximee Designer to run the application in your environment.
{% endhint %}

{% file src="/files/2f4c66a222ba6cf6b4a518253c03b30c9f041c8c" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/sterowanie-dostepnoscia-wniosku.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
