jarchi: selector syntax for connection id

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

Previous topic - Next topic

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!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Phil Beauvoir

#2
I'm not sure if this works for connections?
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

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

#4
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!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

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!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.