All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kie.internal.task.api.TaskPersistenceContext Maven / Gradle / Ivy

Go to download

The Drools and jBPM internal API which is NOT backwards compatible between releases.

There is a newer version: 9.44.0.Final
Show newest version
/*
 * Copyright 2015 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package org.kie.internal.task.api;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.kie.api.task.UserGroupCallback;
import org.kie.api.task.model.Attachment;
import org.kie.api.task.model.Comment;
import org.kie.api.task.model.Content;
import org.kie.api.task.model.Email;
import org.kie.api.task.model.Group;
import org.kie.api.task.model.OrganizationalEntity;
import org.kie.api.task.model.Task;
import org.kie.api.task.model.TaskSummary;
import org.kie.api.task.model.User;
import org.kie.internal.task.api.model.ContentData;
import org.kie.internal.task.api.model.Deadline;
import org.kie.internal.task.api.model.FaultData;

public interface TaskPersistenceContext {

    Task findTask(Long taskId);

    Task persistTask(Task task);

    Task updateTask(Task task);

    Task removeTask(Task task);

    Group findGroup(String groupId);

    Group persistGroup(Group group);

    Group updateGroup(Group group);

    Group removeGroup(Group group);

    User findUser(String userId);

    User persistUser(User user);

    User updateUser(User user);

    User removeUser(User user);

    OrganizationalEntity findOrgEntity(String orgEntityId);

    OrganizationalEntity persistOrgEntity(OrganizationalEntity orgEntity);

    OrganizationalEntity updateOrgEntity(OrganizationalEntity orgEntity);

    OrganizationalEntity removeOrgEntity(OrganizationalEntity orgEntity);

    Content findContent(Long contentId);

    Content persistContent(Content content);

    Content updateContent(Content content);

    Content removeContent(Content content);

    Long findTaskIdByContentId(Long contentId);

    Attachment findAttachment(Long attachmentId);

    Attachment persistAttachment(Attachment attachment);

    Attachment updateAttachment(Attachment attachment);

    Attachment removeAttachment(Attachment attachment);

    Attachment removeAttachmentFromTask(Task task, long attachmentId);

    Attachment addAttachmentToTask(Attachment attachment, Task task);

    Comment findComment(Long commentId);

    Comment persistComment(Comment comment);

    Comment updateComment(Comment comment);

    Comment removeComment(Comment comment);

    Comment removeCommentFromTask(Comment comment, Task task);

    Comment addCommentToTask(Comment comment, Task task);

    Deadline findDeadline(Long deadlineId);

    Deadline persistDeadline(Deadline deadline);

    Deadline updateDeadline(Deadline deadline);

    Deadline removeDeadline(Deadline deadline);

    Task setDocumentToTask(Content content, ContentData contentData, Task task);

    Task setFaultToTask(Content content, FaultData faultData, Task task);

    Task setOutputToTask(Content content, ContentData contentData, Task task);


    /*
     * Query related methods
     */

     T queryWithParametersInTransaction(String queryName, Map params, Class clazz);

     T queryWithParametersInTransaction(String queryName, boolean singleResult, Map params, Class clazz);

     T queryAndLockWithParametersInTransaction(String queryName, Map params, boolean singleResult, Class clazz);

     T queryInTransaction(String queryName, Class clazz);

     T queryStringInTransaction(String queryString, Class clazz );

     T queryStringWithParametersInTransaction(String queryString, boolean singleResult, Map params, Class clazz );

     T queryStringWithParametersInTransaction(String queryString,  Map params, Class clazz );

     T queryAndLockStringWithParametersInTransaction(String queryName, Map params, boolean singleResult, Class clazz);

    int executeUpdateString(String updateString);

    int executeUpdate(String queryName, Map params);

    HashMap addParametersToMap(Object ... parameterValues);

    /*
     * Following are optional methods that are more like extension to
     * default data model to allow flexible add-ons
     */
     T persist(T object);

     T find(Class entityClass, Object primaryKey);

     T remove(T entity);

     T merge(T entity);

    /*
     * life cycle methods
     */
    boolean isOpen();

    void joinTransaction();

    void close();

    /*
     * JPA Query methods
     */

    List doTaskSummaryCriteriaQuery(String userId, UserGroupCallback userGroupCallback, Object queryWhere);

    Email findEmail(String emailId);

    Email persistEmail(Email email);

    Email updateEmail(Email email);

    Email removeEmail(Email email);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy