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

call-back-api #446

Open
wants to merge 6 commits into
base: feature-workflow-externalization
Choose a base branch
from

Conversation

malithiperera
Copy link

@malithiperera malithiperera commented Apr 20, 2023

Purpose

Implement a new Rest end point for workflow management

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

CLAassistant commented Apr 20, 2023

CLA assistant check
All committers have signed the CLA.

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
Copy link
Contributor

@dewniMW dewniMW Apr 28, 2023

Choose a reason for hiding this comment

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

update with the correct year. check all files

Copy link
Author

Choose a reason for hiding this comment

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

fixed by :0f13918

<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.workflow.management</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.2.43-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

when merging the PR, need to make sure the correct version is included here

import org.wso2.carbon.identity.workflow.mgt.WorkFlowExecutorManager;

/**
* Service holder class for user organization management services.
Copy link
Contributor

Choose a reason for hiding this comment

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

incorrect comment

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 0f13918

Comment on lines 29 to 30
* @param requestId workflow request id.
* @param workflowApprovalPatchRequest workflow request status.
Copy link
Contributor

Choose a reason for hiding this comment

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

not formatted properly

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 34dc2a5

* @param workflowApprovalPatchRequest workflow request status.
* @throws WorkflowException throw exception while approving workflow request
*/
public void approveWorkflowRequest(String requestId, WorkflowApprovalPatchRequest workflowApprovalPatchRequest) throws WorkflowException {
Copy link
Contributor

Choose a reason for hiding this comment

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

check if this exceeds the maximum character length (120) limit

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 09a4962

public void approveWorkflowRequest(String requestId, WorkflowApprovalPatchRequest workflowApprovalPatchRequest) throws WorkflowException {

getWorkFlowExecutorManager().handleCallback(requestId, workflowApprovalPatchRequest.getStatus(), null);

Copy link
Contributor

Choose a reason for hiding this comment

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

unwanted 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.

fixed by : 09a4962

* Custom exception for user organization management endpoint.
*/
public class WorkflowManagementEndpointException extends WebApplicationException {
private String errorCode;
Copy link
Contributor

Choose a reason for hiding this comment

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

add a new line after the class declaration

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

Comment on lines 35 to 37
public WorkflowManagementEndpointException(String errorCode) {

}
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the purpose of this?

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

package org.wso2.carbon.identity.workflow.mgt.api.v1.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.wso2.carbon.identity.workflow.mgt.api.v1.*;
Copy link
Contributor

@dewniMW dewniMW Apr 28, 2023

Choose a reason for hiding this comment

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

avoid star imports. please note this is not applicable for files in gen folder

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

import java.util.List;
import javax.ws.rs.core.Response;

public class WorkflowApiServiceImpl implements WorkflowApiService {
Copy link
Contributor

Choose a reason for hiding this comment

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

add a 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.

fixed by : 3f0c886

import org.springframework.beans.factory.annotation.Autowired;
import org.wso2.carbon.identity.workflow.mgt.api.v1.*;
import org.wso2.carbon.identity.workflow.mgt.api.v1.core.WorkflowManagementService;
import org.wso2.carbon.identity.workflow.mgt.api.v1.exceptions.WorkflowManagementEndpointException;
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like this import is not used within the class

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

public Response workflowWorkflowIdPatch(String workflowId, WorkflowApprovalPatchRequest workflowApprovalPatchRequest) {

try {
workflowManagementService.approveWorkflowRequest(workflowId,workflowApprovalPatchRequest);
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting issue

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

// /**
// * An error code.
// **/
// public Error code(String code) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this class if not used

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

//
//import javax.ws.rs.core.Response;
//
//public class WorkflowManagementEndpointUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this class 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.

fixed by : 3f0c886

responses:
'200':
description: Successful Response

Copy link
Contributor

Choose a reason for hiding this comment

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

remove 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.

fixed by : 3f0c886

properties:
code:
type: string
example: UOM-00000
Copy link
Contributor

@dewniMW dewniMW Apr 28, 2023

Choose a reason for hiding this comment

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

is this the correct error code prefix?

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

type: string
example: 'APPROVED'


Copy link
Contributor

Choose a reason for hiding this comment

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

remove line

Copy link
Author

Choose a reason for hiding this comment

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

fixed by : 3f0c886

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.

None yet

3 participants