diff --git a/build.gradle b/build.gradle index e6e7b8a5f..84006cd4a 100644 --- a/build.gradle +++ b/build.gradle @@ -131,7 +131,7 @@ dependencies { // Other dependencies we're unable to resolve via standard repositories if (buildAccess == 'internal') { - preCompile group: 'gov.nasa.jpl.cae.magicdraw', name: 'cae-magicdraw-core', version: '3.3.5', ext: 'zip' + preCompile group: 'gov.nasa.jpl.cae.magicdraw', name: 'cae-magicdraw-core', version: '3.3.6', ext: 'zip' } else { preCompile group: 'com.nomagic', name: 'magicdraw', version: '185sp3', classifier: 'MagicDraw_185_sp3_no_install', ext: 'zip' diff --git a/gradle.properties b/gradle.properties index 12c4706eb..be9b962fb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=3.3.5 +version=3.3.6 group=org.openmbee.magicdraw.mdk descriptorFile=MDR_Plugin_Model_Development_Kit_91110_descriptor.xml magicdDrawGroupName=gov.nasa.jpl.cae.magicdraw.mdk diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/UpdateClientElementAction.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/UpdateClientElementAction.java index 20a02b784..90560385a 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/UpdateClientElementAction.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/actions/UpdateClientElementAction.java @@ -60,15 +60,15 @@ public class UpdateClientElementAction extends RuleViolationAction implements An private ValidationRule editableValidationRule = new ValidationRule("Element Editability", "The element to be updated shall be editable.", ViolationSeverity.WARNING), failedChangeValidationRule = new ValidationRule("Failed Change", "The element shall not fail to change.", ViolationSeverity.ERROR), equivalentElementValidationRule = new ValidationRule("Element Equivalency", "The changed element shall be equivalent to the source element.", ViolationSeverity.WARNING), - successfulChangeValidationRule = new ValidationRule("Successful Change", "The element shall successfully change.", ViolationSeverity.INFO), - deletionOnSuccessValidationRule = new ValidationRule("Deletion on Success", "The element to be deleted shall only be deleted if all elements to be created/updated are successfully imported.", ViolationSeverity.WARNING); + successfulChangeValidationRule = new ValidationRule("Successful Change", "The element shall successfully change.", ViolationSeverity.INFO); + //deletionOnSuccessValidationRule = new ValidationRule("Deletion on Success", "The element to be deleted shall only be deleted if all elements to be created/updated are successfully imported.", ViolationSeverity.WARNING); { validationSuite.addValidationRule(editableValidationRule); validationSuite.addValidationRule(failedChangeValidationRule); validationSuite.addValidationRule(equivalentElementValidationRule); validationSuite.addValidationRule(successfulChangeValidationRule); - validationSuite.addValidationRule(deletionOnSuccessValidationRule); + //validationSuite.addValidationRule(deletionOnSuccessValidationRule); } private Collection elementsToUpdate; diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/DeltaSyncRunner.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/DeltaSyncRunner.java index 18d03ffe3..a61bffdea 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/DeltaSyncRunner.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/DeltaSyncRunner.java @@ -10,7 +10,6 @@ import com.nomagic.magicdraw.core.ProjectUtilities; import com.nomagic.magicdraw.esi.EsiUtils; import com.nomagic.magicdraw.openapi.uml.SessionManager; -import com.nomagic.magicdraw.teamwork2.locks.ILockProjectService; import com.nomagic.task.ProgressStatus; import com.nomagic.task.RunnableWithProgress; import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element; @@ -104,22 +103,7 @@ public void run(ProgressStatus progressStatus) { // UPDATE LOCKS - ILockProjectService lockService = EsiUtils.getLockService(project); - if (lockService == null) { - Application.getInstance().getGUILog().log("[ERROR] Teamwork Cloud lock service is unavailable. Skipping sync. All changes will be re-attempted in the next sync."); - return; - } - listener.setDisabled(true); - try { - lockService.updateLocks(progressStatus); - } catch (RuntimeException e) { - Application.getInstance().getGUILog().log("[ERROR] Failed to update locks from Teamwork Cloud. Skipping sync. All changes will be persisted in the model and re-attempted in the next sync. Reason: " + e.getMessage()); - e.printStackTrace(); - return; - } finally { - listener.setDisabled(false); - } // UPDATE MMS CHANGELOG @@ -279,13 +263,6 @@ else if (shouldUpdate && mmsChange != null) { Application.getInstance().getGUILog().log("[INFO] Attempted to update element " + id + " locally, but it does not exist. Skipping."); continue; } - if (!element.isEditable() && lockService.isLocked(element) && !lockService.isLockedByMe(element)) { - if (MDUtils.isDeveloperMode()) { - Application.getInstance().getGUILog().log("[INFO] Attempted to update element " + id + " locally, but it is locked by someone else. Skipping."); - } - failedMmsChangelog.addChange(id, null, Changelog.ChangeType.UPDATED); - continue; - } mmsElementsToUpdateLocally.put(id, new Pair<>(objectNode, element)); break; case DELETED: @@ -293,13 +270,6 @@ else if (shouldUpdate && mmsChange != null) { Application.getInstance().getGUILog().log("[INFO] Attempted to delete element " + id + " locally, but it doesn't exist. Skipping."); continue; } - if (!element.isEditable() && lockService.isLocked(element) && !lockService.isLockedByMe(element)) { - if (MDUtils.isDeveloperMode()) { - Application.getInstance().getGUILog().log("[INFO] Attempted to delete element " + id + " locally, but it is locked by someone else. Skipping."); - } - failedMmsChangelog.addChange(id, null, Changelog.ChangeType.DELETED); - continue; - } mmsElementsToDeleteLocally.put(id, element); break; } diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/SyncElements.java b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/SyncElements.java index 1c927d93b..9430a9aee 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/SyncElements.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/mms/sync/delta/SyncElements.java @@ -8,9 +8,6 @@ import com.nomagic.magicdraw.commands.MacroCommand; import com.nomagic.magicdraw.commands.RemoveCommandCreator; import com.nomagic.magicdraw.core.Project; -import com.nomagic.magicdraw.core.ProjectUtilities; -import com.nomagic.magicdraw.esi.EsiUtils; -import com.nomagic.magicdraw.teamwork2.locks.ILockProjectService; import com.nomagic.uml2.ext.jmi.helpers.ModelHelper; import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element; import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.InstanceSpecification; @@ -20,15 +17,12 @@ import gov.nasa.jpl.mbee.mdk.api.incubating.convert.Converters; import gov.nasa.jpl.mbee.mdk.json.JacksonUtils; import gov.nasa.jpl.mbee.mdk.util.Changelog; -import gov.nasa.jpl.mbee.mdk.util.MDUtils; import java.io.IOException; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.stream.Collectors; /** @@ -160,30 +154,4 @@ public static Changelog buildChangelog(Changelog changelog, Object } return changelog; } - - public static List lockSyncFolder(Project project) { - if (!ProjectUtilities.isFromEsiServer(project.getPrimaryProject())) { - return Collections.emptyList(); - } - String folderId = Converters.getIProjectToIdConverter().apply(project.getPrimaryProject()) + MDKConstants.SYNC_SYSML_ID_SUFFIX; - Element folder = Converters.getIdToElementConverter().apply(folderId, project); - if (folder == null) { - return Collections.emptyList(); - } - ILockProjectService lockService = EsiUtils.getLockService(project); - if (lockService == null) { - return Collections.emptyList(); - } - Collection ownedElements = folder.getOwnedElement(); - List lockedElements = new ArrayList<>(ownedElements.size()); - for (Element element : folder.getOwnedElement()) { - if (element instanceof com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class && !lockService.isLocked(element) && lockService.canBeLocked(element)) { - lockedElements.add(element); - } - } - if (!lockService.lockElements(lockedElements, false, null)) { - return Collections.emptyList(); - } - return lockedElements; - } }