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

Implement workflow approvalService #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

IsharaSilva
Copy link

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email [email protected] to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to [email protected] and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.configuration.mgt.core</artifactId>
<version>5.18.187</version>

Choose a reason for hiding this comment

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

Add versions as properties

Copy link
Author

Choose a reason for hiding this comment

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

Addressed with this commit 42e8139

<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<version>${apache.felix.scr.ds.annotations.version}</version>
</dependency>

Choose a reason for hiding this comment

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

redundant blank line

Copy link
Author

Choose a reason for hiding this comment

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

Addressed with this commit 0f8bc6d


</dependencies>


Choose a reason for hiding this comment

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

redundant blank line. let's fix other places as well

Copy link
Author

@IsharaSilva IsharaSilva Jun 9, 2022

Choose a reason for hiding this comment

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

Addressed with this commit 0f8bc6d

</properties>


</project>

Choose a reason for hiding this comment

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

Add new line

Copy link
Author

Choose a reason for hiding this comment

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

Addressed with this commit 1efe729


import java.util.List;

public class DefaultApprovalWorkflow extends AbstractWorkflow {

Choose a reason for hiding this comment

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

Add class comments. Let's fix other places as well

Copy link
Author

@IsharaSilva IsharaSilva Jun 9, 2022

Choose a reason for hiding this comment

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

Addressed with this commit 0f8bc6d

public DefaultApprovalWorkflow(Class<? extends WorkFlowExecutor> workFlowExecutorClass, String metaDataXML)
throws WorkflowRuntimeException {

super(null, workFlowExecutorClass, metaDataXML);

Choose a reason for hiding this comment

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

Why are we passing a null here?

Copy link
Author

@IsharaSilva IsharaSilva Jun 9, 2022

Choose a reason for hiding this comment

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

Addressed with this commit 0f8bc6d

@Override
protected InputData getInputData(ParameterMetaData parameterMetaData) {

return null;

Choose a reason for hiding this comment

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

Let's return an instance of the InputData class here

Copy link
Author

@IsharaSilva IsharaSilva Jun 9, 2022

Choose a reason for hiding this comment

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

Addressed with this commit 0f8bc6d


public class DefaultWorkflowEventRequestService implements DefaultWorkflowEventRequest {

public void addApproversOfRequests(WorkflowRequest request, List<Parameter> parameterList) {

Choose a reason for hiding this comment

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

Add method comments to public methods

Copy link
Author

@IsharaSilva IsharaSilva Jun 9, 2022

Choose a reason for hiding this comment

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

Addressed with this commit 0f8bc6d

}
}
}
workflowEventRequestDAO.addApproversOfRequest(taskId, eventId, workflowId, approverType, approverName);

Choose a reason for hiding this comment

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

We need to add approvers if there are multiple approvers for a single step. Include this inside the for loop

Copy link
Author

Choose a reason for hiding this comment

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

Addresses with this commit 0f8bc6d

String[] approvers = approver.split(",");
if (approvers != null) {
List<String> approverList = Collections.singletonList(approver);
String stepValue = WorkflowEngineConstants.ParameterName.USER_AND_ROLE_STEP + "-step-" +

Choose a reason for hiding this comment

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

Let's use constants for pattern matching like "-step-"

Copy link
Author

@IsharaSilva IsharaSilva Jun 9, 2022

Choose a reason for hiding this comment

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

Addressed with this commit 0f8bc6d

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.2.0</version>
Copy link
Author

Choose a reason for hiding this comment

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

add property

Copy link
Author

@IsharaSilva IsharaSilva Aug 1, 2022

Choose a reason for hiding this comment

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

Addresses this issue from 032e778 of 2nd PR.

* @param request workflow request object.
* @param parameterList parameterList.
*/
void addApproversOfRequests(WorkflowRequest request, List<Parameter> parameterList);
Copy link
Author

Choose a reason for hiding this comment

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

rename methods.
Fix other places as well

Copy link
Author

@IsharaSilva IsharaSilva Aug 1, 2022

Choose a reason for hiding this comment

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

addressed these type of issues from 032e778 of 2nd PR.

InputData inputData = null;
if (parameterMetaData != null && parameterMetaData.getName() != null) {
String parameterName = parameterMetaData.getName();
if (BPS_PROFILE.equals(parameterName)) {
Copy link
Author

Choose a reason for hiding this comment

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

remove BPS profile

Copy link
Author

@IsharaSilva IsharaSilva Aug 1, 2022

Choose a reason for hiding this comment

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

addressed with commit 032e778 of 2nd PR.

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.2.0</version>
Copy link
Author

Choose a reason for hiding this comment

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

add property

Copy link
Author

@IsharaSilva IsharaSilva Aug 1, 2022

Choose a reason for hiding this comment

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

addressed with this commit 5d282d6 of 2nd PR.

" <met:WorkflowImplDescription>Approval Workflow</met:WorkflowImplDescription>\n" +
" <met:TemplateId>MultiStepApprovalTemplate</met:TemplateId>\n" +
" <met:ParametersMetaData>\n" +
" <met:ParameterMetaData Name=\"BPSProfile\" InputType=\"Select\" isRequired=\"true\" isInputDataRequired=\"true\">\n" +
Copy link
Author

Choose a reason for hiding this comment

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

remove BPS Profile

Copy link
Author

@IsharaSilva IsharaSilva Aug 1, 2022

Choose a reason for hiding this comment

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

addressed with this commit f476a48 of 2nd PR.

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.

2 participants