Skip to content

Commit 67e7173

Browse files
committed
ST6RI-178 Revised load(RemoteBranch) to not use the "next" method.
- The "next" method should only be used to create a resource for a model entered in a Jupyter notebook cell.
1 parent c602522 commit 67e7173

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

org.omg.sysml.interactive/src/org/omg/sysml/interactive/SysMLInteractive.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ protected String publish(String name) {
467467
* @return output of the command
468468
*/
469469
public String load(Map<String, String> parameters) {
470-
this.counter++;
470+
counter++;
471+
471472
if (parameters.containsKey(HELP_KEY)) {
472473
return SysMLInteractiveHelp.getLoadHelp();
473474
}
@@ -541,16 +542,16 @@ private String load(RemoteBranch branch) {
541542
modelRefresher.getIssues().forEach(System.out::println);
542543

543544
delta.getProjectRoots().forEach((eObject, dto) -> {
544-
next(SYSMLX_EXTENSION);
545-
Resource xmiResource = getResource();
545+
Resource resource = this.createResource(eObject.toString() + SYSML_EXTENSION);
546+
this.addInputResource(resource);
546547
if (eObject instanceof Namespace) {
547-
xmiResource.getContents().add(eObject);
548+
resource.getContents().add(eObject);
548549
} else {
549550
Namespace root = SysMLFactory.eINSTANCE.createNamespace();
550551
NamespaceUtil.addOwnedMemberTo(root, (Element) eObject);
551-
xmiResource.getContents().add(root);
552+
resource.getContents().add(root);
552553
}
553-
addResourceToIndex(xmiResource);
554+
addResourceToIndex(resource);
554555
});
555556

556557
return "Loaded Project " + remoteProject.getProjectName() + " (" + remoteProject.getRemoteId().toString() + ")\n";

0 commit comments

Comments
 (0)