Skip to content

MBOs in Automation Scripts: Attributes with Value Lists

In our previous posts in this series, we talked about how an MboSet is a collection of Mbo objects. This is analogous to a spreadsheet of data representing an MboSet, and a single row within that spreadsheet representing an Mbo. This article will discuss how to work with attributes on an Mbo that have an associated value list. A given attribute of an object may have a list of valid values associated with it. This is typically used to display a drop down or value list to the user from which a specific value may be selected. A method called getList() has been provided to allow retrieval of this kind of list for those attributes that support one. The method returns a MboSet object from which values can be extracted for display to the user. Suppose the desired result is a list of valid asset identifiers for the “assetnum” attribute on a work order object. The following code could be used to retrieve this information:
assetList = mbo.getList("assetnum")
The call to the getList() method with the attribute name “assetnum” as its argument returns a MboSet object with an MboSet of valid asset objects for this work order. The list of valid values for the work order object’s “assetnum” attribute can be built by extracting the “assetnum” value from each of the objects in the assetList variable. This would be accomplished via standard mbo.getString(“assetnum”) calls on each of the objects in the list. Note that assetList is a fully functional collection object, any of whose member methods may be called in the usual way. For example, it is possible to add new members to the collection or modify member attributes. If the specified attribute passed to getList(attribute) does not support a value list, a null is returned. To determine whether a given attribute does support a list, the hasList(attribute) method in the MboValueData class should be called – see the previous article on Reading Multiple Attributes of an Object in the Collection. The getList(attribute) method is available for both MboSets and Mbo classes. Even in an empty collection object the getList(attribute) method can be called successfully, with some exceptions. For example, whether or not the “problemcode” attribute has a value list depends on whether a value has been selected in the “failurecode” attribute of the given work order. Thus, if the getList(attribute) method is being accessed through a MboSet object, in the case of the “problemcode” it does matter what the current object is.

Share This

Related Posts

IBM-Maximo-stop-list-item-troubleshooting-database-search-e1636560926489
Using a Global System Properties in an Automation Script
Maximo has a neat feature where you can set any value in the global property, and it will default to...
ibm_mxmobile_maximo-mobile_app_maintenance_reliability_work_order_asset_management_inventory_count_create_meter_reading
MxMobile Update January 2023 Release
As an IBM Maximo mobile solution provider, A3J Group consistently improves the functionality and features...
ibm_mxmobile_maximo-mobile_app_maintenance_reliability_work_order_asset_management_inventory_count_create_meter_reading
MxMobile Update November 2022 Release
As an IBM Maximo mobile solution provider, A3J Group consistently improves the functionality and features...

No Responses

No comment yet, add your voice below!


Add a Comment