archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
946 stars 269 forks source link

Conditional formulas in label expressions #728

Closed startsevsa closed 3 years ago

startsevsa commented 3 years ago

This will be a got addition to label expression language to have an ability for using IF and CASE analogs (like in Excel & etc).

Example of using: you have a property, which can bet set or not (is optional) And when using an element with this option in a view, you want to show in in brackets, but when the value of property is empty, you want to hide the empty value itself and the brackets too. image

With conditional formula this can be done, for example smth. like this: ${if(${property:optional property}='';'';'('+${property:optional property}+')')}

Phillipus commented 3 years ago

We want to avoid over-complicating label expressions as they can slow things down when rendering. I think this is out of scope. Currently we use regex to parse the label expression, but parsing conditional expressions is not trivial. To be clear - I am not going to implement this.

Phillipus commented 3 years ago

I'm going to close this one because it just ain't gonna happen.