AnsweredAssumed Answered

Assignment using tasklistener is failing

Question asked by pratikdas on Jun 4, 2013
Latest reply on Jun 6, 2013 by frederikheremans1
I am try to assign a candidate user in a taskListener using the following code:
public class AssignmentHandler implements TaskListener {
  public void notify(DelegateTask delegateTask) {
    delegateTask.addCandidateGroup("bdu");   
  } 
}

But when I run my process instance, the task does not get assigned. I checked in debug logs, the process instance id and process definition id are set as null in the table ACT_RU_IDENTITYLINK.   The logs are given below. Any pointers will be helpful.

02:01:32,304 [http-bio-8080-exec-1] DEBUG org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity.insertHistoricTaskInstance  - ==>  Preparing: insert into ACT_HI_TASKINST ( ID_, PROC_DEF_ID_, PROC_INST_ID_, EXECUTION_ID_, NAME_, PARENT_TASK_ID_, DESCRIPTION_, OWNER_, ASSIGNEE_, START_TIME_, CLAIM_TIME_, END_TIME_, DURATION_, DELETE_REASON_, TASK_DEF_KEY_, FORM_KEY_, PRIORITY_, DUE_DATE_ ) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
02:01:32,306 [http-bio-8080-exec-1] DEBUG org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity.insertHistoricTaskInstance  - ==> Parameters: 54119(String), approvalProcess:1:54082(String), 54111(String), 54111(String), Approval Failure Queue(String), null, null, null, null, 2013-06-04 14:01:32.25(Timestamp), null, null, null, null, usertask2(String), screen2(String), 50(Integer), null
02:01:32,307 [http-bio-8080-exec-1] DEBUG org.activiti.engine.impl.db.DbSqlSession  - inserting: IdentityLinkEntity[54120]
02:01:32,307 [http-bio-8080-exec-1] DEBUG org.activiti.engine.impl.persistence.entity.IdentityLinkEntity.insertIdentityLink  - ooo Using Connection [Transaction-aware proxy for target Connection [oracle.jdbc.driver.T4CConnection@610f5193]]
02:01:32,308 [http-bio-8080-exec-1] DEBUG org.activiti.engine.impl.persistence.entity.IdentityLinkEntity.insertIdentityLink  - ==>  Preparing: insert into ACT_RU_IDENTITYLINK (ID_, REV_, TYPE_, USER_ID_, GROUP_ID_, TASK_ID_, PROC_INST_ID_, PROC_DEF_ID_) values (?, 1, ?, ?, ?, ?, ?, ?)
02:01:32,308 [http-bio-8080-exec-1] DEBUG org.activiti.engine.impl.persistence.entity.IdentityLinkEntity.insertIdentityLink  - ==> Parameters: 54120(String), candidate(String), null, bdu(String), 54119(String), null, null

thanks
Pratik

Outcomes