[midPoint] Listing WorkItems in task

Jan Melník - AMI Praha a.s. jan.melnik at ami.cz
Fri May 4 14:55:08 CEST 2018


Hello guys,

I'm trying to list WorkItems assigned to specific user.
midpoint.searchObject does not support WorkItemType, so I've tried
searchObjects on RepositoryService but got another Unsupported type class
exception.

*Code:*

*                taskManager =
SpringApplicationContextHolder.getApplicationContext().getBean(TaskManagerQuartzImpl.class);*

*                repositoryService = taskManager.getRepositoryService();
 *

*                OperationResult ores = new OperationResult("dummy")
//task.getResult();*

*                ObjectQuery query =
QueryBuilder.queryFor(WorkItemType.class, prismContext)*
*                  .item(WorkItemType.F_ASSIGNEE_REF)*
*                  .ref(input.oid)*
*                  .build();*

*                //res = midpoint.searchObjects(WorkItemType.class, query)
//NO-GO*
*                SearchResultLis<PrismObjecct<WorkItemType>> res =
repositoryService.searchObjects(WorkItemType.class, query, null, ores);*


*Result:*
com.evolveum.midpoint.util.exception.SystemException: Unsupported type
class com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType


*Third try* was according GUI page, and guess what, another Unsupported
exception 😒

javax.script.ScriptException:
com.evolveum.midpoint.util.exception.SystemException: Unsupported type
class com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType
...

*Code:*
*                  modelService =
SpringApplicationContextHolder.getApplicationContext().getBean(ModelService.class);*

*                Task sTask = taskManager.createTaskInstance("Work item
search")                *
*                OperationResult ores = sTask.getResult();*
*                 ...*
*                res = modelService.searchObjects(WorkItemType.class,
query, null, sTask, ores);*


*Any ideas how to list "work items" in MidPoint? Should I look for another
type? Anyone knows what I'm doing wrong here?*


Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20180504/b16e41e5/attachment.htm>


More information about the midPoint mailing list