How to get workflow history using Java API

cancel
Showing results for 
Search instead for 
Did you mean: 
lex91
Active Member II

How to get workflow history using Java API

Jump to solution

Hello!

So here is my dilemma. I would like to get the information as seen in the screenshot from the workflow-details page using the Java API for every workflow associated with a document (NodeRef).

I am especially interested in the "Completed By", "Date Completed" and the "Comment" columns. 

Here is what I have done so far:

- got the associated workflows using   workflowService.getWorkflowsForContent(NodeRef, boolean)

- got the tasks for each workflow using   workflowService.queryTasks(WorkflowTaskQuery, boolean)

- extracted properties for each task with   WorkflowTask.getProperties()

At this point I have access to the "completionDate" and "comment"(if available) properties for each task. The problem is with the "Completed by" information. I thought the "assignee" property is what I need but they don't match. For the example in the screenshot the first task (in chronological order) has an assignee of "test1", the second task has an assignee of "null" and the third task has also "test1" and they should be "admin", "test1", "admin" respectively.

Can anyone tell me how to get the "Completed By" info?

Any help would be greatly appreciated!

1 Solution

Accepted Solutions
afaust
Master

Re: How to get workflow history using Java API

Jump to solution

The assignee does not matter - this property is only used for the initial assignment based on user input. You are looking for the owner of the task. The owner property is used to sync the state of the internal Activiti engine assignment, and will be the user who completed the task.

View solution in original post

2 Replies
afaust
Master

Re: How to get workflow history using Java API

Jump to solution

The assignee does not matter - this property is only used for the initial assignment based on user input. You are looking for the owner of the task. The owner property is used to sync the state of the internal Activiti engine assignment, and will be the user who completed the task.

lex91
Active Member II

Re: How to get workflow history using Java API

Jump to solution

Thank you! That was it...I didn't notice the owner property before.