How to set User task Owner?

Greeting!

Having hard time to find it in user docs…

How do i set task owner via Modeler or updating bpmn xml?

There is no such a field as owner in User Task-> general.
Updating directly bpmn xml also not giving any effect.

I have tried different ways but owner remains empty.

My user task example:

<bpmn:userTask id=“UserTask_1” name=“TEST_USER_TASK” camunda:assignee=“${assignee}” camunda:candidateUsers=“${candidateAssignee}” camunda:candidateGroups=“${candidateGroups}” camunda:dueDate=“${dueDate}” camunda:followUpDate=“${followUpDate}” camunda:priority=“${priority}” camunda:owner=“${taskOwner}”>
bpmn:documentationTest User Task</bpmn:documentation>
bpmn:extensionElements
camunda:properties
<camunda:property name=“owner” value=“${taskOwner}” />
</camunda:properties>
<camunda:taskListener class=“my.test.camunda.engine.usertask.TaskAssignmentListener” event=“assignment” />
</bpmn:extensionElements>
bpmn:incomingSequenceFlow_0t55ckb</bpmn:incoming>
bpmn:outgoingSequenceFlow_0ydkpp6</bpmn:outgoing>
bpmn:potentialOwner
bpmn:resourceAssignmentExpression
<bpmn:expression xsi:type=“bpmn:tFormalExpression”>${potentialOwner}</bpmn:expression>
</bpmn:resourceAssignmentExpression>
</bpmn:potentialOwner>
</bpmn:userTask>

thanks in advance!

Owner is set by the first Assignee of the task (i believe owner is primary used for Task delegation purposes?, but yes docs are fuzzy on that one…).

https://docs.camunda.org/javadoc/camunda-bpm-platform/7.7/org/camunda/bpm/engine/TaskService.html#setOwner(java.lang.String,%20java.lang.String)

You can set it through the Java API ^^

But make sure to read: Unset owner of UserTask. Has been discussed before.

Thanks for looking at this! Yeah i’ve went through mentioned threads before posing my q.

I gave it a try, and You are right, owner is set during task delegation. Original task assignee becomes the owner and current assignee become the user, task is delegated to. This happens only on the first delegation. So if task is reassigned after that, to another user, and that user is delegating task again, the owner still remains as it was set first.

Weird, if task owner remains the same all the time during following reassignments and delegations, why not to allow to set id during task init in the process.anyways.

  • task owner is set as original assignee during the first delegation
  • task owner is not the property we can operate from a workflow during user task initialization.
  • task owner can be set/updated only via API

What’s your use case ?

Nothing in particular (yet), other then ordinary boring stuff like: be able to set task to the user group(s), assign to specific user, delegate, escalate, complete…

  • with ‘owner’ attribute in particular, was just trying to understand what this thing is, and what is the best use case to consume it.