You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working with the SysML v2 Pilot, I encountered an issue when setting the direction of a Usage element in a model.
Although the command setting the direction property executes successfully inside TransactionalCommandStack#doExecute(), an exception is thrown after the command completes—during the EMF transaction commit phase. Specifically, during the consolidation of recorded model changes, EMF internally attempts to resolve feature values via createFromString(...).
The generated factory method createFeatureDirectionKindFromString(...) is invoked with a null value for initialValue, which results in an unhandled exception:
Since initialValue == null, FeatureDirectionKind.get(null) returns null, which then triggers the IllegalArgumentException.
Root Cause:
During transaction commit, EMF uses ChangeRecorder to analyze and consolidate changes. As part of this, it tries to resolve feature values via EFactory.createFromString(...). When it encounters a null string for an enum value (FeatureDirectionKind in this case), the generated method fails due to missing null-check logic.
This situation is common in EMF when model attributes are optional or unset.
Is it possible to add a NONE enum for FeatureDirectionKind? So do PortionKind~
Environment:
JDK version: [17.0.1]
SysML version: [0.48.0]
Let me know if there is a workaround or if this can be addressed in a future update. Thank you for your support!