cancel
Showing results for 
Search instead for 
Did you mean: 

REST-API: Deploy and Run a process

esseti
Champ in-the-making
Champ in-the-making
Hi all,
i've a python/django app that interact with the activitiy engine.
I'm able to deploy a  process, but i've trouble in running it.
i go step by step.

when i do the deployment i've this back
[javascript]
{
  "id":"3436",
  "name":"Sysout.bpmn",
  "deploymentTime":"2013-06-06T16:24:06CEST",
  "category":null
}
[/javascript]

now, what information do i've to send to the /process-instance to make this process running?
do i've to parse the BPMN file in order to extract the key?
or is it the id the one i've back from the deployment (if not, why the information is not in the response of the call)?

just for the record, if i check the /process-definitons i've back

[javascript]
{
    "data": [
        {
            "id": "helloworld2:1:4",
            "key": "helloworld2",
            "name": "helloworld2",
            "version": 1,
            "deploymentId": "1",
            "resourceName": "Sysout.bpmn",
            "diagramResourceName": "Sysout.helloworld2.png",
            "startFormResourceKey": null,
            "category": "http://www.activiti.org/test",
            "graphicNotationDefined": true
        }
    ],
    "total": 1,
    "start": 0,
    "sort": "id",
    "order": "asc",
    "size": 1
}
[/javascript]

PS: APIs generally reply a JSON when call is correct and an HTML page when something goes wrong. is there a way to have JSON answers also in the error case (it will make everything easier to manage).
6 REPLIES 6

eao
Champ in-the-making
Champ in-the-making
Hi, the service for starting a new process instance is documented here:
http://www.activiti.org/userguide/#N12CEC

Request: POST /process-instance
<code>
{
  "processDefinitionId":"helloworld2:1:4",
  "businessKey":"order-4711"
}
</code>

will probably to the trick

esseti
Champ in-the-making
Champ in-the-making
i tried it via postman (extension for chrome) and does not work if i use the parameters while it works if i use raw data.
and btw it seems too an overenigneering the need to have the numbers such as :1:4 for starting the process.
this measn that i've to call the api to deploy, then do a search and find out what's the process that i JUST upload and retrive the id. why is not the id already in the response of the deployment?

just found that it's possible to use "processDefinitionKey" (which can be infeer from the model). yet, it still seems to me not a smart way to get informations.

for the record: now i've problems with "Can't find scripting engine for 'groovy'" which has some threads in the forum.

trademak
Star Contributor
Star Contributor
Right, you can use the processDefinitionKey, which seems to suited for your requirements.
Can't find scripting engine for 'Groovy' points to missing the groovy-all.jar file on your classpath.

Best regards,

akotako
Champ in-the-making
Champ in-the-making
hi i could not start the process via soap ui also and i used vacation request on activiti 5.14 demo process.But when i used soap it looked like everything is ok.in fact when i opened the activiti-explorer interface there is no process instance that began.Please help…

thanks

frederikherema1
Star Contributor
Star Contributor
What HTTP-call are you actually doing to start the process-instance (please show full URL and raw body)?

mdnoorshid
Champ in-the-making
Champ in-the-making
Hi can you say how you have deployed,Please explain using  <b>full url and raw body</b>