Form uploaded via REST api is not getting loaded in tasklist


I deployed a bpmn file along with a form using REST api.

Here is my code.

File file = new File("C:\\Users\\prasad\\Desktop\\camunda-get-started-Step-4\\src\\main\\resources\\loan-approval.bpmn");
        FileSystemResource bpmnFileResource = new FileSystemResource(file);
        File formFile = new File("C:\\Users\\prasad\\Desktop\\camunda-get-started-Step-4\\src\\main\\webapp\\forms\\approve-loan.html");
        FileSystemResource formFileResource1 = new FileSystemResource(formFile);
        File formFile2 = new File("C:\\Users\\prasad\\Desktop\\camunda-get-started-Step-4\\src\\main\\webapp\\forms\\request-loan.html");
        FileSystemResource formFileResource2 = new FileSystemResource(formFile2);
        MultiValueMap<String, Object> parts = new LinkedMultiValueMap<String, Object>();
        parts.add("deployment-name", "loan-approval-form");
        parts.add("deployment-source","process application");
        parts.add("approve-loan.html", formFileResource1);
        parts.add("request-loan.html", formFileResource2);
        HttpHeaders headers = new HttpHeaders();
        HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<MultiValueMap<String, Object>>(parts, headers);
        ResponseEntity<DeploymentResponse> response =, HttpMethod.POST, request,DeploymentResponse.class);

The files are deployed successfully and I am getting the deployment Id as well as the resource Id for these items(bpmn files and fom files).

However while clicking on start process button in tasklist it shows only loading

Here is my bpmn file

<bpmn:process id="approve-loan" name="Loan Approval" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1" name="Loan Request Received" camunda:formKey="embedded:app:request-loan.html">
    <bpmn:sequenceFlow id="SequenceFlow_0c4zr6d" sourceRef="StartEvent_1" targetRef="UserTask_11fud4o" />
    <bpmn:userTask id="UserTask_11fud4o" name="Approve Loan" camunda:formKey="embedded:app:approve-loan.html" camunda:assignee="john">
    <bpmn:endEvent id="EndEvent_1i5bz86" name="Loan Request Approved">
    <bpmn:sequenceFlow id="SequenceFlow_1y4c0rn" sourceRef="UserTask_11fud4o" targetRef="EndEvent_1i5bz86" />

These are the REST calls I got from the tomcat log file. When I pasted in the browser I got the following response

  1. http://localhost:8080/engine-rest/engine/default/process-definition/approve-loan:1:70e10ed5-25b3-11e6-8eb8-386077505d14/startForm


  1. http://localhost:8080/camunda/api/engine/engine/default/process-definition/approve-loan:1:70e10ed5-25b3-11e6-8eb8-386077505d14/startForm


Does my process engine aware of the form registrations
I deployed along with the bpmn file ??? … therefore not able to resolve the context path to your form…How can I deploy these form files with REST API…please help me out

1 Like

Hi Prasad,

probably the problem is the wrong form key in the user task.
Please change the usertask formkey from:


into this:


Please test the change with the new version of camunda (7.5) and give us feedback.

Thank you and greetings,
Christopher Zell

1 Like

@Zelldon The docs use the /forms/ path in the form key. This an out of date doc? Or can we create folders through Rest Deployment?

I have tried this embedded:deployment:TEST_FORM.html

where the deployment shows like this:

I deployed it from code:
Resource[] resources = [
new ClassPathResource(‘bpmn-diagrams/EarlyPaymentProcess.bpmn’),
new ClassPathResource(‘bpmn-diagrams/PaymentBatchProcess.bpmn’),
new ClassPathResource(‘bpmn-diagrams/PrivateBankResponseProcess.bpmn’),
new ClassPathResource(‘bpmn-diagrams/TestProcessUI.bpmn’),
new ClassPathResource(‘forms/TEST_FORM.html’),

unfortunately, the task list isn’t able to load it here either:
" Form failure: Resource TEST_FORM.html not found in deployment"

Hi @pescador_bob,

I think, it should look like this: embedded:deployment:forms/TEST_FORM.html.

Could you try this out?


Yeah, actually, that’s what the documentation says. I’ve tried many
permutations, but unsuccessfully. Here are the permutations I have tried:

I am running with the cockpit and my app in separate jvms though, so maybe
that prevents this from working correctly. I have the cockpit running in
the cockpit docker image, and my app running in a separate jvm, but they
both share the same db.

@pescador_bob does it work if you upload the form through the rest API?

see the following for code example:

[image: pasted1]

It shows the form is deployed as a resource, but I just can’t quite access
it from the bpm.
[image: pasted2]

One noticeable difference is that it doesn’t show the name of the deployed
resource as forms/TEST_FORM.html, but TEST_FORM.html

All of the tries gave me this:
[image: pasted3]

interestingly enough, if I specify it like this:

then I see the expected:
[image: pasted4]

@pescador_bob Can you repost the images through the form? Images did not upload over email.

Thanks for your reply StephenOTT. I don’t really want to use the REST api right now as I have the engine embedded. Perhaps there is a better thread for me to post on though, since this thread is all about REST. Sorry that my images didn’t come through. That’s too bad. A picture is worth a thousand words, and that would be very handy!
Here is a second try with the pictures.

It shows the form is deployed as a resource, but I just can’t quite access
it from the bpm.

One noticeable difference is that it doesn’t show the name of the deployed
resource as forms/TEST_FORM.html, but TEST_FORM.html

All of the tries gave me this:

interestingly enough, if I use embedded:deployment:/Users/brent.fisher/work/intapi-payment-process-manager/server/build/resources/main/forms/TEST_FORM.html as the Form Key, then the form displays correctly:

I could be wrong… But if you are using embedded engine, i thought to call the forms was to use:


or possibly? embedded:app:forms/start-form.html

similar to:

but I am not using app, I am using a deployed form. However, here is an answer. If I deploy it like this:
new DefaultResourceLoader().getResource('forms/TEST_FORM.html'),

instead of this:

new ClassPathResource('forms/TEST_FORM.html')

then the deployment looks right and works:

I hope that might help someone.

Hi @pescador_bob,

The name of a deployment resource becomes the absolute file path if you deploy it via SpringProcessEngineConfiguration as a class path resource (see for the relevant code). We could change the auto-deployment behavior of class path resources to use the relative class path name only. However, I am a little bit reluctant to do that for reasons of backwards compatibility and breaking existing applications.

There are also plenty of workarounds: Do not deploy your processes via the auto-deployment function of SpringProcessEngineConfiguration, but for example via Java API (see RepositoryService#createDeployment), as part of a process application, or via REST API as @StephenOTT suggest. Let me know if you need help with that.


1 Like

This is Good to know info!! Thanks @thorben!

Note that I was able to get it to work using the spring defaultResourceLoader.