Archi Forum

Archi => General Archi Discussion => Topic started by: jogga on October 10, 2023, 10:17:48 AM

Title: Label expression evaluated against the model (and not the view)
Post by: jogga on October 10, 2023, 10:17:48 AM
My question in general is how to calculate a label based upon data in the repository (and not the view) and more specific how to label a flow relation with the business/data objects associated with the flow relation.

Background
In the Archimate reference for relationship flow, there is an example of labeling the relationship with "what" is flowing. https://pubs.opengroup.org/architecture/archimate32-doc.singlepage/#_Toc112154926 (Example 13).

From a modelling perspective I interpret the labeling as the same thing as connecting a business or data object(s) to a flow with an association to the flow relationship. https://pubs.opengroup.org/architecture/archimate32-doc.singlepage/#_Toc112154922 (Example 10)-
That way I got a nice repository where I can query for "all exchange of orders between processes" and "integrations of employee data between applications".

But the labeling version is so much more compact and easier to understand. Minimizing arrows and squares when talking to outsiders are always a goal. So how do you I get the compact notation, but still keep a correct Archimate repoistory in Archi?

Used Sparx EA before and by stretching the tool (and standard) I can accomplish this by connecting a business/data object to the labeling. I still need to model the association from the object to the flow relationship.

Now, I would like to accomplish this in my favorite tool Archi  ;) . Going for label expressions and succeed with
$association:source{name}But not being a frequent user of label expressions, I didn't realize that the expression was executed within the scope of the view and not the scope of the model. So when removing the the business object from the view, the label becomes empty  :( .

So back to my initial question. Anyone with an idea? Can I somehow address the model to find the association?
Title: Re: Label expression evaluated against the model (and not the view)
Post by: Phil Beauvoir on October 10, 2023, 10:28:51 AM
Hi, as you say, label expressions resolve to diagram objects and connections not model objects. So $association:source{name} will follow the path of the first Association connection of the given object to the source object of the connection on the view. This has been a design decision from the start in order to support visual contexts.

Perhaps we might consider something like "msource" and "mtarget" as extra expressions for model source and model target. See https://github.com/archimatetool/archi/issues/713#issuecomment-800313058
Title: Re: Label expression evaluated against the model (and not the view)
Post by: Phil Beauvoir on October 10, 2023, 10:52:37 AM
See https://github.com/archimatetool/archi/issues/972
Title: Re: Label expression evaluated against the model (and not the view)
Post by: jogga on October 10, 2023, 13:11:22 PM
Yup, that would do the trick. Good to know I'm alone with my odd requirements. Many thanks!
Title: Re: Label expression evaluated against the model (and not the view)
Post by: Alexis_H on January 02, 2024, 09:04:07 AM
Hi,
I can confirm your not alone with such requiresments ;) I had the same need to show as a label-expression the data-object associated to a given relationship.. but was stuck with this issue where label expressions were working only with view-context objects.

Nice to see this feature change in 5.2 !
Thanks @Phil Beauvoir