Find all references to a conditional expression

This entry is part of the Conditional Expressions HowTo.

Conditional expressions are one of the most powerful tool in the hand of a skilled TPAE specialist. However, when things get complex it may be hard to track where all custom conditional expression are referenced in your environment. That’s why I have spent some minutes developing a small set of SQL queries to list those references from the TPAE database.
First of all, conditional expressions are stored in the CONDITION table. The other tables that has reference to this table are:

  • CTRLCONDITION/CTRLGROUP
  • APPLICATIONAUTH
  • SECURITYRESTRICT
  • MAXDOMVALCOND
  • CROSSOVERDOMAIN

Let’s look at all these tables one by one.

CTRLCONDITION/CTRLGROUP

Conditional Expressions can be used into Application Designer through the ‘Configure Conditional Properties’ button. These conditions can then be used to set specific properties to a UI control.

SELECT ctrlgroup.app, ctrlgroup.optionname, ctrlgroup.groupname, ctrlcondition.conditionnum
FROM ctrlcondition
JOIN ctrlgroup ON ctrlgroup.ctrlgroupid=ctrlcondition.ctrlgroupid
JOIN condition ON condition.conditionnum=ctrlcondition.conditionnum
WHERE ctrlcondition.conditionnum IS NOT NULL;

APPLICATIONAUTH

Applications SigOptions can be activated upon the evaluation of a Conditional Expression (see Security – Security Groups – Applications)
The following query will list all the SigOption with a bounded conditional expression together with all the applications and groups.

SELECT a.app, a.groupname, a.optionname, a.conditionnum, c.expression, c.type
FROM applicationauth a
JOIN condition c ON a.conditionnum=c.conditionnum
WHERE a.conditionnum IS NOT NULL;

If you are not interested in which group has access to a specific SigOption the following query returns a much shorter list.

SELECT a.app, a.optionname, a.conditionnum, c.description, c.expression, c.type
FROM applicationauth a
JOIN condition c ON a.conditionnum=c.conditionnum
WHERE a.conditionnum IS NOT NULL
GROUP BY a.app, a.optionname, a.conditionnum, c.description, c.expression, c.type;

After having identified the SigOption, you can check the application presentation XML to find the linked control.

SECURITYRESTRICT

Security restrictions can be applied to an object or an attribute and can be linked to a Conditional Expression (see Security – Security Groups – Select Action Menu – Global Data Restrictions)

select * from SECURITYRESTRICT;

MAXDOMVALCOND

Conditions can be set on crossover domains (see System Configuration – Platform Configurations – Domains – ALN Domain)

SELECT * FROM maxdomvalcond WHERE conditionnum IS NOT NULL;

CROSSOVERDOMAIN

Conditions can be set on crossover domains (see System Configuration – Platform Configurations – Domains – Crossover Domain

SELECT * FROM crossoverdomain WHERE conditionnum IS NOT NULL;

Find all references to a conditional expression

9 thoughts on “Find all references to a conditional expression

  1. Hi can we able to apply conditional expression on applications dialog box popup in maximo 7.5 , please let me know we are not able to get this ,

    Ex : pupup is view history dialogue box .

    Thanks
    rs

  2. Hi,
    Is it possible to put a condition on a ALNDOMAIN value (associated with and assetattribute) based on the value of another assetattribute?
    also, is it possible to put a condition on an ALNDOMAIN value based on the classification selected on an Asset?
    Thanks

  3. Hi,
    Is it possible to put a condition on a ALNDOMAIN value (associated with and assetattribute) based on the value of another assetattribute?
    also, is it possible to put a condition on an ALNDOMAIN value based on the classification selected on an Asset?
    Thanks

  4. With this you can find all conditions

    SELECT 'select distinct '
    || uniquecolumnname
    || ' as uniqueid, '''
    || uniquecolumnname
    || ''' as uniquecolumnname ,'
    || attributename
    || ', '''
    || attributename
    || ''' as attributename , '''
    || o.objectname
    || ''' as objectname from '
    || o.objectname
    || ' where '
    || attributename
    || ' is not null union' AS sqloutput
    FROM maxattribute a
    JOIN maxobjectcfg o
    ON o.objectname = a.objectname
    JOIN maxtable t
    ON t.tablename = o.entityname
    WHERE sameasobject = 'CONDITION'
    AND sameasattribute = 'CONDITIONNUM'
    AND o.persistent = 1
    AND o.persistent = 1
    AND o.isview = 0
    AND a.persistent = 1

    SELECT t.*,
    c.expression ,
    ' select * from '
    ||t.objectname
    ||' where '
    ||t.attributename
    ||' ='''
    ||t.conditionnum
    ||''' ;' AS selectclause
    FROM (
    — sqloutput from above in here

    — end sqloutput from above
    )t
    JOIN condition c
    ON t.conditionnum=c.conditionnum
    WHERE t.conditionnum in ('[CONDITION TO CHECK]') ;

  5. Trying to figure out why the columns on the CTRLCONDPROP MBO cant be retrieved and/or updated when working with MxLoader. I have even moved to using your most recent 6.1 version and the MXL_CTRLGROUP Object Structure created by MxLoader in the DB.

    I have tried using the relationship/table name prefix as well as full path. Here are samples
    CTRLCONDPROP.PROPERTY
    OR
    CTRLGROUP.CTRLCONDITION.CTRLCONDPROP.PROPERTY

    How can I migrate Conditional UI fully if I cant get the CTRLCONDPROP columns extracted and/or loaded?

    Thanks,
    Miller

  6. Hello,

    Is it posible to maka actual tab work order tracking application ‘read only’ for a specific security group using conditional expression?

  7. Hi Bruno,

    Thanks a lot for sharing. You really help us all a lot.
    Just wanted to add a small correction for crossoverdomain query:
    SELECT * FROM crossoverdomain WHERE SOURCECONDITION IS NOT NULL;

    Thanks & Regards,
    Divya Aggarwal

    1. Second query for checking destination condition in crossoverdomain:
      SELECT * FROM crossoverdomain WHERE DESTCONDITION IS NOT NULL;

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top