Skip to content

Add WorkflowCancel implementation (#472)#532

Open
jsamaniego4 wants to merge 1 commit into
zowe:mainfrom
jsamaniego4:feature/issue-472-workflow-cancel
Open

Add WorkflowCancel implementation (#472)#532
jsamaniego4 wants to merge 1 commit into
zowe:mainfrom
jsamaniego4:feature/issue-472-workflow-cancel

Conversation

@jsamaniego4

Copy link
Copy Markdown

Closes #472

Provide a workflow API method to cancel a z/OSMF workflow on a z/OS system.

Implementation supports the z/OSMF Cancel Workflow REST API:

  • WorkflowCancel class added under zosmfworkflow/methods
  • cancel method performs PUT request to /operations/cancel endpoint
  • OPERATIONS_CANCEL constant added to WorkflowConstants
  • Supports basic and token-based z/OSMF authentication
  • 12 unit tests added, all passing**

Signed-off-by: jsamaniego4 <158121098+jsamaniego4@users.noreply.github.com>
@jsamaniego4 jsamaniego4 force-pushed the feature/issue-472-workflow-cancel branch from f72ea6e to c9c6098 Compare June 29, 2026 17:09
@frankgiordano frankgiordano self-requested a review June 29, 2026 19:35
request = ZosmfRequestFactory.buildRequest(connection, ZosmfRequestType.PUT_JSON);
}
request.setUrl(url);
request.setBody("{}");

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 setBody if none needs to be provided.

request.setUrl(url);
request.setBody("{}");

return request.executeRequest();

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.

The IBM documentation indicates that the service returns a JSON response. For example:

HTTP/1.1 200 OK
content-length: 59
content-language: en-US
x-powered-by: Servlet/3.0
server: WebSphere Application Server
connection: Close
date: Wed, 11 Feb 2015 18:30:33 GMT
content-type: application/json; charset=UTF-8

{
    "workflowName": "AutomationExample|Canceled|1423679433714"
}

To handle this properly, a dedicated response model should be introduced. For instance, create a WorkflowCancelResponse class containing a single field, workflowName.

The service layer should then deserialize the JSON payload into this object and return it to the caller, rather than exposing raw JSON.

@frankgiordano frankgiordano added the enhancement New feature or request label Jun 29, 2026
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.

Cancel a workflow API

2 participants