cancel
Showing results for 
Search instead for 
Did you mean: 

Task's comment user

jcavezian
Champ in-the-making
Champ in-the-making
Hello,

using Java API

TaskService.addComment(String taskId, String processInstanceId, String message)
I can add a comment to a task.

But I can't figure out how to set the user, author of the comment.
Does any one know how to do that ?
Thank you.
Jerome
3 REPLIES 3

jcavezian
Champ in-the-making
Champ in-the-making
Finally I could figure it out.
You need to call
IdentityService.setAuthenticatedUserId(String authenticatedUserId)before, in the same thread.
Hope this will help…
Jerome

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
or use

Authentication.setAuthenticatedUserId(authenticatedUserId);

If you do not have the identityService, because that is what  IdentityService.setAuthenticatedUserId(String authenticatedUserId) does:

  public void setAuthenticatedUserId(String authenticatedUserId) {
    Authentication.setAuthenticatedUserId(authenticatedUserId);
  }

jcavezian
Champ in-the-making
Champ in-the-making
Thanx for the tip !

Jerome