Update Case and Activity after successful PUT state not changing

1
0
-1

Hello,

I am using rest API and I have a problem changing the state of case and activity. Also, I am in need of information or code snippet on how to claim the task on JavaScript.

I use Living Application example but not able to claim the Human task, Query Activity, and Case State after the update,

For now, I just can make the activity Completed, but when I try another state, the response gives 200 but state activity remains on executing. Please clear me what is the difference between this state executing and state that I want to assign.

How to query those activity states and see what is it updated

2 answers

1
+1
-1
This one is the BEST answer!

Hi,

Bonita provides some REST API's to read and update activities
-> https://documentation.bonitasoft.com/bonita/7.11/bpm-api#toc0

The REST API to use is always /API/bpm/activity/:id

Perform a GET to read the state of an activity, and put to update it.

For human tasks, it is almost the same but with thew API /API/bpm/humanTask/:taskId
Keep in mind that if you'll have to pass the contract to the API payload to update it.

regards,
Adrien

Comments

Submitted by burimameti2001_... on Mon, 04/13/2020 - 16:01

you saying to execute this order of calls

1.Login service post

2.Session Get

3.Activitity state Get

4. Activity state PUT

Correct me if I am wrong

For the human task, I have a contract with persistence id and bool true false if the task is done or not

How to claim the task from the case and then execute this contract make it done

Thanks, Burim

Submitted by adrien.lachambre on Mon, 04/13/2020 - 16:25

I re checked the documentation to be sure, so here is what you have to do to assign and then execute a task.
It seems that it's better to use the REST API userTask to send a contract, I forgot that in my previous answer, sorry.

1 - assign

  • URL
    /API/bpm/userTask/:userTaskId
  • Method
    PUT
  • Request Payload
    {
      "assigned_id" : "id of new user"
    }

2 - execute

  • URL
    /API/bpm/userTask/:userTaskId/execution
  • Method
    POST
  • Request Payload
    A JSON object matching task contract. Execute a task providing correct contract values.
    {  
      "ticket_comment":"This is a comment"
    }

1
0
-1
Notifications