Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 - Asset Console Creating an Access Definition File Guide


[ASSET_ITEM_LOOP] (class search loop)

[ASSET_ITEM_LOOP] specifies a class search loop. One class search loop is specified for each information item to be searched. The class search loops iterate the number of times that the specified conditions are matched.

A combination of the [CLASS_FIND], [ASSOC_FIND], and [JOIN_FIND] tags can be used for the class search conditions. For details about these tags, see [CLASS_FIND] (find object class), [ASSOC_FIND] (find association class), and [JOIN_FIND] (find joined class).

Organization of this page

Syntax

[ASSET_ITEM_LOOP]
  [CLASS_FIND]
  search-conditions-for-class
   . . .
  [BEGIN]
   processing-on-search-results
   . . .
  [END]
[ASSET_ITEM_LOOP_END]

Values

Status

The following table lists and describes the possible statuses:

Status

Description

NORMAL

NODATA

End of data.

ERROR

MULTI

Legend:

—: Not applicable

Remarks

Whether or not processing in an [ASSET_ITEM_LOOP] is terminated is determined according to the status referenced by the [ASSET_ITEM_LOOP_END] loop end tag. If the status is NORMAL, processing continues. If the status is other than NORMAL, processing terminates. This last fact is useful when an error that occurs during processing interrupts processing at the point the error occurred.

When processing continues until no data remains, before determining whether or not to end processing according to the [ASSET_ITEM_LOOP_END] tag, we recommend that you use the $SETSTATUS embedded function to explicitly specify NORMAL as the status.

The status of the access definition file is updated on an ongoing basis by execution of tags and embedded functions. If processing that updates the status is specified more than once in an [ASSET_ITEM_LOOP] tag, you must determine whether or not to terminate processing based on the status that was last specified.

Example

The following example outputs a list of installed software names for asset ID 10000:

[ASSET_ITEM_LOOP]
  [ASSOC_FIND]
    InstalledListLink
  [FIND_DATA]
    InstalledInfo.AssetID = '10000'
  [CLASS1]
    InstalledInfo
  [CLASS2]
    InstalledList
  [GET_VALUE]
    INSTNAME = InstalledList.InstalledName
  [SET_VALUE]
    MSG = 'Installed Software Name :' +INSTNAME
    $ECHO(MSG)
    $SETSTATUS('NORMAL')
[ASSET_ITEM_LOOP_END]
Execution result:

Installed Software Name : InstalledSoftware A

Installed Software Name : InstalledSoftware B