Camunda REST API - Start process on spring boot

Hi

I am having trouble starting a process from postman. Are using the following URL:

http://localhost:8080/rest/engine/default/process-definition/Casework/start

The name of the process is Casework. And I have this json object:

{
“messageName” : “Casework”,
“businessKey” : “1”,
“processVariables” : {
“Identifier” : {“value” : “170322”, “type”: “String”},
“caseId” : {“value” : “4342”, “type”: “String”},
“callId” : {“value” : “323”, “type”: “String”}
}
}

But I only get this response:

{
“timestamp”: “2019-03-14T11:52:10.583+0000”,
“status”: 404,
“error”: “Not Found”,
“message”: “No message available”,
“path”: “/rest/engine/default/process-definition/Casework/start”
}

Does anyone see what i do wrong?

Hi @FrankReneSorensen,

my rest calls look like this:

http://localhost:8080/engine-rest/process-definition/key/myProcess/start

are you perhaps missing the endpoint “key” between “process-definition” and your process name?

Regards
Michael

@MichiDahm

Thanks for your response.

I changed to http://localhost:8080/rest/engine/process-definition/key/Casework/start
Also tried: http://localhost:8080/engine-rest/process-definition/key/Casework/start

(My bpmn diagram has ID: <bpmn:process id=“Casework” isExecutable=“true”>)

My json is:
{
“businessKey” : “1”,
“processVariables” : {
“norwegianIdentifier” : {“value” : “184392”, “type”: “String”},
“caseId” : {“value” : “4342”, “type”: “String”},
“callId” : {“value” : “323”, “type”: “String”}
}
}

Still the same response:

{
“timestamp”: “2019-03-14T12:41:04.981+0000”,
“status”: 404,
“error”: “Not Found”,
“message”: “No message available”,
“path”: “/rest/engine/process-definition/key/Casework/start”
}

It seems like the REST API is not running? Is there a way to control that it is running?

Br

Frank

Hi @FrankReneSorensen,

you can check pretty easy if the API is running.

Open your browser and type this as the url:

http://localhost:8080/engine-rest/process-definition/count/

This is a simple GET-Request that shows the number of your process-definitions

Regards
Michael

1 Like

If you’re using the Springboot distro the rest endpoint is

localhost:8080/rest/

If you’r using another distro the endpoint is:

localhost:8080/engine-rest/

So you just need to add your call to the end of one of the above depending on which you use

3 Likes

@Niall @MichiDahm

Hi. Then it is not running. These:
http://localhost:8089/rest/process-definition/count
http://localhost:8089/engine-rest/process-definition/count

(I use server port 8089. Are able to connect to cockpit and tasklist on that port)

Return
{
“timestamp”: “2019-03-14T22:35:18.680+0000”,
“status”: 404,
“error”: “Not Found”,
“message”: “No message available”,
“path”: “/engine-rest/process-definition/count”
}

How do I turn on the REST API?

Again, thank you so much for helping me.

@Niall @MichiDahm Seems like this did the trick. Adding dependency for Camunda rest:

<dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
            <version>3.2.0</version>
            <exclusions>
                <exclusion> 
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Thank you so much for your help!! :slight_smile:

Br

Frank

1 Like