Message Boards

How to assign User on kaleo workflow task

Montej Shah, modified 8 Years ago.

How to assign User on kaleo workflow task

Junior Member Posts: 48 Join Date: 2/18/15 Recent Posts
Hi i am working on kaleo workflow.
I have four task 'review content','underwrite content','offer price','approve or reject'
Now 'review content' assign to role 'A',
'underwrite content' assign to role 'B'
'offer price' assign to role 'C'
now i want assign 'approve or reject' to user who complete 'underwrite content' means user who has 'B' role or we can say who complete previous task.
Anyone can know how to do this?

I have also one question can i assign task to same user who currently process task ?

Any help will be appreciated
thumbnail
Bijan Vakili, modified 8 Years ago.

RE: How to assign User on kaleo workflow task

Expert Posts: 375 Join Date: 3/10/09 Recent Posts
There are many ways to achieve this task.

After bit of research, but not tested: you may use the WorkflowLog manager:

com.liferay.portal.kernel.workflow.WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(...)



com.liferay.portal.kernel.workflow.WorkflowLogManagerUtil.getWorkflowLogsByWorkflowTask(...)


And iterate to find WorkflowLog field:

workflowLog.getPreviousUserId()


The way originally came to mind (without knowledge of workflow APIs):
One way is to record user's id; can be done via Expando table; and retrieved in "approve or reject" task. Of course many other ways to do it; though this is simplest I can think of.


I suggest using the former if can; since creating expando's redundant.
Montej Shah, modified 8 Years ago.

RE: How to assign User on kaleo workflow task

Junior Member Posts: 48 Join Date: 2/18/15 Recent Posts
Hi ,
Thanks for your response.
As you told
com.liferay.portal.kernel.workflow.WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(...) this method give List<WorkflowLog>.
From this List of WorkflowLog which is my required WorkflowLog so i can get PreviousUserId ?
Also this method require 'List<Integer> logTypes' as parameter what to pass here?