-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
method .is("*") returns different results for visual objects an concept #122
Comments
Not sure about this. The relevant part of the code is this: Lines 43 to 52 in 6d4be55
This means that If the object is a diagram object (visual object) then it returns false, and true if a concept (in the model tree) @jbsarrodie WDYT? |
But why different behavior for the "*" selector? The test with an application-component selected on a view gives: |
Because the I'm not sure whether this should be changed or not. |
This is the intended behavior: The intended behavior for "" selector is to return only ArchiMate concepts and "primary" containers (folders and view). The reason for that is that we want some selector to return actionable content and not thousands of visual objects (they can be accessed by other means). That's what "" is for. So a collection containing only visual objects won't match the "*" selector, and in this case In fact, the real question should be why "application-component" (or "element", or any specific selector) works on visual objects. The reason for this is that as soon as you've selected some visual objects (related to ArchiMate concepts), in almost all cases, you'll want to check the type of the underlying concept and not the visual object itself (and same is true for properties), so we've made it easier for people, and in this case jArchi checks against |
Thanks for the clear explanation. This also helps in understanding the reasoning behind why visual objects do have properties. And true, it does give shorter code. Having said that, I don't think I agree with this choice, and I don't think it makes it easier for people. For me, this is confusing. I have made many mistakes in using Now I know how to solve the error in my script. I will use the condition |
How do you think it could be implemented differently? |
I would prefer that the API is explicit about whether you are working with a visual object or an object.
And for the .is() method.
For me this is more consistent and less prone to errors. |
Version of jArchi, Operating System
Expected Behaviour
A test with .is("*") should return the same result for both visual objects as for concepts.
So far, I've seen this behavior only with the selector "*".
This didn't happen in a previous release. Don't know the jArchi version that introduced this error
Actual Behaviour
The test with a visual object returns false.
The test with the same object selected in the model tree returns true
Steps to Reproduce the Behaviour (with attached test files/script)
The text was updated successfully, but these errors were encountered: