<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello Jan,<br>
</p>
technically, WorkItemType is not a PrismObject, it is "just" a
PrismContainer.<br>
<br>
So please have a look at .searchContainers method (either at
repository or model level). Having a quick look at your query, it
should work.<br>
<br>
Best regards,<br>
<pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
<div class="moz-cite-prefix">On 04.05.2018 14:55, Jan Melník - AMI
Praha a.s. wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAKcRzoLj3zSKLniJ0yMznBpqoYggzErkDu9+KUroHi1ZsYyvXw@mail.gmail.com">
<div dir="ltr">Hello guys,
<div><br>
</div>
<div>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.
<div><br>
</div>
<div><u>Code:</u></div>
<div>
<div> </div>
<div><i> taskManager =
SpringApplicationContextHolder.getApplicationContext().getBean(TaskManagerQuartzImpl.class);</i></div>
<div><i> </i></div>
<div><i> repositoryService =
taskManager.getRepositoryService(); </i></div>
<div><i> </i></div>
<div><i> OperationResult ores = new
OperationResult("dummy") //task.getResult();</i></div>
<div><i> </i></div>
<div><i> ObjectQuery query =
QueryBuilder.queryFor(WorkItemType.class, prismContext)</i></div>
<div><i> .item(WorkItemType.F_ASSIGNEE_REF)</i></div>
<div><i> .ref(input.oid)</i></div>
<div><i> .build();</i></div>
<div><i> </i></div>
<div><i> //res =
midpoint.searchObjects(WorkItemType.class, query)
//NO-GO</i></div>
<div><i>
SearchResultLis<PrismObjecct<WorkItemType>>
res =
repositoryService.searchObjects(WorkItemType.class,
query, null, ores);</i></div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><u>Result:</u></div>
<div>com.evolveum.midpoint.util.exception.SystemException:
Unsupported type class
com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType<br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><u>Third try</u> was according GUI page, and guess what,
another Unsupported exception <font size="4">😒</font></div>
<div><br>
</div>
<div>javax.script.ScriptException:
com.evolveum.midpoint.util.exception.SystemException:
Unsupported type class
com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType</div>
<div>...</div>
<div><br>
</div>
<div><u>Code:</u></div>
<div>
<div><i>
<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">
</span>
modelService =
SpringApplicationContextHolder.getApplicationContext().getBean(ModelService.class);</i></div>
<div><i><br>
</i></div>
<div><i> Task sTask =
taskManager.createTaskInstance("Work item search")
</i></div>
<div><i> OperationResult ores =
sTask.getResult();</i></div>
<div>
<i><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">
<span> </span></span> ...</i></div>
<div><i> res =
modelService.searchObjects(WorkItemType.class, query,
null, sTask, ores);</i></div>
<div> </div>
</div>
<div><br>
</div>
<div><b>Any ideas how to list "work items" in MidPoint? Should I
look for another type? Anyone knows what I'm doing wrong
here?</b></div>
<div><br>
</div>
<div><br>
</div>
<div>Jan</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
</body>
</html>