Task creating using flowable REST API

Hello, I want to create tasks through rest API (as mention in this doc : https://www.flowable.org/docs/userguide/index.html#_tasks ) in order to create the task , i am making the put request using : localhost:8080/flowable-rest/service/runtime/tasks/1 , but its giving me : Could not find a task with id ‘1’ .
Can anyone help with this

Hi,

I think you may be misunderstanding the API. Tasks are usually created by the engine as part of a process running, and then you can access details and modify the task through the API.

Cheers
Paul.

Hi Paul,
Thanks for reply, I am new to flowable, could you explain how we can configure task creation or how we create tasks? I have been creating tasks using the UI through this link : Instant Gratification with Flowable 6 | These are my principles ,
but i wanted to do the same through rest API without creating through UI . I am really confused. Please help me out.
Thanks in advance

Cheers
Shweta

Hi Shweta,

Through the UI you can create “ad hoc” tasks that aren’t connected with a process. I think the REST docs need updating, but you can see the API in the code.

Cheers
Paul.

Hi Paul,
Thanks for the quick reply. Could you answer one more thing, the UI on link : https://paulhh.wordpress.com/2017/01/31/flowable-6-instant-gratification
and API on link : https://www.flowable.org/docs/userguide/index.html
aren’t related ? I mean to say creating a process or task on UI will not create a task in the REST Api ? Is my understanding right.

Thanks and regards
Shweta

Hi Sweta,

I’m not sure I understand the question, but the UI in the blog uses the REST API documented (although there may be some omissions where the documentation needs updating).

Regards
Paul.

Hi Paul,
Let me put it simply. What I am doing is , creating task through UI and then trying to find the same task through API hitting : GET localhost:8080/flowable-rest/service/runtime/tasks
Its not giving me task I created through API.
Similarly , whatever tasks i created hitting : POST localhost:8080/flowable-rest/service/runtime/tasks,
I cant see those tasks on UI. So my question is UI and Rest API dont have same database or are not connected to each other so that changes done on one (either UI or through API) gets reflected on the other. Hope I am clear now

Thanks and regards
Shweta

No, out of the box both the task app and the rest app have their own in-memory database, they won’t see data of each other. Change the db properties to point at the same database and that will be possible.