title: Set variables on task in camunda
body: <p>Is it possible to set variables to an user task in the camunda definition xml?</p>
  
  <p>I would like to set a variable (deletable), that changes from task to task.</p>
  
  <p>Instance of Task 1: deletable = true<br>
  Instance of Task 2: deletable = true<br>
  Instance of Task 3: deletable = false<br>
  Instance of Task 4: deletable = false<br></p>
  
  <p>This is the actual task configuration:</p>
  
  <pre><code>&lt;bpmn2:userTask id="createtrunkdoc" camunda:candidateUsers="${candidateUser}" camunda:candidateGroups="provisioning" camunda:assignee="${candidateUser}" name="Create New&amp;#xD;&amp;#xA;Trunk Request"&gt;
    &lt;bpmn2:incoming&gt;SequenceFlow_1&lt;/bpmn2:incoming&gt;
    &lt;bpmn2:outgoing&gt;SequenceFlow_3&lt;/bpmn2:outgoing&gt;
  &lt;/bpmn2:userTask&gt;
  </code></pre>
  
  <p>Test case (camunda: 7.1.0-Final)</p>
  
  <pre><code>@RunWith(MockitoJUnitRunner.class)
  public class testTest {
  
      @Rule
      public ProcessEngineRule processEngineRule = new ProcessEngineRule();
  
      @Test
      @Deployment(resources = { "test.bpmn20.xml" })
      public void testHappyPath() {
          ProcessInstance processInstance = runtimeService().startProcessInstanceByKey("nipa-createsipinterconnect");
  
          assertThat(processInstance).isStarted().isNotEnded().task().hasDefinitionKey("reviewnewtrunk");
  
          Task task = taskService().createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
          assertEquals(true, taskService().getVariable(task.getId(), "deletable"));
      }
  
  }
  </code></pre>
  
  <p>The full XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://activiti.org/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="_1RW-0F22EeOq-_ehbw1S0Q" exporter="camunda modeler" exporterVersion="2.5.0" targetNamespace="http://activiti.org/bpmn"&gt;
    &lt;bpmn2:collaboration id="_Collaboration_8"&gt;
      &lt;bpmn2:participant id="nipacreatesipinterconnect" name="Create new SIP Interconnect" processRef="nipa-createsipinterconnect"/&gt;
    &lt;/bpmn2:collaboration&gt;
    &lt;bpmn2:process id="nipa-createsipinterconnect" name="Create new SIP Interconnect" isExecutable="true"&gt;
      &lt;bpmn2:laneSet id="LaneSet_1" name="Lane Set 1"&gt;
        &lt;bpmn2:lane id="Lane_1" name="Lane 1"&gt;
          &lt;bpmn2:flowNodeRef&gt;reviewnewtrunk&lt;/bpmn2:flowNodeRef&gt;
          &lt;bpmn2:flowNodeRef&gt;StartCreateSIPInterconnect&lt;/bpmn2:flowNodeRef&gt;
        &lt;/bpmn2:lane&gt;
      &lt;/bpmn2:laneSet&gt;
      &lt;bpmn2:userTask id="reviewnewtrunk" camunda:candidateGroups="management" camunda:candidateUsers="" name="Review New &amp;#xD;&amp;#xA;Trunk Request"&gt;
        &lt;bpmn2:extensionElements&gt;
          &lt;camunda:inputOutput&gt;
              &lt;camunda:inputParameter name="deletable"&gt;${true}&lt;/camunda:inputParameter&gt;
           &lt;/camunda:inputOutput&gt;
        &lt;/bpmn2:extensionElements&gt;
        &lt;bpmn2:incoming&gt;SequenceFlow_5&lt;/bpmn2:incoming&gt;
      &lt;/bpmn2:userTask&gt;
      &lt;bpmn2:startEvent id="StartCreateSIPInterconnect" name="Describe New &amp;#xD;&amp;#xA;SIP Interconnect &amp;#xD;&amp;#xA;Request"&gt;
        &lt;bpmn2:outgoing&gt;SequenceFlow_5&lt;/bpmn2:outgoing&gt;
      &lt;/bpmn2:startEvent&gt;
      &lt;bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="StartCreateSIPInterconnect" targetRef="reviewnewtrunk"/&gt;
    &lt;/bpmn2:process&gt;
    &lt;bpmndi:BPMNDiagram id="BPMNDiagram_1"&gt;
      &lt;bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="_Collaboration_8"&gt;
        &lt;bpmndi:BPMNShape id="_BPMNShape_Participant_12" bpmnElement="nipacreatesipinterconnect" isHorizontal="true"&gt;
          &lt;dc:Bounds height="333.0" width="1381.0" x="48.0" y="16.0"/&gt;
        &lt;/bpmndi:BPMNShape&gt;
        &lt;bpmndi:BPMNShape id="_BPMNShape_StartEvent_9" bpmnElement="StartCreateSIPInterconnect"&gt;
          &lt;dc:Bounds height="36.0" width="36.0" x="228.0" y="154.0"/&gt;
          &lt;bpmndi:BPMNLabel&gt;
            &lt;dc:Bounds height="54.0" width="116.0" x="188.0" y="195.0"/&gt;
          &lt;/bpmndi:BPMNLabel&gt;
        &lt;/bpmndi:BPMNShape&gt;
        &lt;bpmndi:BPMNShape id="_BPMNShape_UserTask_22" bpmnElement="reviewnewtrunk"&gt;
          &lt;dc:Bounds height="80.0" width="157.0" x="516.0" y="132.0"/&gt;
        &lt;/bpmndi:BPMNShape&gt;
        &lt;bpmndi:BPMNShape id="_BPMNShape_Lane_7" bpmnElement="Lane_1" isHorizontal="true"&gt;
          &lt;dc:Bounds height="333.0" width="1351.0" x="78.0" y="16.0"/&gt;
        &lt;/bpmndi:BPMNShape&gt;
        &lt;bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_StartEvent_9" targetElement="_BPMNShape_UserTask_22"&gt;
          &lt;di:waypoint xsi:type="dc:Point" x="264.0" y="172.0"/&gt;
          &lt;di:waypoint xsi:type="dc:Point" x="516.0" y="172.0"/&gt;
          &lt;bpmndi:BPMNLabel&gt;
            &lt;dc:Bounds height="6.0" width="6.0" x="291.0" y="172.0"/&gt;
          &lt;/bpmndi:BPMNLabel&gt;
        &lt;/bpmndi:BPMNEdge&gt;
      &lt;/bpmndi:BPMNPlane&gt;
    &lt;/bpmndi:BPMNDiagram&gt;
  &lt;/bpmn2:definitions&gt;
  </code></pre>