3636import org .eclipse .emf .ecore .EStructuralFeature ;
3737import org .omg .sysml .lang .sysml .Element ;
3838import org .omg .sysml .lang .sysml .util .SysMLLibraryUtil ;
39- import org .omg .sysml .model .ElementIdentity ;
40- import org .omg .sysml .model .ElementVersion ;
39+ import org .omg .sysml .model .DataIdentity ;
40+ import org .omg .sysml .model .DataVersion ;
4141import org .omg .sysml .model .Identified ;
4242import org .omg .sysml .util .traversal .Traversal ;
4343import org .omg .sysml .util .traversal .facade .ElementProcessingFacade ;
4848
4949/**
5050 * This is an element-processing facade that uses the SysML v2 REST API client to export Elements to JSON.
51- * A list of ElementVersions is constructed during traversal of the model. Once the traversal is
51+ * A list of DataVersions is constructed during traversal of the model. Once the traversal is
5252 * completed, this change set can be exported to JSON.
5353 *
5454 * @author Ed Seidewitz
@@ -67,7 +67,7 @@ public class JsonElementProcessingFacade implements ElementProcessingFacade {
6767 protected int elementCount = 0 ;
6868 protected int dotCount = 0 ;
6969
70- private final List <ElementVersion > versions = new ArrayList <>();
70+ private final List <DataVersion > versions = new ArrayList <>();
7171 private final Gson gson = new GsonBuilder ().setPrettyPrinting ().create ();
7272
7373 /**
@@ -125,21 +125,21 @@ public boolean isIncludeDerived() {
125125 }
126126
127127 /**
128- * Return the collection of ElementVersions that have been created from
128+ * Return the collection of DataVersions that have been created from
129129 * processed model Elements.
130130 *
131- * @return the collection of ElementVersions that have been created
131+ * @return the collection of DataVersions that have been created
132132 */
133- List <ElementVersion > getVersions () {
133+ List <DataVersion > getVersions () {
134134 return Collections .unmodifiableList (this .versions );
135135 }
136136
137137 /**
138- * Add an ElementVersion to the collection.
138+ * Add a DataVersion to the collection.
139139 *
140- * @param elementVersion the ElementVersion to be added to the collection
140+ * @param elementVersion the DataVersion to be added to the collection
141141 */
142- protected void addVersion (ElementVersion elementVersion ) {
142+ protected void addVersion (DataVersion elementVersion ) {
143143 this .versions .add (elementVersion );
144144 }
145145
@@ -178,17 +178,17 @@ protected List<Identified> getIdentified(List<Element> elements) {
178178 }
179179
180180 /**
181- * Create an ElementVersion for the given model Element including the values of all its non-derived
181+ * Create a DataVersion for the given model Element including the values of all its non-derived
182182 * attributes (unless it is a library model element, in which case only its non-referential attribute values
183- * are included). If isIncludeDerived is true, also include derived attributes. The ID for the ElementVersion
183+ * are included). If isIncludeDerived is true, also include derived attributes. The ID for the DataVersion
184184 * uses the identifier from the model Element.
185185 *
186186 * @param element the source model Element as it is represented in Ecore
187- * @return an ElementVersion with the API representation of the given Element as its data
187+ * @return a DataVersion with the API representation of the given Element as its data
188188 */
189189 @ SuppressWarnings ("unchecked" )
190- protected org .omg .sysml .model .ElementVersion createElementVersion (Element element ) {
191- org .omg .sysml .model .Element apiElement = new org .omg .sysml .model .Element ();
190+ protected org .omg .sysml .model .DataVersion createElementVersion (Element element ) {
191+ org .omg .sysml .model .Data apiElement = new org .omg .sysml .model .Data ();
192192 EClass eClass = element .eClass ();
193193 apiElement .put ("@type" , eClass .getName ());
194194 boolean isLibraryElement = SysMLLibraryUtil .isModelLibrary (element .eResource ());
@@ -206,8 +206,8 @@ protected org.omg.sysml.model.ElementVersion createElementVersion(Element elemen
206206 apiElement .put (name , value );
207207 }
208208 }
209- return new ElementVersion ().data (apiElement ).
210- identity (new ElementIdentity ().atId (UUID .fromString (element .getIdentifier ())));
209+ return new DataVersion ().payload (apiElement ).
210+ identity (new DataIdentity ().atId (UUID .fromString (element .getIdentifier ())));
211211 }
212212
213213 /**
@@ -256,7 +256,7 @@ public Object process(Element element) {
256256 }
257257
258258 /**
259- * Post-process the given Element by creating an ElementVersion for it and adding that
259+ * Post-process the given Element by creating a DataVersion for it and adding that
260260 * to the change set being constructed. This is done as a post-processing step so that
261261 * derived references to library model Elements not included in the change set can be
262262 * excluded.
0 commit comments