title: EMF/GMF/Papyrus - Set excplicit an ElementImpl - Property out of code
body: <p>I have an EMF-model and the generated editor. In the model/editor, it is possible to connect Element "Unit"(U) with "Specification"(S). Now, I want to have a specialized CSS-style for S if at least one U satisfies S. But (to the best of my knowledge) there is no way to accomplish this (with Selectors, for example) in a CSS-Stylesheet for Papyrus.</p>
  
  <p>For this reason, I added an additional Property for S, called "Mapped" (should be true, when at least one U satisfies S, otherwise it is false). Then, I tried to set the "Mapped"-Property out of code, when one / more connections were added (in the handleNotification - Method):</p>
  
  <pre><code>notifier.setMapped(true);
  </code></pre>
  
  <p>with excception:</p>
  
  <pre><code>IllegalstateException: Cannot modify resource set without a write transaction
  </code></pre>
  
  <p>The second solution resulted in another Exception, but with the same semantical result:</p>
  
  <pre><code>ed.getCommandStack().execute(SetCommand.create(ed, notifier,
      xyzPackage.Literals.SPECIFICATION__MAPPED, true));
  </code></pre>
  
  <p>with exception:</p>
  
  <pre><code>java.lang.IllegalStateException: Cannot activate read/write 
      transaction in read-only transaction context
  </code></pre>
  
  <p>Does anyone know how to handle these Exceptions or have a good workaround? The main aim is that the CSS-File recognizes the change of the "Mapped"-Property.</p>
  
  <p>Thanks a lot :)</p>