From f8a42d130f0b5eb7bb974bec08ed763cc01f7723 Mon Sep 17 00:00:00 2001 From: Jochen Date: Fri, 2 Nov 2018 15:17:00 +0100 Subject: [PATCH 1/2] ConDec-375: Improve Event listener --- .../management/jira/extraction/DecXtractEventListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java b/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java index 7e909bfc4f..708f8903c2 100644 --- a/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java +++ b/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java @@ -84,6 +84,7 @@ private void handleDeleteIssue() { private void handleEditComment() { ActiveObjectsManager.checkIfCommentBodyHasChangedOutsideOfPlugin(new CommentImpl(issueEvent.getComment())); + new ViewConnector(this.issueEvent.getIssue(), false); } private void handleDeleteComment() { From 7f8a701d74b23be4c291ed9a6443b232e8455713 Mon Sep 17 00:00:00 2001 From: Jochen Date: Fri, 2 Nov 2018 22:07:39 +0100 Subject: [PATCH 2/2] ConDec-375: Fix Event Listener Issue --- .../extraction/DecXtractEventListener.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java b/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java index 708f8903c2..928cbf0958 100644 --- a/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java +++ b/src/main/java/de/uhd/ifi/se/decision/management/jira/extraction/DecXtractEventListener.java @@ -14,7 +14,6 @@ import de.uhd.ifi.se.decision.management.jira.extraction.connector.ViewConnector; import de.uhd.ifi.se.decision.management.jira.extraction.model.impl.CommentImpl; import de.uhd.ifi.se.decision.management.jira.extraction.persistence.ActiveObjectsManager; -import de.uhd.ifi.se.decision.management.jira.model.DecisionKnowledgeElement; import de.uhd.ifi.se.decision.management.jira.model.DecisionKnowledgeElementImpl; /** @@ -61,38 +60,39 @@ public void onIssueEvent(IssueEvent issueEvent) { this.issueEvent = issueEvent; this.projectKey = issueEvent.getProject().getKey(); Long eventTypeId = issueEvent.getEventTypeId(); - DecisionKnowledgeElement actionElement = new DecisionKnowledgeElementImpl(issueEvent.getIssue()); if (eventTypeId.equals(EventType.ISSUE_COMMENTED_ID)) { - handleNewComment(); + handleNewComment(new DecisionKnowledgeElementImpl(issueEvent.getIssue())); } if (eventTypeId.equals(EventType.ISSUE_COMMENT_DELETED_ID)) { - handleDeleteComment(); + handleDeleteComment(new DecisionKnowledgeElementImpl(issueEvent.getIssue())); } if (eventTypeId.equals(EventType.ISSUE_COMMENT_EDITED_ID)) { - handleEditComment(); + handleEditComment(new DecisionKnowledgeElementImpl(issueEvent.getIssue())); } if (eventTypeId.equals(EventType.ISSUE_DELETED_ID)) { - handleDeleteIssue(); + handleDeleteIssue(new DecisionKnowledgeElementImpl(issueEvent.getIssue())); } - // Always check if all sentences are linked correctly - ActiveObjectsManager.createLinksForNonLinkedElementsForIssue(actionElement.getId() + ""); } - - private void handleDeleteIssue() { + + private void handleDeleteIssue(DecisionKnowledgeElementImpl decisionKnowledgeElement) { ActiveObjectsManager.cleanSentenceDatabaseForProject(this.projectKey); + ActiveObjectsManager.createLinksForNonLinkedElementsForIssue(decisionKnowledgeElement.getId() + ""); } - private void handleEditComment() { + private void handleEditComment(DecisionKnowledgeElementImpl decisionKnowledgeElement) { ActiveObjectsManager.checkIfCommentBodyHasChangedOutsideOfPlugin(new CommentImpl(issueEvent.getComment())); new ViewConnector(this.issueEvent.getIssue(), false); + ActiveObjectsManager.createLinksForNonLinkedElementsForIssue(decisionKnowledgeElement.getId() + ""); } - private void handleDeleteComment() { + private void handleDeleteComment(DecisionKnowledgeElementImpl decisionKnowledgeElement) { ActiveObjectsManager.cleanSentenceDatabaseForProject(this.projectKey); + ActiveObjectsManager.createLinksForNonLinkedElementsForIssue(decisionKnowledgeElement.getId() + ""); } - private void handleNewComment() { + private void handleNewComment(DecisionKnowledgeElementImpl decisionKnowledgeElement) { new ViewConnector(this.issueEvent.getIssue(), false); + ActiveObjectsManager.createLinksForNonLinkedElementsForIssue(decisionKnowledgeElement.getId() + ""); } }