cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Objects of a specific MetaClass from a generic MetaAssociation

alros
Super Contributor

For example the IT Cityplan area MetaClass has the MetaAssociation "Hosted Element". We now want to get only the hosted elements of the MetaClass "Application" using Java API. How can this be done?

 

cpa.getCollection("Hosted Element")

 

returns a MegaCollection of a generic MetaClass with multiple SubMetaClasses (For example Application, Server, Database, etc.)

2 Replies

alros
Super Contributor

Thanks for your reply. The Javadoc marks getType() as deprecated but says that filter() is the way to go. Thus

cpa.getCollection("Hosted Element").filter("Application")

 

does the trick in the example provided above.

jhorber
MEGA
MEGA

Hello alros

 

You should us GetType to filter the collection.

 

Example (VB script)

 

Set cBE = GetCollection("~JW7j6VRt9H40[BPMN Element]")
Print "Number of BPMN Element objects: " & cBE.count()
Set cOP = cBE.GetType("~gsUiU9B5iiR0[Organizational Process]")
Print "Number of Organizational Process objects: " & cOP.count()

 

Jerome