Book a Demo

Author Topic: Repository.InvokeConstructPicker without filter  (Read 3910 times)

KBi

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Repository.InvokeConstructPicker without filter
« on: March 27, 2015, 10:08:45 pm »
I am using Repository.InvokeConstructPicker in javascript to select elements in my repository. Is there any way to call the selection dialog without limiting which elements can be selected (i.e. without filter)?

Basically, I want to imitate the hyperlink-functionality in the notes of elements. If I do this manually I select some text and click the hyperlink-button in the toolbar. I then select "Element" as hyperlink target type. The "Select Element" window then shows "Types: <any>" in the bottom field and I can select any element that is also visible in the project browser as target.

The problem is: When I call this dialog from a script, the "IncludedTypes="-parameter is mandatory. I have tried setting the filter to an empty string, different wildcards and even null (which crashes the script interpreter), but could not get it to work.

My workaround at the moment is to use a very extensive list for the filter like:
Code: [Select]
var filter = "IncludedTypes=Action,Activity,ActivityPartition,ActivityRegion,Actor,Artifact,Change,Class,Collaboration,Component,Decision,DeploymentSpecification,DiagramFrame,Entity,Event,GUIElement,InteractionFragment,InteractionOccurrence,Interface,InterruptibleActivityRegion,Issue,Node,Object,Package,Part,Port,Requirement,Screen,Sequence,State,StateNodeUseCase";
var elementID = Repository.InvokeConstructPicker(filter);

Unfortunately, I have no idea if this list is complete. I am using EA 10 and do not want to use external addins.

Do you have any recommendations?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Repository.InvokeConstructPicker without filte
« Reply #1 on: March 28, 2015, 12:16:34 am »
Check the help at EA.Element.Type
There's a complete list of element types there.

Geert

KBi

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Repository.InvokeConstructPicker without filte
« Reply #2 on: March 28, 2015, 12:28:52 am »
Ah, I missed that in the documentation. It's still not pretty, but at least the list is complete now.

Thanks a lot.

For reference, this is the code I am now using:
Code: [Select]
var filter = "IncludedTypes=Action,Activity,ActivityPartition,ActivityRegion,Actor,Artifact,Association,Boundary,Change,Class,Collaboration,Component,Constraint,Decision,DeploymentSpecification,DiagramFrame,EmbeddedElement,Entity,EntryPoint,Event,ExceptionHandler,ExitPoint,ExpansionNode,ExpansionRegion,GUIElement,InteractionFragment,InteractionOccurrence,InteractionState,Interface,InterruptibleActivityRegion,Issue,Node,Note,Object,Package,Parameter,Part,Port,ProvidedInterface,Report,RequiredInterface,Requirement,Screen,Sequence,State,StateNode,Synchronization,Text,TimeLine,UMLDiagram,UseCase";