Skip to content
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

Label Expressions - add msource and mtarget expressions #972

Closed
Phillipus opened this issue Oct 10, 2023 · 6 comments
Closed

Label Expressions - add msource and mtarget expressions #972

Phillipus opened this issue Oct 10, 2023 · 6 comments

Comments

@Phillipus
Copy link
Member

There seems to be a need from some users to access source and target of relations at the model level rather than the visual connection level. See

https://forum.archimatetool.com/index.php?topic=1432.0
#970
#713

Perhaps we could add msource and mtarget expressions to get the model objects? I have actually written the code to do this sometime ago.

@jbsarrodie WDYT?

@jbsarrodie
Copy link
Member

I've had a need for this some time ago, so it's worth having a look at it.

Perhaps we could add msource and mtarget expressions to get the model objects?

I wonder if we actually need dedicated expressions for that or if the existing source and target could be extended: when getting the list of relationships matching the criteria, we could make sure we have those shown on the view first, and those coming from the model after. As we pick the first one to render expression, this doesn't change anything for currently supported use-case.

BTW, I have a small list of enhancements to label expressions, maybe I could do it for the upcoming version of Archi.

@Phillipus
Copy link
Member Author

Phillipus commented Oct 10, 2023

I wonder if we actually need dedicated expressions for that or if the existing source and target could be extended: when getting the list of relationships matching the criteria, we could make sure we have those shown on the view first, and those coming from the model after. As we pick the first one to render expression, this doesn't change anything for currently supported use-case.

Good idea.

But why check for view connections first, why not just use model relationship in all cases? If the view connection exists then it will be the same as the model relationship. If not, it will also be the model relationship.

@Phillipus
Copy link
Member Author

Phillipus commented Oct 10, 2023

But why check for view connections first, why not just use model relationship in all cases? If the view connection exists then it will be the same as the model relationship. If not, it will also be the model relationship.

Ignore that. There may be several relations/connection to/from the object and some may be on the view and some may not.

@Phillipus
Copy link
Member Author

Phillipus commented Oct 10, 2023

I've implemented this in branch label-expressions now. Will use the model relationship if there are no diagram connections.

Given the label expression $serving:source{name}

  1. If there is one or more Serving diagram connections leading to the object it will reference the first one found.
  2. If there are no Serving diagram connections leading to the object it will reference the first model relationship found.

@Phillipus
Copy link
Member Author

This is in Archi 5.2.

@romualdrichard
Copy link

Hi,

Sorry about that, I tried this and I certainly messed somewhere.
With $association:source{name} I have "Feuille de temps" on the flow relation even if the Data Object is not in the view
With $serving:source{name} I have nothing
Capture d’écran 2024-01-04 160752

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants