Domains: Conditionally displaying domain values

Pinned
Publish Date
Tags
configuration
java
automation script
Status
Completed
 
The following domains allow conditionally displaying values.
  1. ALN
  1. Numeric
  1. Table
  1. Cross Over
  1. Synonym

ALN, Numeric and Synonym Domains

It is the same process to conditionally show values in ALN, numeric and synonym domains.
e.g. We have an object TEST which have attributes STATUS and TYPE. Status has ALN domain for which valid values are only APPROVED, COMPLETE and PENDING. We want to show value of APPROVED only when another field (i.e. TYPE) is equal to NEW.
Step 1: Create Condition
In Conditional Expression Manager create a new condition. Enter the following as the condition. :type = 'NEW'
notion image
Step 2: Assign condition to domain value
Open the domain in Domains application. Against the value APPROVED click new row and select the condition created in previous step. Optionally you can also select the object.
notion image
Check this in application.
notion image
Now it will only show the value APPROVED when TYPE is NEW.
notion image
 

Table and Crossover domains

There are two methods for conditionally displaying values for crossover / table domains
  1. Where Clause
    1. For Table and Crossover domains the List Where Clause define the listing criterion
      notion image
  1. Using an Automation Script Set the domain using domainid the where clause using listWhere and order using listOrder implicit variables on an attribute launch point based automation script. It should use the Retrieve List event
    1. notion image
      if attributeName == 'XYZ': domainid = "DOMAIN1" else domainid = 'DOMAIN2' listWhere = "company like 'ABC%'" listOrder = "company"
  1. Using Java Class This class should be attached to an attribute in database configuration. Ideally the class should extend MAXTableDomain and the logic is defined in getList() function and where clause is set in setListCriteria(String var) function
    1. public class AttributeList extends MAXTableDomain{ public AttributeList(MboValue mbv) throws MXException { super(mbv); } public MboSetRemote getList() throws MXException, RemoteException { MboRemote mbo = getMboValue().getMbo(); if (mbo.getString("DESCRIPTION").equals("XYZ"){ setListCriteria("company like 'ABC%'"); } return super.getList(); } }