Process Initiator - unknown property used in expression: ${initiator

Hi,

I use Wildfly 16, Camunda 7.10 with embedded html forms.
I set the process starter (“initiator”) in the start event and the first user task works fine. But when I try to complete the second usertask (Thesisdaten eingeben) I get the following error message:

**An error happened while submitting the task form** **:** Cannot submit task form c73e5815-7fa3-11ea-9dcb-00059a3c7a00: Unknown property used in expression: ${initiator}. Cause: Cannot resolve identifier 'initiator'

Here is the part of my process:

    <?xml version="1.0" encoding="UTF-8"?>

<bpmn:definitions xmlns:bpmn=“http://www.omg.org/spec/BPMN/20100524/MODEL” xmlns:bpmndi=“http://www.omg.org/spec/BPMN/20100524/DI” xmlns:di=“http://www.omg.org/spec/DD/20100524/DI” xmlns:dc=“http://www.omg.org/spec/DD/20100524/DC” xmlns:camunda=“http://camunda.org/schema/1.0/bpmn” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” id=“Definitions_0gq1v6q” targetNamespace=“http://bpmn.io/schema/bpmn” exporter=“Camunda Modeler” exporterVersion=“2.2.3”>
<bpmn:collaboration id=“Collaboration_06wrrk2”>
<bpmn:participant id=“Participant_1aa4pru” name=“Antrag auf Abschlussarbeit WK Html” processRef=“thesis_wk_html” />
</bpmn:collaboration>
<bpmn:process id=“thesis_wk_html” name="Abschlussarbeit Wirtschaftsinformatik " isExecutable=“true”>
<bpmn:laneSet id=“LaneSet_0ybdea4”>
<bpmn:lane id=“Lane_1gw4ead” name=“Student”>
bpmn:flowNodeRefusertask_stammdaten_eintrage</bpmn:flowNodeRef>
bpmn:flowNodeRefservicetask_stammdaten_speichern</bpmn:flowNodeRef>

    <bpmn:flowNodeRef>servicetask_thesisdaten_speichern</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>start_thesiswk_html</bpmn:flowNodeRef>
    <lowNodeRef>usertask_thesisdaten_eintragen</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>servicetask_erstbetreuer_speichern</bpmn:flowNodeRef>


</bpmn:lane>

</bpmn:laneSet>
<bpmn:sequenceFlow id="SequenceFlow_1nlae99" sourceRef="start_thesiswk_html" targetRef="usertask_stammdaten_eintrage" />
<bpmn:sequenceFlow id="SequenceFlow_00z1ivf" sourceRef="usertask_stammdaten_eintrage" targetRef="servicetask_stammdaten_speichern" />
<bpmn:sequenceFlow id="SequenceFlow_1fol5u0" sourceRef="servicetask_thesisdaten_speichern" targetRef="usertask_erstbetreuer_eingeben" />

<bpmn:startEvent id="start_thesiswk_html" name="Start" camunda:initiator="initiator">
  <bpmn:outgoing>SequenceFlow_1nlae99</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:userTask id="usertask_stammdaten_eintrage" name="Stammdaten eintragen" camunda:formKey="embedded:app:thesiswk_html/stammdaten_eintragen.html" camunda:assignee="${initiator}">
  <bpmn:incoming>SequenceFlow_1nlae99</bpmn:incoming>
  <bpmn:outgoing>SequenceFlow_00z1ivf</bpmn:outgoing>
</bpmn:userTask>
<bpmn:serviceTask id="servicetask_stammdaten_speichern" name="Stammdaten speichern" camunda:expression="${thesisWKHtmlBusinessLogic.persistMasterData(execution)}">
  <bpmn:incoming>SequenceFlow_00z1ivf</bpmn:incoming>
  <bpmn:outgoing>SequenceFlow_1fbwhv7</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_1fbwhv7" sourceRef="servicetask_stammdaten_speichern" targetRef="usertask_thesisdaten_eintragen" />

<bpmn:serviceTask id="servicetask_thesisdaten_speichern" name="ThesisDaten speichern" camunda:expression="${thesisWKHtmlBusinessLogic.persistThesisData(execution)}">
  <bpmn:incoming>SequenceFlow_0pkc9de</bpmn:incoming>
  <bpmn:outgoing>SequenceFlow_1fol5u0</bpmn:outgoing>
</bpmn:serviceTask>

<bpmn:userTask id="usertask_thesisdaten_eintragen" name="ThesisDaten eingeben" camunda:formKey="embedded:app:thesiswk_html/thesisdaten_eintragen.html" camunda:assignee="${initiator}">
  <bpmn:incoming>SequenceFlow_1fbwhv7</bpmn:incoming>
  <bpmn:outgoing>SequenceFlow_0pkc9de</bpmn:outgoing>
</bpmn:userTask>

Start Event:
grafik

Stammdaten eintragen:
grafik

Stammdaten speichern:
grafik

Thesisdaten eingeben:
grafik

Thesisdaten speichern
grafik

Any ideas what I am doing wrong?
Thanks a lot.
Nicole

Can you upload the model?

Here is my bpmn model:
thesis_wk_html.bpmn (14.7 KB)

How exactly are you starting the process?
are you sending in information about the user?

I use camunda tasklist. I start via “start process”.
grafik

In the startevent I set the initiator
grafik

I thought that I could use that variable in my whole process?

In my first usertask, it works. I set the assignee as “initiator”
grafik

Here is my EJB (as txt because I can not upload java files):
ThesisWKHtmlBusinessLogic.txt (7.9 KB)

Hi @NickiMueller,

I think the error “Cannot resolve identifier ‘initiator’” is thrown when token reaches the 3’rd user task “Erstbetreuer eintragen”.

It seems the reason is that there is a call in the previous service task which is “ThesisDaten speichern” to thesisWKHtmlBusinessLogic.persistThesisData(execution)

In which we have the following statement
delegateExecution.removeVariables(variables.keySet());

Which removes the “initiator” variable too.

2 Likes

Thanks for that @hassang - well spotted!

Thanks! Of course that is the solution.