Adding an API Subscription Tier Update Workflow¶
Subscription Tier update will provide the capability to change the subscription tier of an already existing subscription. Attaching a custom workflow to the API subscription update, enables an admin to approve/reject the subscription tier change request made for an active subscription. Note that only an admin is able to approve/reject a subscription tier change request.
When the API subscription update workflow is enabled, when the subscription tier change request is made, the subscription status is changed to the TIER_UPDATE_PENDING
state. In this state, a consumer can still invoke the API with the same subscription (with the previous existing subscription tier), using its production or sandbox keys, until the subscription update to a new tier is approved. Once the subscription status change request is approved the subscription status is updated to the UNBLOCKED
state.
Engaging the Approval Workflow Executor in the ESB¶
-
Sign in to ESB Management Console (
https://<Server Host>:9443/carbon
) and go to Browse under Resources. -
Open the
/_system/governance/apimgt/applicationdata/workflow-extensions.xml
resource and click Edit as text. Disable the SubscriptionUpdateSimpleWorkflowExecutor and enable SubscriptionUpdateApprovalWorkflowExecutor.<WorkFlowExtensions> ... <!--SubscriptionUpdate executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionUpdateSimpleWorkflowExecutor"/--> <SubscriptionUpdate executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionUpdateApprovalWorkflowExecutor"/> ... </WorkFlowExtensions>
The subscription update approval workflow executor is now engaged.
-
Sign in to the ESB API Developer Portal (
https://<hostname>:<port>/devportal
) and click Applications. Select the application which has the subscriptions you wish to modify. -
Click Subscriptions to list the subscriptions of the application.
-
Select the subscription which the tier needs to be changed and click the EDIT icon to open the Subscription Update popup.
-
Select the throttling tier that needs to be updated and click Update to continue. After updating you will see the subscription status as TIER_UPDATE_PENDING.
-
(Optional) if the consumer need to update the requested tier to a different tier, click EDIT icon and select the new requested tier and click Update.
-
Sign in to the Admin Portal (
https://<Server Host>:9443/admin
), list all the tasks for API subscription update from Tasks → Subscription Update 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 status will be UNBLOCKED and, the requested tier will also be assigned.
Now the consumer can use the existing subscription with the newly assigned throttling tier.