Skip to content

feat: add get properties of archived workflow API (#477)#528

Open
Eshaan-byte wants to merge 1 commit into
zowe:mainfrom
Eshaan-byte:feature/get-archived-workflow-properties
Open

feat: add get properties of archived workflow API (#477)#528
Eshaan-byte wants to merge 1 commit into
zowe:mainfrom
Eshaan-byte:feature/get-archived-workflow-properties

Conversation

@Eshaan-byte

Copy link
Copy Markdown
Contributor

Summary

  • Add getArchivedProperties methods to WorkflowGet to support the z/OSMF
    GET /archivedworkflows/{workflowKey} REST API (issue Get the properties of an archived workflow API #477)
  • Support optional returnData query parameter for requesting step and variable information
  • Reuse existing WorkflowGetPropertiesInputData and WorkflowGetPropertiesResponse classes
    since the archived endpoint shares the same request parameters and response structure
  • Add unit tests for URL generation, response parsing, and null validation

API Reference

Test plan

  • tstWorkflowGetArchivedPropertiesByKeySuccess - verifies URL and response parsing
  • tstWorkflowGetArchivedPropertiesWithReturnDataUrlGeneration - verifies ?returnData=steps,variables
  • tstWorkflowGetArchivedPropertiesCommonReturnStepsOnlyUrlGeneration - verifies ?returnData=steps
  • tstWorkflowGetArchivedPropertiesWithNullInputData - null input validation
  • tstWorkflowGetArchivedPropertiesWithNullWorkflowKey - null key validation

Closes #477

@Eshaan-byte Eshaan-byte force-pushed the feature/get-archived-workflow-properties branch from ee98af4 to 2b75352 Compare June 29, 2026 03:56
* @throws ZosmfRequestException request error state
*/
public WorkflowGetPropertiesResponse getArchivedPropertiesCommon(
final WorkflowGetPropertiesInputData propertiesInputData) throws ZosmfRequestException {

@frankgiordano frankgiordano Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This introduces unnecessary duplication. The getArchivedPropertiesCommon() method is redundant and increases maintenance overhead.

We should refactor this to reuse getPropertiesCommon() instead, and introduce a boolean parameter (e.g., isArchived) to control which URL is used internally.

This keeps the logic centralized, reduces code duplication, and makes future changes easier since URL handling would only need to be updated in one place.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback @frankgiordano. I've refactored as suggested, getArchivedPropertiesCommon() now delegates to a private getPropertiesCommon(propertiesInputData, isArchived) method that both getPropertiesCommon() and getArchivedPropertiesCommon() share. The isArchived boolean controls whether ARCHIVED_WORKFLOWS_RESOURCE or WORKFLOWS_RESOURCE is used for the URL. All logic is centralised in one place now.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove public WorkflowGetPropertiesResponse getArchivedPropertiesCommon(
final WorkflowGetPropertiesInputData propertiesInputData) throws ZosmfRequestException {

and use

private WorkflowGetPropertiesResponse getPropertiesCommon(
final WorkflowGetPropertiesInputData propertiesInputData,
final boolean isArchived) throws ZosmfRequestException {

only

* @author Ashish Kumar Dash
*/
public WorkflowGetPropertiesResponse getProperties(final String workflowKey,
final boolean returnSteps,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove this method.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

see discord discussion.

public WorkflowGetPropertiesResponse getArchivedProperties(final String workflowKey,
final boolean returnSteps,
final boolean returnVariables)
throws ZosmfRequestException {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove this method it is not needed see discord discussion.

* @return workflow properties returned by z/OSMF
* @throws ZosmfRequestException request error state
*/
private WorkflowGetPropertiesResponse getPropertiesCommon(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

make this public method.

* @author Ashish Kumar Dash
*/
public WorkflowGetPropertiesResponse getPropertiesCommon(final WorkflowGetPropertiesInputData propertiesInputData)
throws ZosmfRequestException {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove this method.

@frankgiordano frankgiordano added the enhancement New feature or request label Jun 29, 2026
Add getArchivedProperties and public getPropertiesCommon(inputData,
isArchived) to WorkflowGet to support the z/OSMF GET
/archivedworkflows/{workflowKey} REST API with optional returnData
query parameter for steps and variables.

Signed-off-by: Eshaan Gupta <eshaan28gupta@gmail.com>
@Eshaan-byte Eshaan-byte force-pushed the feature/get-archived-workflow-properties branch from 3bad623 to 99db1cd Compare June 30, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get the properties of an archived workflow API

2 participants