14-04-2016 12:06 PM
I have the following data:
Application Owner
Application1-ABC Owner1
Application2-ABC Owner2
Application3-DEF Owner3
I get the Applications using getCollection and I also need to retrieve the application owners. There is a registed query I can use to get this information which is "APM - Get Application owner". This query is an Internal query and accepts a Name as a paramenter.
set myCollection = GetRoot.getCollection("Application")
for each itemCollection in myCollection
print itemCollection.Name
set appColl = itemCollection.getCollection("APM - Get Application owner")
if appColl.Count > 0 then
for each appItem in appColl
print appItem.getProp("Email")
next
end if
nextI am getting an error while executing the highlighted part of the code, using either getCollection or getSelection. How do I use the Internal query in the script window? How do I pass the required parameter for this query to work?
Thank you very much in advance.
Solved! Go to Solution.
28-04-2016 04:23 PM
Hello, I think you can find your answer here :
Regards,
Lionel
14-04-2016 01:41 PM - edited 14-04-2016 01:46 PM
Dear aalarc,
One solution could be to make this kind of "GetSelection" on the metaClasse used to modelise your application owner using the dual metaAssociation (opposite metaAssociationEnd) of "APM - Get Application owner" and in parameter you use your itemCollection.GetProp on the Short Name.
Here is a rough code in a total another context.
aMegaDiags = oMegaRoot.GetSelection("Select [Diagram] where [Described-application].[_HexaIdAbs]=""" & flow_source_hexaidabs & """")
aMegaSources = oMegaRoot.GetSelection("Select [Org-Unit] where [DGC - Org-Unit type]=""" + flow_type_target_abreg + """ and [Short Name]=""" + flow_target_application + """")
Sorry for not contextualizing it for your APM model.
I hope it will be helpfull for you.