I get this error Method-based property InspectionCase.getCurrentOwners doesn't support collections and maps
How to write a computed attribute which return a Collection or Map of Entity ?
The logic could be complex so I don’t want to write it more than once… but I want to use this attribute in some screens and reports
Hi,
thank you for the solution you presented. It is useful when dealing with constants.
In our case the values can be modified in numerous places in the code. Which means we need to udate the value every time. I had the idea to take advantage of kotlin’s capability to define property getter.
I tried this. It seams to work well.
@DependsOnProperties("stakeholders")
@JmixProperty
@Transient
var currentOwners: List<InspectionCaseStakeholder> =
emptyList() // this list is never used, the getter re-compute the value each time
get() = getCurrentStakeholders(InspectionStakeholderType.OWNER)