Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Feature/git issue #4487 fetch task variables feature#4754

Closed
prakashpalanisamy wants to merge 11 commits intocamunda:masterfrom
fidelity-contributions:feature/git-issue-4487-fetch-task-variables-feature
Closed

Feature/git issue #4487 fetch task variables feature#4754
prakashpalanisamy wants to merge 11 commits intocamunda:masterfrom
fidelity-contributions:feature/git-issue-4487-fetch-task-variables-feature

Conversation

@prakashpalanisamy
Copy link
Copy Markdown
Contributor

@prakashpalanisamy prakashpalanisamy commented Oct 31, 2024

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

@prakashpalanisamy
Copy link
Copy Markdown
Contributor Author

@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!!

@venetrius
Copy link
Copy Markdown
Member

Hi @prakashpalanisamy,
Thank you for creating this PR, I will review it and give you a feedback on the current commit as soon is I can.

Thanks

@prakashpalanisamy
Copy link
Copy Markdown
Contributor Author

@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!!

@venetrius
Copy link
Copy Markdown
Member

Hi @prakashpalanisamy,
I did not have the time to look at your PR yet.
I have blocked out some time next week to be able to add some feedback, but probably I won't have time to review the whole PR.

Copy link
Copy Markdown
Member

@venetrius venetrius left a 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

.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)
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Contributor Author

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) {
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor Author

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<Task> matchingTasks = executeTaskQuery(firstResult, maxResults, query);

List<TaskDto> tasks = new ArrayList<TaskDto>();

Copy link
Copy Markdown
Member

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);
    }

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor Author

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?

@prakashpalanisamy
Copy link
Copy Markdown
Contributor Author

Hi @prajwolbhandari1 I have added a few questions / suggestions

@venetrius , I believe it was directed to me. I will take a look at your comments. Thanks!

@venetrius
Copy link
Copy Markdown
Member

@venetrius , I believe it was directed to me. I will take a look at your comments. Thanks!

Yes you are correct, sorry.

@prakashpalanisamy
Copy link
Copy Markdown
Contributor Author

@venetrius Whenever you get time, can you please take a look at my response and provide your inputs/directions. Thanks!

@venetrius
Copy link
Copy Markdown
Member

Hi @prakashpalanisamy
I was not able to get back to you this week, I will try to do it within the next 2 weeks.

@venetrius
Copy link
Copy Markdown
Member

Hi @prakashpalanisamy
I was not able to get back to you this week, I will try to do it within the next 2 weeks.

@prakashpalanisamy
Copy link
Copy Markdown
Contributor Author

No problem @venetrius . Please take your time 🙂

Copy link
Copy Markdown
Member

@venetrius venetrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Thanks for considering my recommendations.
Could you rebase from master afterwards I will run the CI again and it should be ready to go.

@venetrius
Copy link
Copy Markdown
Member

@prakashpalanisamy
I merged changes via #5274 to speed up the process.

@venetrius venetrius closed this Jul 24, 2025
@prakashpalanisamy
Copy link
Copy Markdown
Contributor Author

Thank you @venetrius

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants