Entity Edit MQEB

This is the main screen for creating and amending entities. It is also the screen which appears when you invoke the Copy action from the screen Entity - List, MQEA.

Before using this screen, please make sure that you are familiar with System Administration Entities.

Copying Entities

When you enter this screen from MQEA with the Edit Copy action, then the complete definition of the selected entity is made available for you to amend as required before creating the copy under a new name. (This is unlike the screen Entity - Copy, MQEC, which creates an identical copy under a new name.) Copies created with this screen remain in the same company; MQEC can create copies in other companies.

Creating and Amending Entity Definitions

To create a new entity, first enter a name and description, and nominate a base table. Next, use the action Explode to create a full set of attributes which refer directly to the columns on the base table. These attribute definitions are complete, including description and class. Once you have this basic entity definition, you can delete, add, or redefine attributes as required. To add Methods to a new entity, you have to define each one as necessary (but this need not be onerous, because the Clipboard and Fetch are available for copying elements from other entity definitions).

Alternatively, make a copy of an existing entity and then amend the new entity, either during or after the copy (see above).

Which of these methods you use depends on the purpose of the new entity, and whether any of the pre-existing entities is similar to what you need. In general, you should add new attributes to an existing entity rather than creating a new entity which is identical to an existing one apart from a few extra attributes. (See also the Entities Overview).

Methods

Methods are pieces of MDL code which are attached to entities as though they were attributes. Any number of Methods can be defined for one entity, but only one can be nominated as the Process Method on the first format. Methods are defined in an MDL window.

MDL Window

A Mapping Definition Language (MDL) window is displayed when the action Expand is used for a selected attribute or Method. The Formula field only displays part of the first line of a definition; unless the definition is very short (such as a table column name or a simple lookup), it is unlikely to fit in the space available. To view or enter a more extensive formula definition, you should open an MDL window, in which free-format MDL statements can be entered. Where the formula definition of an attribute or Method exceeds the display length of the Formula field, then two chevrons (>>) are displayed alongside the field (an overflow indicator).

MQEB Fields

Base Table

This is a mandatory field which must contain the name of a currently defined table. The base table is the prime reference table for an entity. All rows from the base table are extracted. Each row extracted from the table is an instance of that entity. An entity may have attributes which reference more than one table. One of these tables must be selected to be the base table.

Security Attribute

This field may contain the name of an attribute on the current entity. The named attribute becomes the security attribute for the entity. The attribute must have a class of BOOLEAN, and be flagged as a function. The formula definition of the security attribute determines the data to which a user has access. Each time an instance of an entity is extracted, the security attribute formula is evaluated; if the formula returns a value of True, then access to the data is allowed. If the formula returns False, then the user is not allowed access to the data.

Process Method

This field may contain the name of a Method defined on the current entity. The named Method contains MDL statements which will be automatically executed; other Methods will only be executed when explicitly invoked within a Mapping Level by the Execute_Method command.

Sel

This field is only displayed when the screen is accessed using the action Entity Attributes from the following screens:

          MQMD Report - Edit

          MQM0  Level Break - Amend

          MQMQ Matrix - Edit

The field Sel  is used to tag a number of attributes to be returned to the calling screen. The required attributes are selected by entering a 'Y' in this field alongside them. For example, whilst on the screen MQMD, the action Enty Attr (Entity Attributes) is used, which transfers you to this screen, MQEB. Using the field Sel, a number of attributes can be selected. The Cancel action then returns you to the calling screen, MQMD, where the selected attributes can be placed on a report layout.

Attribute/Method

This is a key field which must contain an attribute or Method identifier of up to eighteen characters, subject to the normal identifier definition rules. (If the action Explode is used, then the current entity definition is populated with all columns from the base table.)

The default value for an attribute name is the name of the column as defined on the table which the attribute references. The name can be amended. If a Method is being attached to the current entity, there is no default value.

Type

This field can have one of three values, or may be blank. This field is blank for a normal attribute; Y or F indicates an attribute function; M indicates a Method attached to the entity.

Flagging an attribute as a function denotes that the formula definition of the attribute contains a RETURN statement. A RETURN statement is used to pass a value from the formula back to the calling object (in this case, the attribute). A formula may contain a number of RETURN statements within a conditional construct, such as an IF ... THEN ... END_IF statement.

Methods do not return values.

Formula

This field contains part of the first line of the formula definition of the attribute or Method. Normally an attribute definition nominates a column on a table. This may either be the base table, or any other table. Tables other than the base table are referenced using the MDL command LOOKUP.

The formula may also involve some processing. This processing may use columns from tables, or a function call, or any processing which may be defined in MDL.

If the complete formula or Method definition will not fit into the space available, then the Expand action can be used to open an MDL window in which a more extensive formula can be entered. When the complete formula or Method definition is not visible in the Formula field, two chevrons (>>) are displayed alongside the field - the Overflow Indicator. The Formula field is protected in this case, and the Expand action must be used to view or amend the formula or Method definition.

(Overflow Indicator)

This protected field displays two chevrons (>>), if the complete formula definition of an attribute or Method is not visible in the Formula field. When this symbol appears, an MDL window must be opened using the Expand action to view or amend the formula or Method definition.

Description

This is a mandatory field which must contain a description of up to 40 alphanumeric characters. For an attribute, this field defaults to the table column name, but is amendable. There is no default description for a Method.

Class

This field must contain the class of an attribute. The class indicates the type of data to be stored in the attribute. The field defaults to the class of the table column, but it is amendable. No class should be specified for a Method (a Method does not return any data).

Screen Specific Actions

Action

Use

Columns

This action is available when the cursor is on the Formula field of an attribute (on the first format); it takes you to Table Columns - List, MQEE, which displays the columns defined on the entity base table. You can select and return a column name to the Formula field of the selected attribute on this screen. It can also be used when an MDL window is open.

Expand

This action is used on a selected attribute or Method to open an MDL window which contains the formula definition of the selected attribute or Method. The Formula field displays part of the first line of the formula definition of an attribute or Method. If this is not sufficient to enter the complete formula, then this action should be used.

Explode

The action can be used on a table name in the field Base Table. It populates the entity definition with a complete list of columns from the selected table. The Attribute, Description and Class fields are filled from the table column definitions. The attribute definitions can then be amended as required.

Restore

This action works as an "undo" - changes you have made are lost, and the screen is restored to the situation when you first entered it. You are asked to confirm the Restore action before your changes are abandoned.

If not described in this topic, click on a field and press F1 to view help. See Common Fields for more information.

Fast prompt allows you to quickly view a list of options for certain fields.

NOTE Field visibility can be defined by your System Administrator, so not all fields documented may be shown.

See Using the Command Line on opening the screen without going through the menu.

See also

Entity List MQEA

QED Home Page