[midPoint] Listing WorkItems in task
Pavol Mederly
mederly at evolveum.com
Fri May 4 15:20:52 CEST 2018
Hello Jan,
technically, WorkItemType is not a PrismObject, it is "just" a
PrismContainer.
So please have a look at .searchContainers method (either at repository
or model level). Having a quick look at your query, it should work.
Best regards,
Pavol Mederly
Software developer
evolveum.com
On 04.05.2018 14:55, Jan Melník - AMI Praha a.s. wrote:
> 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
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20180504/2d614ca5/attachment.htm>
More information about the midPoint
mailing list