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

Patch approval service #154

Open
wants to merge 8 commits into
base: feature-workflow-engine-simple
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 documentation@wso2.com 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 certification@wso2.com 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.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

UserApprovalServiceHolder.taskOperationService = taskOperationService;
}

public static void setApprovalEventService(ApprovalEventService approvalEventService1) {
Copy link
Contributor

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. Fix other places as well.

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 e7dc2ae

UserApprovalServiceHolder.taskOperationService = taskOperationService;
}

public static void setApprovalEventService(ApprovalEventService approvalEventService1) {
Copy link
Author

Choose a reason for hiding this comment

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

switch variable name

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 e7dc2ae

import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.humantask.core.TaskOperationService;

public class OSGIBpelService extends AbstractFactoryBean<TaskOperationService> {
Copy link
Author

Choose a reason for hiding this comment

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

add class comment

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 e7dc2ae

@@ -0,0 +1,30 @@
package org.wso2.carbon.identity.api.user.approval.common.factory;
Copy link
Author

Choose a reason for hiding this comment

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

add license header

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 e7dc2ae

if (taskOperationService != null) {
this.taskOperationService = taskOperationService;
} else {
throw new Exception("Unable to retrieve TaskOperationService service.");
Copy link
Author

Choose a reason for hiding this comment

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

change into run time exception

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 e7dc2ae


/**
* Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to
* instantiate the TaskOperationService type of object inside the container.
*/
public class OSGIServiceFactory extends AbstractFactoryBean<TaskOperationService> {
public class OSGIServiceFactory extends AbstractFactoryBean<ApprovalEventService> {
Copy link
Author

Choose a reason for hiding this comment

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

keep this class as it is and add a new class as a OSGI service

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 e7dc2ae

if (taskOperationService != null) {
this.taskOperationService = taskOperationService;
if (this.approvalEventService == null) {
ApprovalEventService approvalEventService1 = (ApprovalEventService) PrivilegedCarbonContext.
Copy link
Author

Choose a reason for hiding this comment

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

fix variable name

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 e7dc2ae

Comment on lines -22 to -25
import org.wso2.carbon.identity.rest.api.user.approval.v1.dto.TaskDataDTO;
import org.wso2.carbon.identity.rest.api.user.approval.v1.dto.ErrorDTO;
import org.wso2.carbon.identity.rest.api.user.approval.v1.dto.TaskSummaryDTO;
import org.wso2.carbon.identity.rest.api.user.approval.v1.dto.StateDTO;
Copy link
Author

Choose a reason for hiding this comment

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

check if these imports can be removed

Copy link
Author

Choose a reason for hiding this comment

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

Yes. no need.

@@ -29,25 +32,49 @@
*/
public class MeApiServiceImpl extends MeApiService {

private ApprovalEventService approvalEventService;
private UserApprovalService userApprovalService;
public static final String SIMPLE_WORKFLOW_ENGINE = "Workflow.SimpleWorkflow.Enable";
Copy link
Author

Choose a reason for hiding this comment

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

check if this can be moved to a constant class

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 e7dc2ae

Comment on lines +40 to +42
public MeApiServiceImpl() {

}
Copy link
Author

Choose a reason for hiding this comment

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

remove if not needed

Copy link
Author

Choose a reason for hiding this comment

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

need it.

</bean>
<bean id="approvalEventServiceFactoryBean"
class="org.wso2.carbon.identity.api.user.approval.common.factory.OSGIServiceFactory"/>
<bean id="UserApprovalServiceHolderBean1" class="org.wso2.carbon.identity.api.user.approval.common.UserApprovalServiceHolder">
Copy link
Author

Choose a reason for hiding this comment

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

fix bean id

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 e7dc2ae

pom.xml Outdated
<dependency>
<groupId>org.wso2.carbon.identity.workflow.engine</groupId>
<artifactId>workflow.engine</artifactId>
<version>1.0-SNAPSHOT</version>
Copy link
Author

Choose a reason for hiding this comment

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

get the version through a property

Copy link
Author

@IsharaSilva IsharaSilva Jul 26, 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 b89af13

@chamathns chamathns changed the base branch from master to feature-workflow-engine-simple July 27, 2022 05:38
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