Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ThorbenLindhauer opened this issue May 18, 2020 · 9 comments
Labels
type:feature Issues that add a new user feature to the project.

Comments

@ThorbenLindhauer
Copy link
Member

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

  • Offer a query to fetch a process instance with defined variables attached to the process instance
  • Avoid additional queries for each fetched process instance when specific variables are needed 

Links:

@ThorbenLindhauer
Copy link
Member Author

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
Copy link
Contributor

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
Copy link
Member

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
Copy link
Contributor

@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
Copy link
Member

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
Copy link
Contributor

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
Copy link
Contributor

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

Thanks and Regards,
Nandan Shenoy

@yanavasileva
Copy link
Member

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

  • the variables should be return only if a request parameter/flag is passed such as withVariablesInReturn in start process instance endpoint. Otherwise, users that don't want to fetch the variables might suffer delays in fetching the results.
  • in REST API, VariableValueDto.fromMap(variables, true); should be used to serialize the variables correctly.
    • potentially, we can reuse org.camunda.bpm.engine.rest.dto.runtime.ProcessInstanceWithVariablesDto for that purpose.

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Issues that add a new user feature to the project.
Projects
None yet
Development

No branches or pull requests

3 participants