Source:
public TransactionId execute() throws OseeCoreException { Conditions.checkNotNull(comment, "comment"); if (isEmpty() && execptionIfEmpty) { throw new OseeArgumentException("objects/deleteObjects cannot be empty"); } TransactionId transactionRecord = null; SkynetTransaction transaction = TransactionManager.createTransaction(AtsClientService.get().getAtsBranch(), comment); try { for (IAtsObject atsObject : new ArrayList<>(atsObjects)) { if (atsObject instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) atsObject; if (workItem.getStateMgr().isDirty()) { AtsClientService.get().getStateFactory().writeToStore(asUser, workItem, this); } if (workItem.getLog().isDirty()) { AtsClientService.get().getLogFactory().writeToStore(workItem, AtsClientService.get().getAttributeResolver(), this); } } transaction.addArtifact(AtsClientService.get().getArtifact(atsObject)); } for (ArtifactId artifact : artifacts) { if (artifact instanceof Artifact) { transaction.addArtifact((Artifact) artifact); } } for (AtsRelationChange rel : relations) { execute(rel, transaction); } for (ArtifactId artifact : deleteArtifacts) { if (artifact instanceof Artifact) { ((Artifact) artifact).deleteAndPersist(transaction); } } for (IAtsObject atsObject : deleteAtsObjects) { AtsClientService.get().getArtifact(atsObject).deleteAndPersist(transaction); } transactionRecord = transaction.execute(); } catch (Exception ex) { transaction.cancel(); throw new OseeWrappedException(ex, "Error executing AtsChangeSet [%s]", getComment()); } for (IExecuteListener listener : listeners) { listener.changesStored(this); } AtsClientService.get().sendNotifications(getNotifications()); return transactionRecord; }

Target:
public TransactionId execute() throws OseeCoreException { Conditions.checkNotNull(comment, "comment"); if (isEmpty() && execptionIfEmpty) { throw new OseeArgumentException("objects/deleteObjects cannot be empty"); } TransactionId transactionRecord; SkynetTransaction transaction = TransactionManager.createTransaction(AtsClientService.get().getAtsBranch(), comment); try { for (IAtsObject atsObject : new ArrayList<>(atsObjects)) { if (atsObject instanceof IAtsWorkItem) { IAtsWorkItem workItem = (IAtsWorkItem) atsObject; if (workItem.getStateMgr().isDirty()) { AtsClientService.get().getStateFactory().writeToStore(asUser, workItem, this); } if (workItem.getLog().isDirty()) { AtsClientService.get().getLogFactory().writeToStore(workItem, AtsClientService.get().getAttributeResolver(), this); } } transaction.addArtifact(AtsClientService.get().getArtifact(atsObject)); } for (ArtifactId artifact : artifacts) { if (artifact instanceof Artifact) { transaction.addArtifact((Artifact) artifact); } } for (AtsRelationChange rel : relations) { execute(rel, transaction); } for (ArtifactId artifact : deleteArtifacts) { if (artifact instanceof Artifact) { ((Artifact) artifact).deleteAndPersist(transaction); } } for (IAtsObject atsObject : deleteAtsObjects) { AtsClientService.get().getArtifact(atsObject).deleteAndPersist(transaction); } transactionRecord = transaction.execute(); } catch (Exception ex) { transaction.cancel(); throw OseeCoreException.wrap(ex); } for (IExecuteListener listener : listeners) { listener.changesStored(this); } AtsClientService.get().sendNotifications(getNotifications()); return transactionRecord; }