use of org.jbpm.services.task.impl.model.PeopleAssignmentsImpl in project jbpm by kiegroup.
the class TaskImpl method readExternal.
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
id = in.readLong();
priority = in.readInt();
archived = in.readShort();
taskType = in.readUTF();
formName = in.readUTF();
names = CollectionUtils.readI18NTextList(in);
subjects = CollectionUtils.readI18NTextList(in);
descriptions = CollectionUtils.readI18NTextList(in);
if (in.readBoolean()) {
subTaskStrategy = SubTasksStrategy.valueOf(in.readUTF());
}
if (in.readBoolean()) {
peopleAssignments = new PeopleAssignmentsImpl();
peopleAssignments.readExternal(in);
}
if (in.readBoolean()) {
delegation = new DelegationImpl();
delegation.readExternal(in);
}
if (in.readBoolean()) {
taskData = new TaskDataImpl();
taskData.readExternal(in);
}
if (in.readBoolean()) {
deadlines = new DeadlinesImpl();
deadlines.readExternal(in);
}
}
use of org.jbpm.services.task.impl.model.PeopleAssignmentsImpl in project jbpm by kiegroup.
the class DistincVsJoinPerformanceTest method doJoinQuery.
private long doJoinQuery(EntityManager em, String userId, List<String> groupIds, int total) {
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<TaskImpl> joinQuery = builder.createQuery(TaskImpl.class);
Root<TaskImpl> taskRoot = joinQuery.from(TaskImpl.class);
Join<TaskImpl, TaskDataImpl> join = taskRoot.join(TaskImpl_.taskData);
Selection select = getTaskSummarySelect(builder, taskRoot);
joinQuery.select(select);
Join<TaskImpl, PeopleAssignmentsImpl> peopleAssign = taskRoot.join(TaskImpl_.peopleAssignments);
ListJoin<PeopleAssignmentsImpl, OrganizationalEntityImpl> busAdmins = peopleAssign.join(PeopleAssignmentsImpl_.businessAdministrators, JoinType.LEFT);
ListJoin<PeopleAssignmentsImpl, OrganizationalEntityImpl> potOwners = peopleAssign.join(PeopleAssignmentsImpl_.potentialOwners, JoinType.LEFT);
ListJoin<PeopleAssignmentsImpl, OrganizationalEntityImpl> stakeHols = peopleAssign.join(PeopleAssignmentsImpl_.taskStakeholders, JoinType.LEFT);
List<Predicate> predicates = new ArrayList<Predicate>();
predicates.add(builder.equal(taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.actualOwner).get(UserImpl_.id), userId));
predicates.add(builder.equal(taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.createdBy).get(UserImpl_.id), userId));
predicates.add(builder.or(builder.equal(busAdmins.get(OrganizationalEntityImpl_.id), userId), busAdmins.get(OrganizationalEntityImpl_.id).in(groupIds)));
predicates.add(builder.or(builder.equal(potOwners.get(OrganizationalEntityImpl_.id), userId), potOwners.get(OrganizationalEntityImpl_.id).in(groupIds)));
predicates.add(builder.or(builder.equal(stakeHols.get(OrganizationalEntityImpl_.id), userId), stakeHols.get(OrganizationalEntityImpl_.id).in(groupIds)));
if (!predicates.isEmpty()) {
joinQuery.where(builder.or(predicates.toArray(new Predicate[predicates.size()])));
}
return timeQueryExecution(em, joinQuery, null, total);
}
use of org.jbpm.services.task.impl.model.PeopleAssignmentsImpl in project jbpm by kiegroup.
the class TaskSummaryQueryCriteriaUtil method getEntityField.
/*
* (non-Javadoc)
* @see org.jbpm.query.jpa.impl.QueryCriteriaUtil#getEntityField(javax.persistence.criteria.CriteriaQuery, java.lang.Class, java.lang.String)
*/
@Override
protected <T> Expression getEntityField(CriteriaQuery<T> query, String listId, Attribute attr) {
if (attr == null) {
return null;
}
Root<TaskImpl> taskRoot = null;
Join<TaskImpl, TaskDataImpl> taskDataJoin = null;
Join<TaskImpl, PeopleAssignmentsImpl> peopAssignJoin = null;
for (Root root : query.getRoots()) {
if (TaskImpl.class.equals(root.getJavaType())) {
taskRoot = (Root<TaskImpl>) root;
for (Join<TaskImpl, ?> join : taskRoot.getJoins()) {
if (TaskDataImpl.class.equals(join.getJavaType())) {
taskDataJoin = (Join<TaskImpl, TaskDataImpl>) join;
} else if (PeopleAssignmentsImpl.class.equals(join.getJavaType())) {
peopAssignJoin = (Join<TaskImpl, PeopleAssignmentsImpl>) join;
}
}
}
}
assert taskRoot != null : "Unable to find TaskImpl Root in query!";
if (taskDataJoin == null) {
taskDataJoin = taskRoot.join(TaskImpl_.taskData);
}
assert taskDataJoin != null : "Unable to find TaskDataImpl Join in query!";
return taskImplSpecificGetEntityField(query, taskRoot, taskDataJoin, peopAssignJoin, listId, attr);
}
Aggregations