jarchi: selector syntax for connection id

Started by TimHale, April 26, 2019, 13:04:11 PM

Previous topic - Next topic

TimHale

April 26, 2019, 13:04:11 PM Last Edit: April 26, 2019, 13:05:43 PM by TimHale
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.

Jean-Baptiste Sarrodie

Hi,

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

Regards,

JB
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Phil Beauvoir

April 26, 2019, 13:11:35 PM #2 Last Edit: April 26, 2019, 13:17:54 PM by Phil Beauvoir
I'm not sure if this works for connections?
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

TimHale

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?

Phil Beauvoir

April 26, 2019, 13:21:49 PM #4 Last Edit: April 26, 2019, 13:25:30 PM by Phil Beauvoir
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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Jean-Baptiste Sarrodie

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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate