[ASSOC_FIND] (find association class)
[ASSOC_FIND] uses an association class to search classes.
If the class being searched matches the specified conditions, its property values are substituted into the declared variables. You can specify the [ASSOC_FIND] tag the number of times of required to find the base object class.
Syntax
[ASSOC_FIND] association-class-name ([FIND_DATA]) condition-expression [CLASS1] object-class-name [CLASS2] another-object-class-name [GET_VALUE] assignment-statement ([ORDER_ASC] or [ORDER_DESC]) sort-key
Values
-
association-class-name
Codes the name of the association class to be searched.
-
object-class-name
Codes the name of an object class that is linked by the association class.
-
another-object-class-name
Codes the name of another object class that is linked by the association class.
-
condition-expression
Codes the condition expression. To specify multiple search conditions, join them with an operator. For details about the operators that can be used in condition expressions, see 2.2.4 Operators.
You can omit the [FIND_DATA] tag if you do not use a condition expression.
-
assignment-statement
Codes an assignment statement into which property information from found classes is substituted. To acquire a display name, add the at mark (@) to the end of class.property.
-
sort-key
To sort the results, specify a sort key, in the format class.property. The [ORDER_ASC] tag sorts results in ascending order, and the [ORDER_DESC] tag sorts results in descending order. If the tag is omitted, the results are sorted in the order of properties specified by the [GET_VALUE] tag.
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end. |
NODATA |
No data satisfies the search conditions. |
ERROR |
— |
MULTI |
— |
Example
The following example acquires the group to which user ID user1 belongs:
[ASSOC_FIND] MemberLink [FIND_DATA] UserInfo.UserID = 'user1' [CLASS1] UserInfo [CLASS2] GroupInfo [GET_VALUE] FULLPATH = GroupInfo.FullPathName [SET_VALUE] STATUS = $GETSTATUS() [IF] STATUS = NORMAL [THEN] [SET_VALUE] MSG = 'FullPathName :' +FULLPATH $ECHO(MSG) [ELSE] [SET_VALUE] MSG = 'ASSOC_FIND (' +STATUS+ ')' $ECHO(MSG) [IF_END] |