feat: add get properties of archived workflow API (#477)#528
feat: add get properties of archived workflow API (#477)#528Eshaan-byte wants to merge 1 commit into
Conversation
ee98af4 to
2b75352
Compare
| * @throws ZosmfRequestException request error state | ||
| */ | ||
| public WorkflowGetPropertiesResponse getArchivedPropertiesCommon( | ||
| final WorkflowGetPropertiesInputData propertiesInputData) throws ZosmfRequestException { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
remove this method.
There was a problem hiding this comment.
see discord discussion.
| public WorkflowGetPropertiesResponse getArchivedProperties(final String workflowKey, | ||
| final boolean returnSteps, | ||
| final boolean returnVariables) | ||
| throws ZosmfRequestException { |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
make this public method.
| * @author Ashish Kumar Dash | ||
| */ | ||
| public WorkflowGetPropertiesResponse getPropertiesCommon(final WorkflowGetPropertiesInputData propertiesInputData) | ||
| throws ZosmfRequestException { |
There was a problem hiding this comment.
remove this method.
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>
3bad623 to
99db1cd
Compare
Summary
getArchivedPropertiesmethods toWorkflowGetto support the z/OSMFGET
/archivedworkflows/{workflowKey}REST API (issue Get the properties of an archived workflow API #477)returnDataquery parameter for requesting step and variable informationWorkflowGetPropertiesInputDataandWorkflowGetPropertiesResponseclassessince the archived endpoint shares the same request parameters and response structure
API Reference
Test plan
tstWorkflowGetArchivedPropertiesByKeySuccess- verifies URL and response parsingtstWorkflowGetArchivedPropertiesWithReturnDataUrlGeneration- verifies?returnData=steps,variableststWorkflowGetArchivedPropertiesCommonReturnStepsOnlyUrlGeneration- verifies?returnData=stepststWorkflowGetArchivedPropertiesWithNullInputData- null input validationtstWorkflowGetArchivedPropertiesWithNullWorkflowKey- null key validationCloses #477