Modify a model programmatically
Say you want to do:
myModel.setParameter(42);
Then you should actually write:
ITopLevelElement modelContext = IPersistencyService.getInstance().getTopLevelElementFor(modelElement);
modelContext.runAsCommand(() ->
myModel.setParameter(42)
));