cancel
Showing results for 
Search instead for 
Did you mean: 

how do we change the ownership

pteki
Champ in-the-making
Champ in-the-making
Hi, we have few processes/tasks/models with a particular process Id (user Id). But this team got a new id to use all the activiti related things.
what is the best way to migrate all the things belongs to the old id to new user id?

Thanks
3 REPLIES 3

faizal-manan
Champ in-the-making
Champ in-the-making
Hi,
if you mean user task assignee, you may directly update act_ru_task table

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

you can use API method:

  /**
   * Delegates the task to another user. This means that the assignee is set and the delegation state is set to {@link DelegationState#PENDING}. If no owner is set on the task, the owner is set to the
   * current assignee of the task.
   *
   * @param taskId
   *          The id of the task that will be delegated.
   * @param userId
   *          The id of the user that will be set as assignee.
   * @throws ActivitiObjectNotFoundException
   *           when no task exists with the given id.
   */
  void delegateTask(String taskId, String userId);

Audit log should catch all events in that case.

Regards
Martin

pteki
Champ in-the-making
Champ in-the-making
Thanks for the response. we need to replace all the things belongs to a specific user id, say old_user to new_user. not just few. as a matter of fact, we don't know what are those.