-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature/git issue #4487 fetch task variables feature #4754
base: master
Are you sure you want to change the base?
Feature/git issue #4487 fetch task variables feature #4754
Conversation
@yanavasileva : This PR has code changes for all the APIs and test cases. Open API spec is not yet done from my end. Will be updating in few days time. Meanwhile I need input on the current commit/checkpoint. Thank you!! |
Hi @prakashpalanisamy, Thanks |
@venetrius I have updated the PR with few commits few days back. Please have a look when you get time. Please let me know of your comments/inputs. Thank you!! |
Hi @prakashpalanisamy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi .prajwolbhandari1. @prakashpalanisamy
I have added a few questions / suggestions
@@ -1063,7 +1063,6 @@ public static MockTaskBuilder mockTask() { | |||
.camundaFormRef(EXAMPLE_FORM_KEY, EXAMPLE_FORM_REF_BINDING, EXAMPLE_FORM_REF_VERSION) | |||
.tenantId(EXAMPLE_TENANT_ID) | |||
.taskState(EXAMPLE_HISTORIC_TASK_STATE) | |||
.tenantId(EXAMPLE_TENANT_ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this line removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tenantId is duplicate and hence was removed. This was used in some of my related tests, So I removed this line item. Hope thats okay.
List<TaskDto> tasks = new ArrayList<TaskDto>(); | ||
for (Task task : matchingTasks) { | ||
VariableMap taskVariables; | ||
if (withTaskVariablesInReturn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop can introduce 2 extra DB query per task instance. One to get Variables and one for the Comments.
Did you consider if you could do it with fewer DB calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @venetrius , Here one call is being made for each task in the loop - either taskVars or taskLocalVars. The comments and attachment info is already obtained and just used to populate the DTO accordingly. Please let me know your thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@venetrius , I understand that there is a DB call made to get the comment and attachment info additional to getAllTask, while getting the list of tasks (matchingTasks). I understand in the above loop, one additional call is being made to get either taskVariables or taskLocalVariables to be added to the response. OpenAPI documentation is updated with exercising caution while using the comment/attachment request. Do you think its apt to add another cautionary note in the documentation for the variablesInReturn query as well? Please provide your thoughts and direction on how to proceed further.
List<TaskDto> tasks = new ArrayList<TaskDto>(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 104 - 115 seems unececcerly complicated. I think this would mean the same:
boolean withTaskVars = Boolean.TRUE.equals(queryDto.getWithTaskVariablesInReturn());
boolean withTaskLocalVars = Boolean.TRUE.equals(queryDto.getWithTaskLocalVariablesInReturn());
boolean withCommentInfo = Boolean.TRUE.equals(queryDto.getWithCommentAttachmentInfo());
if (withTaskVars || withTaskLocalVars){
return getVariablesForTasks(engine, matchingTasks, withTaskVars, withCommentInfo);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@venetrius I agree with your comments. Ill push the updates shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have pushed the changes. Can you please take a look?
@venetrius , I believe it was directed to me. I will take a look at your comments. Thanks! |
Yes you are correct, sorry. |
This PR has code changes for all the APIs and test cases. Open API spec is not yet done from my end. Will be updating in few days time. Meanwhile I need input on the current commit/checkpoint. Thank you!!
Related to: #4487