'process-definition/key/xx/start' does not work

I try to build first test diagram/process and publish it to the server.
I have no idea how to publish it from Modeler (did open another ticket yet no answer) so I try to use camunda REST.
OK, I sent file to the server using ‘deployment/create’ method. I got 200 response so I think it’s OK. I see the process on the server in ‘processes’ menu. So I try to run it using ‘process-definition/key/xx/start’ method. I got response:

{
    "links": [
        {
            "method": "GET",
            "href": "http://localhost:8080/engine-rest/process-instance/20a6efb9-8b14-11eb-a0d2-049226bdb658",
            "rel": "self"
        }
    ],
    "id": "20a6efb9-8b14-11eb-a0d2-049226bdb658",
    "definitionId": "xxx:2:d6e2b3e7-8a9a-11eb-9797-049226bdb658",
    "businessKey": null,
    "caseInstanceId": null,
    "ended": true,
    "suspended": false,
    "tenantId": null
}

…and response code 200. So all should be fine. But process is not running. So response is completely out of the point. When I use url that i have in the response I get message:
“Process instance with id 20a6efb9-8b14-11eb-a0d2-049226bdb658 does not exist”
If it does not exists why the answer was OK?
Camunda’s response are OK does not matter what it really is?

I see there are some bugs.
REST reports process as started but platform dashboard does not reflect this state. Looks like not started.
I entered modeler and did press "start current diagram’. This time process was started and If I I execute REST call again, this time server really start process - I see two instances running.

Hi @mkelton

Can you upload the model that you’re deploying and show exactly what you mean when you say:

What does it actually show and what are you expecting?

Thanks for the reply.
I’ve tried once more creating new process and this time it worked as I expected; I used ‘deployment/create’ method then ‘process-definition/key/approval-test-process/start’ and I could see the process running - ‘running activity instances: 1’.

So this display panel has some problems sometimes in some conditions.
But I see another problem.
I wanted to remove process definition. So first I deleted running instances using ‘process-instance’. OK, worked. Then I tried to remove process definition. Response was that command was executed but dashboard still did display this instance. I had to restart server and execute method again. This time definition was removed.

I did repeat this for another instance and this time… all worked fine :slight_smile:

I arrived to the point where I want to complete task.
After ‘deployment/create’ I executed ‘process-definition/key/approval-test-process/start’ with json body:

{
  "variables": {
    "dept" : {
        "value" : "marketing",
        "type": "String"
    },
    "author" : {
      "value" : true,
      "type": "Boolean"
    }
  }
}

I see these variables on server. Great.
But when I want to complete task with ‘task/4fcca16b-811c-11eb-9d1b-049226bdb658/complete’ I get response:

“message”: “Cannot complete task 4fcca16b-811c-11eb-9d1b-049226bdb658: Unknown property used in expression: ${approved}. Cause: Cannot resolve identifier ‘approved’”

I do not see any ‘approved’ word in my diagram.
I think I do not need to send again variables (were sent when process was started) but even so it’s still same. What’s the problem?

Anyway. I do not get one thing. Applications start a process (user did fill form and clicked ‘sent’). So I should receive process ID to be able to execute ‘complete task’. But I do not have it. If I list the task I could get several IDs so I do not know what is what.
How do you handle that?

Regards

approval-test-process.bpmn (6.3 KB)

I think I found the problem.
I used wrong parameter for method processDefinitionID instead of processDefinitionKey
The correct one to get task IDs is:
http://localhost:8080/engine-rest/task?processDefinitionKey=approval-test-process

But… that was not a problem for Camunda REST and I got list of tasks. Even if they were not attached to this process ID… even if such ID does not exists :slight_smile:
So I was using task ID from another process where such variable was not existing.
You definitively need some REST expert. REST cannot return some random values.

Same if I change GET to POST - in result I will receive wrong values(!).

Anyway. I do not get one thing. Applications start a process (user did fill form and clicked ‘sent’). So I should receive process ID to be able to execute ‘complete task’. But I do not have it. If I list the task I could get several IDs so I do not know what is what.
How do you handle that?