IBM Support

Fetching Dynamic Lookup Lists via Attribute Launch Point with Retrieve List Event

Technical Blog Post


Abstract

Fetching Dynamic Lookup Lists via Attribute Launch Point with Retrieve List Event

Body

In previous versions of Maximo/ICD, we used to write Java codes or create table domain of domains with case statement in list where clause in order to fetch lookup lists dynamically. Then, conditional domains were introduced, but they caused performance issues for large lists and were inefficient for some cases. In latest version (7.6), we have the "Retrieve List" event for Attribute Launch Points which is perfect for this task. Let me go through an example to explain:

 

AIM: Fetching different person groups for different sites for a custom field for groups

STEPS:

0) Assume that there are many sites corresponding to cities such as IZMIR, LONDON, PARIS, etc.

1) Create as many as needed table domains of person groups, namely GR-IZMIR, GR-LONDON, GR-PARIS, GR-COMMON, GR-ALL. They will be used like cases in a switch statement.

2) Go to Database Configuration application and create a custom field same as PERSONGROUP.PERSONGROUP field. Give it the largest table domain (GR-ALL) including all groups needed. Later, define the lookup mapping of custom field using the edit lookupmap button (requires dbconfig and restart respectively)

3) Write the Automation Script below for attribute launch point with Retrieve List event.

# select domain of person groups with respect to cities (sites) using a dictionary
def selectDomain(value):
    return {
        'IZMIR'  : 'GR-IZMIR',
        'LONDON' : 'GR-LONDON',
        'PARIS'  : 'GR-PARIS'
    }.get(value, 'GR-COMMON')
# {}.get() function sets the default value for any other city (site)

# fetch the domain by comparing site (city) of record to the dictionary
siteid = mbo.getString("SITEID")
domainid = selectDomain(siteid)


4) Go to Application Designer, add custom field to your application and write the lookup property for field as "PERSONGROUP".

NOTE: As I remember it did not work with a custom lookup and had shown invalid binding. It worked with the default lookup for person groups which is PERSONGROUP. If it was an ALNDOMAIN, I would prefer its default lookup instead of "VALUELIST".

 

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11130049