Package org.activiti.engine.impl.persistence.entity

Examples of org.activiti.engine.impl.persistence.entity.CommentEntityManager


    this.processInstanceId = processInstanceId;
    this.commentId = commentId;
  }

  public Void execute(CommandContext commandContext) {
    CommentEntityManager commentManager = commandContext.getCommentEntityManager();
   
    if(commentId != null) {
      // Delete for an individual comment
      Comment comment = commentManager.findComment(commentId);
      if(comment == null) {
        throw new ActivitiObjectNotFoundException("Comment with id '" + commentId + "' doesn't exists.", Comment.class);
      }
      commentManager.delete((CommentEntity) comment);
     
    } else {
      // Delete all comments on a task of process
      ArrayList<Comment> comments = new ArrayList<Comment>();
      if (processInstanceId != null) {
        comments.addAll(commentManager.findCommentsByProcessInstanceId(processInstanceId));
      }
      if (taskId != null) {
        comments.addAll(commentManager.findCommentsByTaskId(taskId));
      }

      for (Comment comment : comments) {
        commentManager.delete((CommentEntity)comment);
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.persistence.entity.CommentEntityManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.