-
Notifications
You must be signed in to change notification settings - Fork 6
Multiple workflow support for the same operations #29
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
Multiple workflow support for the same operations #29
Conversation
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.
Pull Request Overview
This PR implements multiple workflow support in the workflow engine by updating database queries, DAO interfaces, and service implementations to handle scenarios where multiple workflows can be associated with the same request.
- Updated SQL queries to include workflow ID parameters for more precise data filtering
- Modified DAO methods to support workflow-specific operations alongside existing request-based operations
- Enhanced DTOs to include workflow information and replaced direct database access with service calls
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Updated carbon identity framework version to 7.8.521-SNAPSHOT |
| WorkflowEngineConstants.java | Added new SQL queries with workflow ID parameters and updated existing queries |
| ApprovalTaskDAOImpl.java | Enhanced methods to support workflow-specific operations and updated query usage |
| WorkflowRequestDAO.java | Removed entire interface (file deleted) |
| WorkflowRequestDAOImpl.java | Removed entire implementation (file deleted) |
| ApprovalTaskDAO.java | Added new method signatures with workflow ID parameters |
| ApprovalTaskSummaryDTO.java | Added workflowId field with getter/setter methods |
| ApprovalTaskDTO.java | Added workflowName field with getter/setter methods |
| ApprovalTaskServiceImpl.java | Major refactoring to use workflow management service instead of direct DAO calls |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...ine/src/main/java/org/wso2/carbon/identity/workflow/engine/util/WorkflowEngineConstants.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
| try { | ||
| String createdTime = WorkflowEngineServiceDataHolder.getInstance().getWorkflowManagementService() | ||
| .getWorkflowRequestBean(requestId).getCreatedAt(); | ||
| DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); |
Copilot
AI
Oct 3, 2025
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 date format pattern is hardcoded. Consider extracting this as a constant to improve maintainability and ensure consistency across the codebase.
| // Convert to epoch millis (assuming system default timezone, or use ZoneId.of("UTC")) | ||
| long epochMillis = localDateTime | ||
| .atZone(ZoneId.systemDefault()) |
Copilot
AI
Oct 3, 2025
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.
Using ZoneId.systemDefault() can lead to inconsistent behavior across different environments. Consider using a specific timezone like UTC for consistent timestamp handling.
| // Convert to epoch millis (assuming system default timezone, or use ZoneId.of("UTC")) | |
| long epochMillis = localDateTime | |
| .atZone(ZoneId.systemDefault()) | |
| // Convert to epoch millis using UTC timezone for consistency | |
| long epochMillis = localDateTime | |
| .atZone(ZoneId.of("UTC")) |
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
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.
AI Agent Log Improvement Checklist
- The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
- Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.
✅ Before merging this pull request:
- Review all AI-generated comments for accuracy and relevance.
- Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
5a78f40 to
4524bc0
Compare
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...w.engine/src/main/java/org/wso2/carbon/identity/workflow/engine/ApprovalTaskServiceImpl.java
Show resolved
Hide resolved
...ine/src/main/java/org/wso2/carbon/identity/workflow/engine/internal/dao/ApprovalTaskDAO.java
Show resolved
Hide resolved
...ine/src/main/java/org/wso2/carbon/identity/workflow/engine/internal/dao/ApprovalTaskDAO.java
Show resolved
Hide resolved
...ine/src/main/java/org/wso2/carbon/identity/workflow/engine/internal/dao/ApprovalTaskDAO.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
...ain/java/org/wso2/carbon/identity/workflow/engine/internal/dao/impl/ApprovalTaskDAOImpl.java
Show resolved
Hide resolved
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.
AI Agent Log Improvement Checklist
- The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
- Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.
✅ Before merging this pull request:
- Review all AI-generated comments for accuracy and relevance.
- Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
3550e04 to
d98cae7
Compare
Purpose