Most user-defined classes have user-defined attributes, and all classes have system-defined attributes, such as
Notes, Item-configuration, and Names. Item passing lets you determine which user- or system-defined attributes to pass from one G2 to another. G2 supports item passing in several ways:
Note: User-accessible system-defined attributes are those that are available through the attribute access facility, and which appear in the G2 Class Reference Manual.
Configuring the KB for Passing an Item with Attributes
To configure a KB for item passing using a remote procedure declaration:
You can include all system attributes or those that you declare explicitly, but you cannot exclude system attributes as you can user attributes.
You can specify one or more of these possibilities as part of the remote procedure declaration syntax.
The including or excluding of user- or system-defined attributes is specified through the grammar of a remote procedure declaration. Though a remote procedure declaration can include multiple variations of its grammar, this section describes the grammatical options separately. You can combine these options in any syntactically meaningful way. For example, two topics discussed are:
Within a remote procedure declaration, you can combine such statements, along with others, to include some attributes and to exclude others.
To pass an item with all user-defined attributes:
declare remote procedure-name (class class-name)
An important point to note is that including or excluding any user- or system-defined attributes can be declared only once for each argument. Making such inclusions and exclusions can, therefore, be applicable to multiple items. As an example, an argument for a remote procedure
xproc consists of a sequence. The sequence being passed to xproc consists of several instances of the same class:
sequence (my-object1, my-object2, my-object3, my-object4)
MY-OBJECT class included attributes temperature and volume, and you specified the remote procedure declaration to include only the temperature attribute:
declare remote procedure xproc
(sequence including only the user attribute temperature) = (truth-value)
temperature attribute, and none could include the volume attribute.
including only the user attributes grammar excludes all remaining user-defined attributes by default.
To pass an item including certain user-defined attributes:
declare remote procedure-name (class class-name including only the user {attribute | attributes:} attribute-name [,...]
attributes statement, and the attributes themselves are separated with a comma (,).
PROCEDURE as a procedure argument:
![]() |
Passing An Item Excluding User-Defined Attributes
You can pass an item with all of its user-defined attributes, except for those you exclude. Explicitly excluding one or more user-defined attributes includes the remainder. By default, passing any item includes all of its user-defined attributes and none of its system-defined attributes.
To pass an item excluding certain user-defined attributes:
declare remote procedure-name (class class-name
excluding theuser{attribute|attributes:} attribute-name [,...]
attributes statement, and the attributes themselves are separated with a comma (,).
OBJECT
When passing object values, keep in mind that:
with system attribute current value of variable-or-parameter
AUTO class that includes a tire-pressure attribute, which is given by a float-variable. The purpose of the RPC is to pass:
auto object to the remote procedure, check-pressure.
tire-pressure attribute and its current value.
![]() |
Passing An Item With System-Defined Attributes
You can pass one or more user-accessible system-defined attributes, or those that you include explicitly. The system attributes that you can pass are those that are accessible through the attribute access facility and that appear in the G2 Class Reference Manual.
To pass an item including one or more system-defined attributes:
declare remote procedure-name (class class-name
including {all system attributes |
the system {system-attribute | system-attributes:} attribute-name [,...]
including the system attribute: name of item
Specifying a system attribute that is not applicable for the class, such as entering
current value of variable-or-parameter when the item is not a variable or parameter subclass, passes the item to the remote G2 process with only its appropriate user- or system-attributes.
PROCEDURE. It passes all system-defined attributes with the first argument, and includes only two attributes with the second:
![]() |
This example shows the remote procedure declaration passing the current value and the history of an integer variable, and the name of a
TANK item:
![]() |
Passing Both User- and System-Defined Attributes
You can specify both user- and system-defined attributes for a single remote procedure argument, using any combination of values. Here is an example of how to pass history values along with a user-defined attribute.
![]() |
Passing An Item With Attributes and A Handle
The ability to pass an item handle, in addition to any user or system attributes, has been implemented for use in G2 Gateway. While the grammar to support this functionality exists, using the optional [with handle] statement is not applicable to G2-to-G2 item passing. Specifying One or More Remaining Arguments
After declaring the specific arguments of a procedure, you can optionally specify zero or more remaining arguments of one type using the all remaining statement as the last part of the remote procedure declaration.
To specify a remaining number of arguments:
all remaining {item-or-value | value }
item-or-value
value
sequence
all remaining item-or-value:
![]() |