Identifying the Knowledge Not Stored in Attributes
Items of some classes can contain one or more values that are distinct from the items' attributes. For instance, a variable or parameter can contain a value, and can be defined to also contain history datapoint values. Also, lists and arrays can contain values and references to other items in their elements. See the appropriate chapter in this document for more information about the knowledge that these items can contain.
Identifying the Status Knowledge of Items
Items also contain several kinds of status knowledge:
enable or disable from the item's menu.
A permanent item continues to exist in the current KB after the KB is reset or restarted. When you save the current KB to a file, only the KB's permanent items are stored in the KB file.
A transient item does not continue to exist in the current KB after the KB is reset or restarted. Likewise, a KB that has been loaded but not yet started contains no transient items. When you save the current KB to a file, the KB's transient items are not stored in the KB file.
After being created interactively, an item is permanent. For instance, any item that you create by selecting from the
KB Workspace > New Object menu is a permanent item. When you create an item programmatically, using the
create action, that item is transient.
To make an item permanent:
Execute the make permanent action with the item as the argument.
To make an item transient:
Execute the make transient action with the item as the argument.
for any transaction T
if the status of T is not message-sent
then in order
create a transaction-message TM and
conclude that the status of TM is unsent
and make TM permanent
g2-system-predicate system procedure to obtain any item's permanent/transient status:
To determine if an item is permanent or transient programmatically:
g2-system-predicate
(item-to-check: item-or-value; predicate: symbol)
-> permanent-transient-showing: truth-value
permanent, transient, or showing.
You can only set the active/inactive status of activatable subworkspaces. You perform this action programmatically.
To activate an activatable subworkspace programmatically:
Use the activate and deactivate actions.
For more information about how G2 activates workspaces, see Activating and Deactivating Workspaces.
In addition, G2 cannot activate these items:
BAD.
You can disable an item only interactively. Once disabled, an item is effectively deactivated, and its activation status is inactive. Changing the enabled/disabled status of an item propagates to the items below it in the KB workspace hierarchy. Enabling or disabling a workspace affects the items that reside upon it, causing them all to become deactivated. Enabling one or more items that reside upon a disabled workspace has no effect until the workspace status is active and enabled.
To change the enabled/disabled status of an item:
Select enable or disable from the item's menu.
To enable all disabled items in the current KB:
Select Main Menu > Run Options > Enable All Items
When you enable an item, G2 immediately activates the item, unless there is another item above it in the workspace hierarchy that is not activated. If the enabled item is an activatable subworkspace, it is activated only when it is the target of an
activate action. When you disable an item, G2 cannot activate it, even if the item meets all other criteria for activation.
When you save the current KB, G2 also saves the knowledge of which items are disabled. Thus, items will continue to be disabled after you next load that KB.
OK, INCOMPLETE, or BAD and reflects whether the item knowledge is valid for KB participation. G2 changes the participation status of an item appropriately as the knowledge an item contains is updated. The
OK, INCOMPLETE, BAD status of each item appears in its Notes attribute. The next table summarizes the meaning of each setting:
For example, after you create a new class definition, G2 initializes the status of the item to
incomplete until you specify new values for the item's Class-name and Direct-superior-classes attributes. Notes attribute of an item can also contain other useful information. For example, the status of an item may be OK, but if the item resides upon a disabled workspace, it cannot participate in KB processing. Such a status is displayed in the item Notes attribute with a message such as:
OK, but some superior item is either DISABLED or not OK.
Notes attribute, you can reference this status in expressions. For instance, when debugging your KB, use the Inspect facility to construct a command like this:
show on a workspace every acid-bath-tank whose item-status is incomplete
show on a workspace every help-organizer with notes
Notes attribute does not contain the value OK. The
Notes attribute is a composite attribute, as described in Chapter 12, Attribute Access Facility. You can refer directly to the status information of active items that the Notes attribute contains by referring to the item-status of an item, and to the actual notes of an item using the item-notes.
To refer to the item-status of an item:
the item-status of item->{OK | INCOMPLETE | BAD}
To refer to the item-notes of an item:
the item-notes of item->{none | sequence ( [ text [,...] ] }
an instance of an object or given by a variable or parameter.