States

States are called by Objects and are defined by Processes. The State record contains information about how a record looks and acts at a specific period in time.

A State record definition can include the following:

  • The State name.
  • The display screen to use in order to display the record or records.
  • The initialization process used when a list is first displayed.
  • The format to use to display the data.
  • The input condition to indicate whether or not a user can modify the record.
  • The Process to run when a user triggers a specific display option (Display Action).

The State record used depends on how many records the user views. There are out-of-box State records for searching for records, viewing a list, viewing a single record, and browsing a record.

Searching

When there are no records in the current file variable, it is assumed that the user is in “search” mode. The State that is used is the “Search State” defined in the table’s Object record. The default search state is “db.search”.

Record Lists

When viewing a list of records, the “List State” defined in the table’s Object record is used. The default list state is “db.list”.

Note In some earlier versions of Service Manager, record lists are referred to as QBE lists.

Viewing a single record

When viewing a single record, the record is first checked to see if it includes a “State” field in the dbdict. If the field exists and is populated, the contents of that field will be used as the current State of the record. If this field does not exist or is NULL, the “Default State” defined in the table’s Object record is used. The default value for the default state is “db.view”.

Browsing a record

When browsing a record in read-only mode, the “Browse State” defined in the table’s Object record is used. Note that only files that use locking need a browse State. Although viewing a record without having update rights looks similar to the browse screen, it is using the default State, not the browse State. There is no default browse state.

Integration tips for display application

If a display screen does not have any display events associated with it, the system automatically uses the se.default display event that performs se.lock.object in case of “OnFormModified”. If a display option record has the “Modifies Record” check box activated, the record is locked when the button is pressed.

Create and update States

To create a new State, follow these steps:

  1. Access the Document Engine. See the Accessing the Document Engine section in Document Engine overview
  2. On the State Definition form, fill in the fields required to create a State to perform the functions you desire.

 

To modify an existing State, follow these steps:

  1. Access the Document Engine. See the Accessing the Document Engine section in Document Engine overview
  2. Enter the name of the State you want to modify in the State field or click Search to search for the State.

State Definition field descriptions

The State definition record defines the behavior and display specifications for a record at a specific period in time.

In the State record non-base methods can be defined or the behavior of base methods can be modified. Base methods are described in the sections Base functions in se.search.engine, Base functions in se.view.engine, and Base functions in se.list.engine. They include functions such as save, find, fill, OK, Cancel, and Search.

The field descriptions for the State Definition form are:

Field Name Description

State

state

Specifies the name of the State. (required)

Display Screen

display.screen

The display screen to associate with the State.

Initialization Process

init.process

The name of a Process to run prior to entering the State.

Format

format.name

Specifies the format in which the State record opens. This form is stored in a record, and it can be a variable or hard-coded. The name of the format can be hard-coded or be contained in a variable or retrieved from a record via a system language expression.

Input Condition

input.condition

The input condition is evaluated for view States and determines whether or not the record is read-only. Specify false for read-only or true for editable. You may also enter an expression that evaluates to true or false.otherwise, enter true or enter an expression that evaluates to true or false.
Non-base methods

Display Action

process.label

Specifies the action parameter that comes from a display action after input from a user. The display action comes from the action field in the display option of a button or menu item clicked by a user.

Process Name

valid.process

Specifies the name of the Process run as a result of the action.

Condition

process.condition

Specifies an expression that evaluates to true for the Process specified in the Process Name to be called.

Save First

run.save.before

Choose to run the save Process before you run this Process. Type true to save first; otherwise, enter false. The default is false.