REST-API: Deploy and Run a process

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2013 03:28 AM
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).
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).
Labels:
- Labels:
-
Archive
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2013 07:24 AM
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
http://www.activiti.org/userguide/#N12CEC
Request: POST /process-instance
<code>
{
"processDefinitionId":"helloworld2:1:4",
"businessKey":"order-4711"
}
</code>
will probably to the trick

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2013 07:53 AM
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.
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.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2013 10:22 AM
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,
Can't find scripting engine for 'Groovy' points to missing the groovy-all.jar file on your classpath.
Best regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2014 07:01 AM
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
thanks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2014 06:49 AM
What HTTP-call are you actually doing to start the process-instance (please show full URL and raw body)?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2016 07:39 AM
Hi can you say how you have deployed,Please explain using <b>full url and raw body</b>
