apache / incubator-kie-kogito-runtimes

Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
540 stars 209 forks source link

Allow to identify task by name (or unique ID known at design time) in task management API #2536

Open tokarenko opened 2 years ago

tokarenko commented 2 years ago

Description

Task management API requires to know task instance ID in addition to a task name (that is also an identifier): http://host:port/process name/process instance ID/task name/task instance ID

Getting task instance ID requires parsing JSON returned by HTTP-request to http://host:port/process name/process instance ID/tasks. This complicates task management interface with Kogito. Especially for systems that do not have mature automation capabilities.

I suggest to allow identification of tasks by name (or unique ID known at design time) in task management API. This will allow to integrate much easier with other systems.

Is there any workaround to implement custom REST endpoint for such identification?

Implementation ideas

No response

fjtirado commented 2 years ago

@tokarenko The interface is designed to support multiple task instance of the same task type (task name is not a good naming choice, it is in fact the task type) What you are requesting is basically the possibility of assigning a unique ID for every task at design time, so Kogito rather than automatically creating an identifier for the task, use the one specified at design time. @krisv what do you think? As a workaround, parsing the JSON should not be such a problem (that's the current assumption made by us when designing the API :)). Whats the issue? the nested path?

tokarenko commented 2 years ago

Thank you for your quick reply. I am trying to integrate with Jira having limited out-of-box capabilities (web hooks): it can send HTTP-request but not more than that.

tokarenko commented 2 years ago

@fjtirado , could you advice as a workaround how to get task instance ID by task name using KogitoProcessContext? I am going to return the ID to Jira in HTTP-reply as a process variable when process starts.