Search in sources :

Example 11 with GroupImpl

use of org.jbpm.services.task.impl.model.GroupImpl in project jbpm by kiegroup.

the class CollectionUtils method readOrganizationalEntityList.

public static List<OrganizationalEntity> readOrganizationalEntityList(ObjectInput in) throws IOException, ClassNotFoundException {
    int size = in.readInt();
    List<OrganizationalEntity> list = new ArrayList<OrganizationalEntity>(size);
    for (int i = 0; i < size; i++) {
        short type = in.readShort();
        if (type == 0) {
            User user = new UserImpl();
            user.readExternal(in);
            list.add(user);
        } else {
            Group group = new GroupImpl();
            group.readExternal(in);
            list.add(group);
        }
    }
    return list;
}
Also used : Group(org.kie.api.task.model.Group) User(org.kie.api.task.model.User) OrganizationalEntity(org.kie.api.task.model.OrganizationalEntity) GroupImpl(org.jbpm.services.task.impl.model.GroupImpl) ArrayList(java.util.ArrayList) UserImpl(org.jbpm.services.task.impl.model.UserImpl)

Example 12 with GroupImpl

use of org.jbpm.services.task.impl.model.GroupImpl in project jbpm by kiegroup.

the class TaskFluent method addPotentialGroup.

public TaskFluent addPotentialGroup(String groupId) {
    if (assignments.getPotentialOwners().isEmpty()) {
        List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>();
        assignments.setPotentialOwners(potentialOwners);
    }
    assignments.getPotentialOwners().add(new GroupImpl(groupId));
    return this;
}
Also used : OrganizationalEntity(org.kie.api.task.model.OrganizationalEntity) GroupImpl(org.jbpm.services.task.impl.model.GroupImpl) ArrayList(java.util.ArrayList)

Aggregations

GroupImpl (org.jbpm.services.task.impl.model.GroupImpl)12 OrganizationalEntity (org.kie.api.task.model.OrganizationalEntity)12 HashMap (java.util.HashMap)9 CaseFileInstance (org.jbpm.casemgmt.api.model.instance.CaseFileInstance)9 AbstractCaseServicesBaseTest (org.jbpm.casemgmt.impl.util.AbstractCaseServicesBaseTest)9 UserImpl (org.jbpm.services.task.impl.model.UserImpl)9 Test (org.junit.Test)9 CaseAssignment (org.kie.api.runtime.process.CaseAssignment)7 CaseInstance (org.jbpm.casemgmt.api.model.instance.CaseInstance)6 ArrayList (java.util.ArrayList)4 QueryContext (org.kie.api.runtime.query.QueryContext)4 TaskSummary (org.kie.api.task.model.TaskSummary)4 AdHocFragmentNotFoundException (org.jbpm.casemgmt.api.AdHocFragmentNotFoundException)3 CaseActiveException (org.jbpm.casemgmt.api.CaseActiveException)3 CaseCommentNotFoundException (org.jbpm.casemgmt.api.CaseCommentNotFoundException)3 CaseNotFoundException (org.jbpm.casemgmt.api.CaseNotFoundException)3 TaskNotFoundException (org.jbpm.services.api.TaskNotFoundException)3 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1