Adding an API Subscription Deletion Workflow¶
Subscription Deletion provides the capability to remove an already existing subscription. Attaching a custom workflow to the API subscription deletion, enables an admin to approve/reject the subscription deletion request made for an existing subscription. Note that only an admin is able to approve/reject a subscription deletion request.
When the API subscription deletion workflow is enabled, when the subscription deletion request is made, the subscription status is changed to the DELETE_PENDING
state. In this state, a consumer can still invoke the API with the same subscription, using its production or sandbox keys, until the subscription deletion is approved. Once the subscription deletion request is approved the subscription will be deleted.
Engaging the Approval Workflow Executor in the API Manager¶
-
Sign in to the API Manager Management Console (
https://<Server Host>:9443/carbon
) and go to Browse under Registry. -
Open the
/_system/governance/apimgt/applicationdata/workflow-extensions.xml
resource and click Edit as text. Disable theSubscriptionDeletionSimpleWorkflowExecutor
and enableSubscriptionDeletionApprovalWorkflowExecutor
.<WorkFlowExtensions> ... <!--SubscriptionDeletion executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionDeletionSimpleWorkflowExecutor"/--> <SubscriptionDeletion executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionDeletionApprovalWorkflowExecutor"/> ... </WorkFlowExtensions>
The subscription deletion approval workflow executor is now engaged.
-
Sign in to the WSO2 API Developer Portal (
https://<hostname>:<port>/devportal
) and click Applications. Select the application which has the subscriptions you need to delete. -
Click Subscriptions to list the subscriptions of the application.
-
Select the subscription which needs to be deleted and click the DELETE icon to open the Subscription Delete popup.
-
Click DELETE to continue. You will see the subscription status as DELETE_PENDING.
-
Sign in to the Admin Portal (
https://<Server Host>:9443/admin
), list all the tasks for API subscription delete from Tasks → Subscription Deletion and click on approve (or reject) to approve (or reject) the workflow pending request. -
After approving go back to the API Developer Portal Application Subscriptions tab. The subscription will be removed.