camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.11k stars 1.55k forks source link

When quering process instances, I want to have the option to fetch variables attached to the process instance #2334

Open ThorbenLindhauer opened 4 years ago

ThorbenLindhauer commented 4 years ago

This issue was imported from JIRA:

Field Value
JIRA Link CAM-11930
Reporter NYBzR2x
What is this name? This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.
Has restricted visibility comments false

User story

As a developer, I want to have the option to define variables that should be fetched with process instances, so that I do not have to run separate queries.

Background / problem

When having X open user tasks, it takes 3X REST requests to get the variables needed to evaluate and prioritize these user tasks.

i.e. Getting the variables for 100k user tasks currently requires 300k REST requests to get the variables of interest, which is taking a lot of time and strains the system severely.

Customer hint:

if the rest/tast/get-query/ also allowed to choose variable types and variables of interest all the 300K REST requests could be reduced to 1 REST request

AC

Links:

ThorbenLindhauer commented 4 years ago

This comment was imported from JIRA and written by user wxKQw7Y

What is this name? This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.


The outlined feature would be very useful to speed up some important workflows considerably. Thanks for considering this new feature.

Nandanrshenoy commented 3 months ago

Hi @ThorbenLindhauer , I wish to work on this enhancement but before I get involved, I need some clarity on few of my queries.

Are you suggesting that you wish to enhance the Get Task List API (Both Post and Get methods) and Get Task API to include Task related variables in its response If yes, then I see similar issue also exists with the Get Process List API (Both Post and Get methods) and Get Process API to include process related Variables in its response. Kindly let me know this issue that you have raised relates to which of the above two requirements. Your inputs will help me understand this issue better. Thanks.

Regards, Nandan Shenoy

yanavasileva commented 3 months ago

Hi @Nandanrshenoy,

The ticket is supposed to capture both APIs for task and process variables. Unfortunately, that's not clear from the title and the description. Potentially, the request can be split in two tickets but it might be fine to have just this one.

Best, Yana

Nandanrshenoy commented 3 months ago

@yanavasileva, I will create one ticket to enhance the Get Task List API (Both Post and Get methods) and Get Task API to include Task related variables in its response and a separate ticket to update Get Process List API (Both Post and Get methods) and Get Process API to include process related Variables in its response. This will allow us to have clear distinction's against AC criteria's. With this ticket I will handle the latter part and create a separate ticket for task API's.Hope your fine with this approach.

Thanks and Regards, Nandan Shenoy

yanavasileva commented 3 months ago

This will allow us to have clear distinction's against AC criteria's. With this ticket I will handle the latter part and create a separate ticket for task API's.Hope your fine with this approach.

@Nandanrshenoy Yes, that will be fine.

Nandanrshenoy commented 3 months ago

Hi @yanavasileva, I did some analysis on the Get Process instance and Get Process Instgance List API's(Post and Get) to return the variable list. Below I am providing high level details about my analysis.There are some interfaces I am not sharing here who had to be updated as well.Requesting your inputs on the same.

ProcessInstanceDto was updated to accommodate a place holder for the variable list.

image

For single instance ProcessInstanceResourceImpl--> getProcessInstance()

image

ProcessInstanceRestServiceImpl--> getProcessInstances( UriInfo uriInfo, Integer firstResult, Integer maxResults)

image

This is how the updated API responses are looking after these updates. Get Single Process instance :

image

Post Method -Get process Instance List :

image

Get Method : Get Process Instance List

image
Nandanrshenoy commented 3 months ago

@yanavasileva, Could you please help us with your inputs on the above proposed changes.

Thanks and Regards, Nandan Shenoy

yanavasileva commented 3 months ago

@Nandanrshenoy, some parts look ok but there are missing aspects, for example:

Below I am providing high level details about my analysis.There are some interfaces I am not sharing here who had to be updated as well.Requesting your inputs on the same.

I can't quite follow, I am not sure what other input I should provide.

Nandanrshenoy commented 3 months ago

@yanavasileva,Thanks for your inputs. Will try to incorporate the same.