Archi Forum

Archi Plug-ins => jArchi => Topic started by: TimHale on April 26, 2019, 13:04:11 PM

Title: jarchi: selector syntax for connection id
Post by: TimHale on April 26, 2019, 13:04:11 PM
given a variable containing the id of a known connection (e.g. myId = "a8e97ef2-655a-4edd-9f35-60b3519c280e")

I can't find the selector syntax that enables me to select that connection.

$(myId) doesn't work

prepending the id with a "#" doesn't seem to work either
$(#a8e97ef2-655a-4edd-9f35-60b3519c280e)

is it a variant of the select.filter statement?

thanks.
Title: Re: jarchi: selector syntax for connection id
Post by: Jean-Baptiste Sarrodie on April 26, 2019, 13:08:17 PM
Hi,

You have to use $("#a8e97ef2-655a-4edd-9f35-60b3519c280e") (with the quotes)..

Regards,

JB
Title: Re: jarchi: selector syntax for connection id
Post by: Phil Beauvoir on April 26, 2019, 13:11:35 PM
I'm not sure if this works for connections?
Title: Re: jarchi: selector syntax for connection id
Post by: TimHale on April 26, 2019, 13:18:26 PM
When I try it with the quotes

myId = $("#a8e97ef2-655a-4edd-9f35-60b3519c280e");

it doesn't appear to be returning anything.
This is the ID for a connection on  a view.

I can accomplish my goal in other ways, but this would be the lowest overhead route.
Am I missing something?
Title: Re: jarchi: selector syntax for connection id
Post by: Phil Beauvoir on April 26, 2019, 13:21:49 PM
J-B, the "*" selector filter doesn't include connections or nodes for the whole model.

return (object instanceof IArchimateConcept || object instanceof IDiagramModel
                            || object instanceof IFolder);

It will work on the selection:

r = selection.filter("#a8e97ef2-655a-4edd-9f35-60b3519c280e");

See https://github.com/archimatetool/archi-scripting-plugin/issues/25
Title: Re: jarchi: selector syntax for connection id
Post by: Jean-Baptiste Sarrodie on April 26, 2019, 18:49:11 PM
Hi,

@Phil: Thank you for pointing out this GH issue. I will comment on it in detail soon.

In short: if $("#id_of_a_visual_object") doesn't work, I consider this as a bug that we have to solve in the future.

Regards,

JB