Uniface Runtime Processing

In a Uniface application, when an event occurs or a command is received, a process flow is started that can involve the application shell used to start the application, the application components, the entity occurrences, and the fields they contain.

When developing your application, think logically about where processing should occur. For example, if you need to perform a series of data validation checks in the course of an edit session for a component, do not wait until the user tries to store the data before carrying out those checks. There are many different opportunities to script behavior in triggers and other ProcScript modules on all levels for you to check as you go.

How the application responds to events and commands is determined by how and where you script behavior in the triggers and other code containers at all levels.

Levels of Processing

All applications feature the following levels of processing:

  • Application-Level Processing is associated with the application shell. Events that trigger application-level processing can include receiving an asynchronous message or quitting the application.
  • Component-Level Processing is associated with all types of Uniface component (including forms, dynamic server pages, and services). It affects the whole component, and typically involves saving all data in the component, retrieving data into the component, and printing the visible data.
  • Entity- and Occurrence-Level Processing is mostly associated with the current entity occurrence. A runtime entity is a collection of occurrences, so most entity-level processing is occurrence-level processing. It is often associated with data retrieval and store events that are initiated at the component level and cascade down to the occurrence level.
  • Field-Level Processing is associated with the current field in the current occurrence.

In addition:

Process Flow

The process flow is influenced by default Uniface behavior, user events, system events, and ProcScript commands. Events and commands can have cascading effects across different levels. The process flow of a typical application session takes place at all these levels, and usually in constant combination with each other.

For example, when you run a Uniface application:

  1. Uniface creates an instance of the application shell, using the compiled definition in the application's .aps. (In the case of web applications, a default application shell for the Uniface Server is used. )

  2. Uniface then activates the apStart trigger of the application shell to initialize parameters and activate the first component in the application.

  3. When activating a component, Uniface creates a component instance using the compiled component definition (for example, the .dsp, .frm, or .svc file).

  4. Uniface then processes the exec operation of the component. Typically the ProcScript in this operation contains an instruction to retrieve data into the component before displaying or processing it.

  5. When retrieving data, Uniface processes the entity-level read trigger for every occurrence of every entity that is retrieved from the database. The order in which processing occurs depend on the order and nesting of entities in the component structure. This determines the active path and current occurrence at runtime.

  6. If encrypted field data is retrieved from the database, Uniface also activates the field-level formatFromDbms trigger for each encrypted field when reading the data, and the formatToDbms trigger when writing the data back to the database.

Related Topics