Search in sources :

Example 1 with TaskInstanceView

use of org.jbpm.persistence.api.integration.model.TaskInstanceView in project jbpm by kiegroup.

the class JPATaskPersistenceContext method persistTask.

@Override
public Task persistTask(Task task) {
    check();
    this.em.persist(task);
    if (this.pessimisticLocking) {
        this.em.flush();
        return this.em.find(TaskImpl.class, task.getId(), LockModeType.PESSIMISTIC_FORCE_INCREMENT);
    }
    EventManagerProvider.getInstance().get().create(new TaskInstanceView(task));
    return task;
}
Also used : TaskInstanceView(org.jbpm.persistence.api.integration.model.TaskInstanceView)

Example 2 with TaskInstanceView

use of org.jbpm.persistence.api.integration.model.TaskInstanceView in project jbpm by kiegroup.

the class JPATaskPersistenceContext method removeTask.

@Override
public Task removeTask(Task task) {
    check();
    em.remove(task);
    EventManagerProvider.getInstance().get().delete(new TaskInstanceView(task));
    return task;
}
Also used : TaskInstanceView(org.jbpm.persistence.api.integration.model.TaskInstanceView)

Example 3 with TaskInstanceView

use of org.jbpm.persistence.api.integration.model.TaskInstanceView in project jbpm by kiegroup.

the class JPATaskPersistenceContext method removeCommentFromTask.

@Override
public Comment removeCommentFromTask(Comment comment, Task task) {
    ((InternalTaskData) task.getTaskData()).removeComment(comment.getId());
    EventManagerProvider.getInstance().get().update(new TaskInstanceView(task));
    return comment;
}
Also used : TaskInstanceView(org.jbpm.persistence.api.integration.model.TaskInstanceView) InternalTaskData(org.kie.internal.task.api.model.InternalTaskData)

Example 4 with TaskInstanceView

use of org.jbpm.persistence.api.integration.model.TaskInstanceView in project jbpm by kiegroup.

the class JPATaskPersistenceContext method addCommentToTask.

@Override
public Comment addCommentToTask(Comment comment, Task task) {
    ((InternalTaskData) task.getTaskData()).addComment(comment);
    EventManagerProvider.getInstance().get().update(new TaskInstanceView(task));
    return comment;
}
Also used : TaskInstanceView(org.jbpm.persistence.api.integration.model.TaskInstanceView) InternalTaskData(org.kie.internal.task.api.model.InternalTaskData)

Example 5 with TaskInstanceView

use of org.jbpm.persistence.api.integration.model.TaskInstanceView in project jbpm by kiegroup.

the class JPATaskPersistenceContext method updateTask.

@Override
public Task updateTask(Task task) {
    check();
    Task updated = this.em.merge(task);
    EventManagerProvider.getInstance().get().update(new TaskInstanceView(task));
    return updated;
}
Also used : Task(org.kie.api.task.model.Task) TaskInstanceView(org.jbpm.persistence.api.integration.model.TaskInstanceView)

Aggregations

TaskInstanceView (org.jbpm.persistence.api.integration.model.TaskInstanceView)7 InternalTaskData (org.kie.internal.task.api.model.InternalTaskData)4 Attachment (org.kie.api.task.model.Attachment)1 Task (org.kie.api.task.model.Task)1