[midPoint] Get OwnerName in reportQuery

Peter Holes pholes at gmail.com
Thu Oct 24 10:11:02 CEST 2019


Hi Pavol,

thanks for your quick response. I try your recommendation, but I
didn't get taskOwner or any relevant task details as I expected.

What I try:
1.) This works: ModelExpressionThreadLocalHolder?.getCurrentTask()
this return taskObject
<com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl at 44809005
DEFAULT_BINDING_TYPE=TIGHT lastOperationStatsUpdateTimestamp=null
operationStatsUpdateInterval=3000 taskPrism=task:null(null)
requestee=null environmentalPerformanceInformation=com.evolveum.midpoint.schema.statistics.EnvironmentalPerformanceInformation at 1ddb9810
synchronizationInformation=null iterativeTaskInformation=null
actionsExecutedInformation=null lightweightAsynchronousSubtasks=[]
parentForLightweightAsynchronousTask=null
taskResult=R(com.evolveum.midpoint.report.api.ReportService.searchObjects()
UNKNOWN null) canRun=true
taskManager=com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl at 264c96e6
repositoryService=com.evolveum.midpoint.repo.sql.SqlRepositoryServiceImpl at 1baba58
lightweightTaskHandler=null lightweightHandlerFuture=null
lightweightHandlerExecuting=false recreateQuartzTrigger=false
pendingModifications=[]>

2.) When I try to get any taskDetails like taskOwner, taskOID or
taskName everything was null.
I was able to get taskIdentifier which is not the same like
taskIdentifier generated in GUI - why?
When I try to found task by taskIdentifier, task doesn't exists.
I try the same scenario on 3.7.2 / 3.9, same same result.

Here is my debug code snippet:
##
task = ModelExpressionThreadLocalHolder?.getCurrentTask();
query = QueryBuilder.queryFor(TaskType.class,midpoint.getPrismContext()).item(TaskType.F_TASK_IDENTIFIER).eq(task.getTaskIdentifier()).build();
task2 = midpoint.searchObjects(TaskType.class, query);
log.info('############## taskObj:{}', task.dump());
log.info('############## taskOwner:{}', task.getOwner());
log.info('############## taskID:{}', task.getTaskIdentifier());
log.info('############## taskQuery.size:{}', task2.size());
##

Any idea how to get the "initiatorName" in reportQuery differently
than from task.



More information about the midPoint mailing list