Once the When workflow extensions are enabled using default workflow executors, they create respective approval tasks in WSO2 Business Process Server (BPS). Each of these tasks are visible for Administrators to administrators in the Admin Dashboard. Administrator The administrator has the option to accept or reject each of the requests made by other users. But At the same time, users have the option to delete the application, subscription , or key they created before the administrator choose to accept or reject the accepts or rejects their requests. This leaves unnecessary approval requests in the Admin Dashboard, which can confuse the administrator.
API Manager provides a task clean up feature to prevent deleted items from showing up in the Admin Dashboard. The WorkflowExecutor
class has been is introduced with the cleanUpPendingTask(String workflowExtRef)
method, which is triggered by application or subscription deletion. This method implements the logic to notify the WSO2 Business Process Server that BPS that a task with id the workflowExtRef
is ID has been deleted.
The BPEL process in Business Process Server should also have an understanding of how to exit a created process. Therefore BPEL process should contain an WSO2 BPS should contain a cancel event to support process cancellation. Each BPEL process should have the support for cancel correlation and event implemented cancellation in order to successfully cleanup unnecessary tasks. Check BPEL Correlation Guide and Process Correlation for more information on BPEL Correlation.
For more information on BPEL correlation, see Process Correlation and the BPEL Correlation Guide.
The final BPEL should have a design similar to the following diagram,
Follow the steps below to test this out.
Info |
---|
This example assumes that workflows are enabled for application creation, application registration and subscription creation. |
- Log in to the API Store and create two new applications.
- Log in to the Admin Dashboard Web application (
https://<Server Host>:9443/admin-dashboard
) and approve the creation of one application. - In the API Store, subscribe an API to the approved application.
- Generate production and/or sandbox key(s) for the approved application.
- Check the pending approval tasks in the Admin Dashboard. You see tasks pending for application creation, application registration and subscription creation.
- Delete the items you created from the API Store and notice that the respective administrator approval tasks are removed.
- If the application with pending subscription and key generation approvals is deleted from the API Store, all the pending subscription and key generation approval tasks are deleted for that application.