Quantcast
Channel: PTC Community : Unanswered Discussions - Windchill
Viewing all articles
Browse latest Browse all 3592

Find global attribute definition id

$
0
0

Hi.

How  to find global attribute definition id by logical identifier?

I'm trying to use next code:

 

        /* attributeId is Logical Identifier of my global attribute */

        long IBABooleanDefinitionId = 0;

        BooleanDefinition booleanDefinition;

        QuerySpec querySpec = new QuerySpec(BooleanDefinition.class);

 

        CompositeWhereExpression whereExpression = new CompositeWhereExpression(LogicalOperator.AND);

        whereExpression.append(new SearchCondition(BooleanDefinition.class, WTTypeDefinition.LOGICAL_IDENTIFIER, SearchCondition.EQUAL, attributeId), new int[]{0});

        querySpec.appendWhere(whereExpression, new int[]{0});

 

        QueryResult queryResult = PersistenceHelper.manager.find((StatementSpec) querySpec);

        if(queryResult.hasMoreElements())

        {

            booleanDefinition = (BooleanDefinition) queryResult.nextElement();

            IBABooleanDefinitionId = booleanDefinition.getPersistInfo().getObjectIdentifier().getId();

        }

 

I have wt.query.QueryException that "logicalIdentifier" does not belongs to class wt.iba.definition.BooleanDefinition

Ok, but i cannot find field "logicalIdentifier" in BooleanDefinition though Logical Identifier textfield exists in global attribute creation form.

How should i fix my code?

Thanks.


Viewing all articles
Browse latest Browse all 3592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>