Derived settable associations
No edit summary
No edit summary
Line 7: Line 7:
  self.Class2 := vInputParameter;
  self.Class2 := vInputParameter;
  self.SelectionLog := self.SelectionLog + DateTime.Now.asString + ': '+ vInputParameter.Name + '\r\n'
  self.SelectionLog := self.SelectionLog + DateTime.Now.asString + ': '+ vInputParameter.Name + '\r\n'
The most common use case for this is to execute "extra" code for recalculating other persisted values based on the new value of a change to a link.
Here is the sample model to be loaded into the designer: [[:File:DerivedSettableExample.modlr]]
Here is the sample model to be loaded into the designer: [[:File:DerivedSettableExample.modlr]]

Revision as of 09:46, 18 February 2021

Derived attributes & associations are read-only, but you can also have writable associations that update other attributes or links when they are themselves set. Read here Derived settable attributes about how that works on attributes.

Derived settable class example.png

OCL for reading Class2selection

self.Class2

EAL for the writing Class2Selection

self.Class2 := vInputParameter;
self.SelectionLog := self.SelectionLog + DateTime.Now.asString + ': '+ vInputParameter.Name + '\r\n'

The most common use case for this is to execute "extra" code for recalculating other persisted values based on the new value of a change to a link.

Here is the sample model to be loaded into the designer: File:DerivedSettableExample.modlr

This page was edited 84 days ago on 02/10/2024. What links here