Search in sources :

Example 1 with ExecutedTransition

use of com.cloudogu.scm.review.comment.service.ExecutedTransition in project scm-review-plugin by scm-manager.

the class CommentEventMailTextResolver method getCommentModificationEventType.

private static CommentEventType getCommentModificationEventType(BasicComment newComment) {
    List<ExecutedTransition> transitions = newComment.getExecutedTransitions();
    Transition lastTransition = transitions.get(transitions.size() - 1).getTransition();
    if (lastTransition == CommentTransition.MAKE_TASK) {
        return CommentEventType.TASK_CREATED;
    } else if (lastTransition == CommentTransition.SET_DONE) {
        return CommentEventType.TASK_DONE;
    } else if (lastTransition == CommentTransition.REOPEN) {
        return CommentEventType.TASK_REOPEN;
    } else if (lastTransition == CommentTransition.MAKE_COMMENT) {
        return CommentEventType.COMMENT_CREATED;
    } else {
        log.trace("cannot handle changes of comment");
        return null;
    }
}
Also used : CommentTransition(com.cloudogu.scm.review.comment.service.CommentTransition) Transition(com.cloudogu.scm.review.comment.service.Transition) ExecutedTransition(com.cloudogu.scm.review.comment.service.ExecutedTransition) ExecutedTransition(com.cloudogu.scm.review.comment.service.ExecutedTransition)

Aggregations

CommentTransition (com.cloudogu.scm.review.comment.service.CommentTransition)1 ExecutedTransition (com.cloudogu.scm.review.comment.service.ExecutedTransition)1 Transition (com.cloudogu.scm.review.comment.service.Transition)1