AnsweredAssumed Answered

How to assign user task to a user from API?

Question asked by asanchez on Oct 6, 2011
Latest reply on Oct 10, 2011 by frederikheremans1
I am trying to improve the task operations rest api with another operation that allows to reassign task to other user. I have used the followed code:
ActivitiUtil.getTaskService().setAssignee(taskId, userId);
.
But it doesn't work as well as i would like it. Because it makes an entry to ACT_HI_COMMENT table but column USER_ID_ is null, and that makes activiti-explorer crash with a NULL Pointer Exception when it tries to compose the task lists.
I know that activiti-web-explorer uses the same instruction, but it records the USER_ID logged in the table.
Am I doing something wrong? Appreciate your help.

Log after executing setAssignee operation within activiti-explorer-webapp

FINE: ==>  Executing: insert into ACT_HI_COMMENT (ID_, TYPE_, TIME_, USER_ID_, TASK_ID_, PROC_INST_ID_, ACTION_, MESSAGE_, FULL_MSG_) values ( ?, ?, ?, ?, ?, ?, ?, ?, ? )
Oct 6, 2011 2:25:08 PM org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl debug
FINE: ==> Parameters: 2905(String), event(String), 2011-10-06 14:25:08.706(Timestamp), kermit(String), 2904(String), null, AddUserLink(String), gonzo_|_assignee(String), null

Log after executing setAssignee operation within activiti-rest2-webapp

FINE: ==>  Executing: insert into ACT_HI_COMMENT (ID_, TYPE_, TIME_, USER_ID_, TASK_ID_, PROC_INST_ID_, ACTION_, MESSAGE_, FULL_MSG_) values ( ?, ?, ?, ?, ?, ?, ?, ?, ? )
Oct 6, 2011 2:22:02 PM org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl debug
FINE: ==> Parameters: 3001(String), event(String), 2011-10-06 14:22:02.228(Timestamp), null, 804(String), null, AddUserLink(String), fozzie_|_assignee(String), null

Outcomes