cancel
Showing results for 
Search instead for 
Did you mean: 

How to query an association attribute ?

Occasional Contributor

How to query an association attribute ?

Hello,

 

we modified the metamodel by adding a meta-attribute ("YMLS2") for the association between 2 classes ("Objet partagé" and "Enchainement").

How can I get this attribute value with a query for a specific Object ?

 

Tnahks for help.

 

Yves-Marie

LE SAUX Yves-Marie
4 Replies
MEGA

Re: How to query an association attribute ?

 

 

Use the following syntax
[<MetaAssocationEnd name>].[<MetaAttribute name>]=<Value>

 

Example
Select [Business Process] Where [Component].[Order] = "10"

 

Note that syntax is more subtle when several condition are related to the same link (MetaAssociationEnd)
This query is not correct
Select [Business Process] Where [Component].[Name]="Business Process-1" And [Component].[Order] = "10"
This query is correct
Select [Business Process] Where [Component].([Name]="Business Process-1" And [Order] = "10")

 

See online documentation for more details
HOPEX Power Studio (EN) : Customizing the Metamodel : Query Syntax

 

Jerome
Highlighted
Occasional Contributor

Re: How to query an association attribute ?

Thanks for this reply.

 

In our case, our aim is to get the attribute value in an Excel macro.

So is there a way to select the association itself ? (to get and display the attribute value)

 

Yves-Marie

LE SAUX Yves-Marie
MEGA

Re: How to query an association attribute ?

 

You need to learn how to browse metamodel using API script

 

See online documentation

HOPEX Power Studio (EN)  :  HOPEX APIs   :  All about starting with APIs   :  API Use Principles 

Jerome
Contributor

Re: How to query an association attribute ?

if you have a sample code to what you are trying to achieve may be I can help further.