Search in sources :

Example 6 with Comment

use of org.kie.kogito.process.workitem.Comment in project kogito-runtimes by kiegroup.

the class ProtobufProcessInstanceReader method buildComment.

private Comment buildComment(KogitoWorkItemsProtobuf.Comment comment) {
    Comment result = new Comment(comment.getId(), comment.getUpdatedBy());
    result.setContent(comment.getContent());
    result.setUpdatedAt(new Date(comment.getUpdatedAt()));
    return result;
}
Also used : Comment(org.kie.kogito.process.workitem.Comment) Date(java.util.Date)

Example 7 with Comment

use of org.kie.kogito.process.workitem.Comment in project kogito-runtimes by kiegroup.

the class HumanTaskHelper method deleteComment.

public static boolean deleteComment(KogitoWorkItem item, Object id, String user) {
    Map<Object, Comment> comments = asHumanTask(item).getComments();
    Comment comment = comments.get(id);
    if (comment == null || !comment.getUpdatedBy().equals(user)) {
        return false;
    }
    return comments.remove(id) != null;
}
Also used : Comment(org.kie.kogito.process.workitem.Comment)

Aggregations

Comment (org.kie.kogito.process.workitem.Comment)7 Date (java.util.Date)3 Attachment (org.kie.kogito.process.workitem.Attachment)3 Any (com.google.protobuf.Any)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 BsonString (org.bson.BsonString)1 BsonWriter (org.bson.BsonWriter)1 Document (org.bson.Document)1 EncoderContext (org.bson.codecs.EncoderContext)1 HumanTaskWorkItemImpl (org.jbpm.process.instance.impl.humantask.HumanTaskWorkItemImpl)1 HumanTaskNodeInstance (org.jbpm.workflow.instance.node.HumanTaskNodeInstance)1 WorkItemNodeInstance (org.jbpm.workflow.instance.node.WorkItemNodeInstance)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 KogitoWorkItemImpl (org.kie.kogito.process.workitems.impl.KogitoWorkItemImpl)1 ProcessInstanceMarshallerException (org.kie.kogito.serialization.process.ProcessInstanceMarshallerException)1 KogitoWorkItemsProtobuf (org.kie.kogito.serialization.process.protobuf.KogitoWorkItemsProtobuf)1