AnsweredAssumed Answered

Problem using initiator

Question asked by bhj2 on Aug 5, 2011
Latest reply on Oct 3, 2013 by trademak

I created my own version of the explorer and my own bpmn2.0 process. The problem is about the initiator. I want the task to be assigned to the initiator of the process but that works… SOMETIMES!! It's random.

Here is my bpmn process:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns=""
   xmlns:activiti="" targetNamespace="EGovRunnerProcesses">

   <process id="MyTestProcess" name="MyTest Process">
      <startEvent id="theStart" activiti:initiator="initiator">
            <activiti:formProperty id="person" type="string" />
            <activiti:formProperty id="reason" type="string" />

      <sequenceFlow id='flow1' sourceRef='theStart' targetRef='writeSomethingTask' />

      <userTask id="writeSomethingTask" name="Write something" activiti:formKey="ch/glue/egovrunner/processes/MyTestForm.form" activiti:assignee="${initiator}">
            Write something.
      <activiti:taskListener event="create" class="ch.glue.egovrunner.explorer.listeners.OsisTaskCreateListener" />

      <sequenceFlow id='flow2' sourceRef='writeSomethingTask' targetRef='theEnd' />

      <endEvent id="theEnd" />


and here is the java method I use to start the process:
    * Start a instance which has a start form.
    * @param processDefinition
    *            the process definition to start
    * @param formData
    *            the form data filled by the user
   public void submitStartForm(ProcessDefinition processDefinition,
         Map<String, String> formData) {
      ProcessInstance pi = getFormService().submitStartFormData(
            processDefinition.getId(), generateBusinessKey(), formData);

I tested with always the same process definition and always the same content in formData but the initiator is sometimes null and sometimes ok.

Do you have an idea?