Source:
private void updateRelations(Sender sender, Collection<EventBasicGuidRelation> relations) { for (EventBasicGuidRelation guidArt : relations) { try { EventUtil.eventLog(String.format("REM: updateRelation -> [%s]", guidArt)); RelationType relationType = RelationTypeManager.getTypeByGuid(guidArt.getRelTypeGuid()); Artifact aArtifact = ArtifactCache.getActive(guidArt.getArtA()); Artifact bArtifact = ArtifactCache.getActive(guidArt.getArtB()); if (aArtifact == null && bArtifact == null) { continue; } boolean aArtifactLoaded = aArtifact != null; boolean bArtifactLoaded = bArtifact != null; if (aArtifactLoaded || bArtifactLoaded) { Branch branch = BranchManager.getBranch(guidArt.getArtA()); RelationLink relation = RelationManager.getLoadedRelationById(guidArt.getRelationId(), guidArt.getArtAId(), guidArt.getArtBId(), branch); RelationEventType eventType = guidArt.getModType(); switch (eventType) { case Added: if (relation == null || relation.getModificationType() == ModificationType.DELETED || relation.getModificationType() == ModificationType.ARTIFACT_DELETED) { relation = RelationManager.getOrCreate(guidArt.getArtAId(), guidArt.getArtBId(), branch, relationType, guidArt.getRelationId(), guidArt.getGammaId(), guidArt.getRationale(), ModificationType.NEW); } break; case ModifiedRationale: if (relation != null) { relation.internalSetRationale(guidArt.getRationale()); relation.setNotDirty(); } break; case Deleted: case Purged: if (relation != null) { relation.internalRemoteEventDelete(); } break; case Undeleted: if (relation != null) { relation.undelete(); relation.setNotDirty(); } break; default: EventUtil.eventLog(String.format("REM: updateRelations - Unhandled mod type [%s]", eventType)); break; } } } catch (OseeCoreException ex) { EventUtil.eventLog("REM: updateRelations", ex); } } }

Target:
private void updateRelations(Sender sender, Collection<EventBasicGuidRelation> relations) { for (EventBasicGuidRelation guidArt : relations) { try { EventUtil.eventLog(String.format("REM: updateRelation -> [%s]", guidArt)); RelationType relationType = RelationTypeManager.getTypeByGuid(guidArt.getRelTypeGuid()); Artifact aArtifact = ArtifactCache.getActive(guidArt.getArtA()); Artifact bArtifact = ArtifactCache.getActive(guidArt.getArtB()); if (aArtifact == null && bArtifact == null) { continue; } boolean aArtifactLoaded = aArtifact != null; boolean bArtifactLoaded = bArtifact != null; if (aArtifactLoaded || bArtifactLoaded) { IOseeBranch branch = TokenFactory.createBranch(guidArt.getArtA().getBranchUuid(), "ArtifactRemoteEventHandler - Branch"); RelationLink relation = RelationManager.getLoadedRelationById(guidArt.getRelationId(), guidArt.getArtAId(), guidArt.getArtBId(), branch); RelationEventType eventType = guidArt.getModType(); switch (eventType) { case Added: if (relation == null || relation.getModificationType() == ModificationType.DELETED || relation.getModificationType() == ModificationType.ARTIFACT_DELETED) { relation = RelationManager.getOrCreate(guidArt.getArtAId(), guidArt.getArtBId(), branch, relationType, guidArt.getRelationId(), guidArt.getGammaId(), guidArt.getRationale(), ModificationType.NEW); } break; case ModifiedRationale: if (relation != null) { relation.internalSetRationale(guidArt.getRationale()); relation.setNotDirty(); } break; case Deleted: case Purged: if (relation != null) { relation.internalRemoteEventDelete(); } break; case Undeleted: if (relation != null) { relation.undelete(); relation.setNotDirty(); } break; default: EventUtil.eventLog(String.format("REM: updateRelations - Unhandled mod type [%s]", eventType)); break; } } } catch (OseeCoreException ex) { EventUtil.eventLog("REM: updateRelations", ex); } } }