Skip to content

Conversation

@sadilchamishka
Copy link
Contributor

@sadilchamishka sadilchamishka commented Aug 17, 2025

Purpose

For multi step approval tasks, when the first step is approved, and the second step has to be approved by the same user (Ideally shouldn't happen), as the same workflow request is corresponds to both approval tasks, only one (first approved task) will be shown where the next ready approval task is not filtered when filter without status.
If filter by ready state, the ready state approval task will be shown.

The above mentioned case is fixed by this PR.

Related Issues

Copilot AI review requested due to automatic review settings August 17, 2025 05:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue in multi-step approval processes where only the first approved task was shown when the same user needs to approve multiple steps of the same workflow request. The fix ensures that subsequent tasks in READY or RESERVED states are also displayed alongside approved tasks.

  • Added APPROVED status to the TaskStatus enum with proper documentation
  • Modified the duplicate filtering logic to preserve subsequent approval tasks for the same workflow request
  • Renamed variable for better clarity and added logic to handle APPROVED status differently

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
WorkflowEngineConstants.java Added APPROVED status to TaskStatus enum and improved documentation for all statuses
ApprovalTaskServiceImpl.java Modified filtering logic to handle multi-step approvals and renamed variable for clarity

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/17017874322

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/17017874322
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

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

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/17017874322

@sadilchamishka sadilchamishka merged commit 96eed1c into wso2-extensions:main Aug 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants