updating the value of property from editor

Let us assume a concept MovieTheatre consisting of

                           1.  property isHouseFul : boolean 

                          2.   child people : Person[0..n]

 

The editor of the MovieTheatre concept needs to be updated with a string "houseful" as soon as the 10th Person (child) is added. The property isHouseFul needs to be updated with the value "true" based on the logic present in the behavior method.

Is it good to update the user model from the editor aspect ?  

How do we safely write to a model from the editor aspect?

3 comments
Comment actions Permalink

In order to write safely, you can import jetbrains.mps.lang.access language to your editor and use ExecuteWriteActionStatement (write action).



0
Comment actions Permalink

Thank you @Nandha. Let me try this

0
Comment actions Permalink

Create a constraints aspect for your concept and define a getter for property isHouseFull there, which will compute its value based on the number of people.

2

Please sign in to leave a comment.