Initiator is null via Tasklist and REST API

Hello,

i am using the camunda tomcat pre-packed distribution and i have a problem with getting the initiator of a process.

I defined the initiator in my start event as the variable initiator and in my user task i assign the task to this variable, just like that.

<startEvent camunda:initiator=“initiator” … />

<userTask camunda:assignee="${initiator}" … />

So when i start the process instance via tasklist i see the variable as instance variable but the type is null and the value is null too.

I read in the docs and this forum that it is only neccessary to activate the atuhentication when you are not using tasklist or REST API. Is this correct?
If it is correct i do not know why the initiator variable is null.

Even if i try to get the startUserId via REST call it returns null.

Hope someone can help me. If you need further information please let me know.

How are you starting your process? If you are using the task list, initiator and startUserId should be set. If you’re using the REST API, you’ll need to enable authentication. If you’re using the Java API, you’ll need to set the user on the identity service. More info here.

2 Likes

Thank you for your reply. I start the process using the REST API.
I enabled the authentication as it is described in this article:
Configure Authentication
I could not activate the servlet filter, because it wasnt in the web.xml. So I added the servlet filter.

The Http Authentication works fine, but when i want to start a process and open the external form, i get the error message " Form failure: The context path is either empty or not defined." now.
Without the http Authentication it works fine.

Do i have to do something more to open the external form? Can you help me with this?

Here is my web.xml file:
web.xml (169.1 KB)

I’m not sure how authentication would effect that. It sounds like the form wasn’t specified correctly or the form wasn’t deployed with the process quite right.

Can you provide some additional info about your process and how you’re deploying it with your forms?

Hi,

sure.
Here is a how i specifiy the external form in Camunda Modeler:
image

The start-invoice.html and javascript files are in src/main/webapp/forms of my maven project.
The process model is in src/main/resources.

To deploy it i generate a .war file with maven install and copy that to $CAMUNDA_HOME/server/apache-tomcat/webapps.

This all works fine, when authentication in the web.xml file is deactivated.

Do you have any idea what can cause this issue?
Do you need more information?

I tried to change the category of this topic to Process Engine, as it seems to belong there, but is isnt possible for me.

Thank your for your help!

I’ll take a closer look because it just doesn’t add up that disabling authentication would make that suddenly work :thinking:
In the meantime, can you try embedded:app:forms/start-invoice.html for your form key? Going off these docs, for reference.

Hey, i tried it and this doesnt work too.

I saw that even the default process “Invoice Receipt” cannot be started either.

The only process i can start is a process without any formkey.

Let’s backup a bit. Since you’re just turning on authentication for the REST API, you need to add the servlet filter to the web.xml in $CAMUNDA_HOME/server/apache-tomcat/webapps/engine-rest/WEB-INF. The web.xml you posted looks like the top level one from $CAMUNDA_HOME/server/apache-tomcat/conf. Give that a try. Make sure you can still login to the tasklist via the Camunda login page and that a rest call to something like http://localhost:8080/engine-rest/process-definition only succeeds with basic auth credentials.

1 Like

Wow dumb me.

Thank you very much. This was the problem… cant believe i mixed up the files…

Now everything works as it should.

1 Like