Start process using rest api

222 views
Skip to first unread message

Musk

unread,
Sep 10, 2018, 6:46:57 AM9/10/18
to jBPM Usage
Hi,

I am new to jbpm. I have created one business process consisting of some human tasks and business rule tasks with few guided rules and data objects. I have deployed it on the execution server.
Now I want to start process instance using rest api. would anyone please tell me what will be the url. what headers will I have to set. and what is the format of body?
I want everything(create process instance, complete human task) to be done using rest api. is it possible?

Thanks

Maciej Swiderski

unread,
Sep 10, 2018, 9:57:20 AM9/10/18
to Musk, jBPM Usage
Have a loo at this article that introduces you to kie server http://mswiderski.blogspot.com/2015/09/unified-kie-execution-server-part-1.html

Feel free to go over next ones as well. Then look at http://localhost:8080/kie-server/docs on your running environment to look at complete REST api docs that should give you all the information you need.

Maciej

--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/b4ad1330-d24a-4ce4-9db8-516073ea58dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Musk

unread,
Sep 12, 2018, 2:22:20 AM9/12/18
to jBPM Usage
Thanks Maciej,

I have two doubts.

1. How to perform human task in a business process using rest api? Human task need some variables too.
2. How to get all the data objects using rest api? I know how to do it in Business rule engine. I don't know how to get when using data objects along with business process.

Would you please provide the solution for these.

Maciej Swiderski

unread,
Sep 12, 2018, 5:22:08 AM9/12/18
to Musk, jBPM Usage

On 12 Sep 2018, at 08:22, Musk <yadavi...@gmail.com> wrote:

Thanks Maciej,

I have two doubts.

1. How to perform human task in a business process using rest api? Human task need some variables too.
See the REST docs (swagger) for details but the entire task life cycle including variables is there

2. How to get all the data objects using rest api? I know how to do it in Business rule engine. I don't know how to get when using data objects along with business process.
You need to be more specific what you’re trying to do. You can get access to process variables from REST api 

Maciej

Would you please provide the solution for these.

On Monday, September 10, 2018 at 4:16:57 PM UTC+5:30, Musk wrote:
Hi,

I am new to jbpm. I have created one business process consisting of some human tasks and business rule tasks with few guided rules and data objects. I have deployed it on the execution server.
Now I want to start process instance using rest api. would anyone please tell me what will be the url. what headers will I have to set. and what is the format of body?
I want everything(create process instance, complete human task) to be done using rest api. is it possible?

Thanks

--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
Message has been deleted

Maciej Swiderski

unread,
Sep 12, 2018, 9:04:21 AM9/12/18
to Musk, jBPM Usage
You need to first claim and start the task if the task is assigned to a group. Alternatively you can use auto-progress feature on complete endpoint

/server/containers/{id}/tasks/{tInstanceId}/states/completed?auto-progress=true

Maciej

On 12 Sep 2018, at 14:58, Musk <yadavi...@gmail.com> wrote:

Thanks once again,

One more doubt please.

I am sending put request to /server/containers/{id}/tasks/{tInstanceId}/states/completed to perform a human task.
Now task is assigned to group "HR".
I am getting following error

"User '[UserImpl:'krisv']' was unable to execute operation 'Complete' on task id 2 due to a no 'current status' match"

I have tried with user name mary, which has roles HR.
So would you please tell me what am I doing wrong?


--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.

Musk

unread,
Sep 12, 2018, 9:10:15 AM9/12/18
to jBPM Usage
Thanks once again,

One more doubt please.

I am sending put request to /server/containers/{id}/tasks/{tInstanceId}/states/completed to perform a human task.
Now task is assigned to group "HR".
I am getting following error

"User '[UserImpl:'krisv']' was unable to execute operation 'Complete' on task id 2 due to a no 'current status' match"

I have tried with user name mary, which has roles HR.
So would you please tell me what am I doing wrong?

In one of the post I have read that this error comes when task is not inprogess state.
but the diagram show it's inprogress state.
I have attached the diagram.

On Monday, September 10, 2018 at 4:16:57 PM UTC+5:30, Musk wrote:

Musk

unread,
Sep 12, 2018, 9:14:57 AM9/12/18
to jBPM Usage
setting autoprogess=true didn't work.Still getting the same error.
this is what I am doing

curl -X PUT "http://localhost:8080/kie-server/services/rest/server/containers/evaluation_1.0.0-SNAPSHOT/tasks/2/states/completed?auto-progress=true" -H  "accept: application/xml" -H  "content-type: application/json" -d "{\"reason\":\"hr evaluaution\",\"performance\":7}"

and error I am getting is
"User '[UserImpl:'krisv']' was unable to execute operation 'Complete' on task id 2 due to a no 'current status' match"

I have attached both diagram and log screen shots.

On Monday, September 10, 2018 at 4:16:57 PM UTC+5:30, Musk wrote:
task.png
task_log.png

Musk

unread,
Sep 12, 2018, 9:34:17 AM9/12/18
to jBPM Usage
Moreover I am getting following error when claiming the task

"User '[UserImpl:'krisv']' was unable to execute operation 'Claim' on task id 2 due to a no 'current status' match"

I used following
curl -X PUT "http://localhost:8080/kie-server/services/rest/server/containers/evaluation_1.0.0-SNAPSHOT/tasks/2/states/claimed" -H "accept: application/xml"

On Monday, September 10, 2018 at 4:16:57 PM UTC+5:30, Musk wrote:

Clinton Gomes

unread,
May 21, 2020, 3:52:34 PM5/21/20
to jBPM Usage
Task status has to be 'Ready' before it can be claimed
Reply all
Reply to author
Forward
0 new messages