How Do I Delete Applications from the Workflow Database?

During the application development process, applications may be created for testing purposes that you do not want to keep in your environment. You may want to delete one application or all applications and their related data from the workflow database. The AgilePoint Service Account can do this with SQL scripts.

Prerequisites

How to Start

  1. Open a SQL command line to access the AgilePoint workflow database.

Procedure

  1. Do one of these:
    • To delete only one application and its data, execute this SQL command.

      Use the application ID for the AgilePoint NX application you want to delete.

      Format:

      DELETE FROM WF_LABEL_FILE_REL WHERE LABEL_ID IN (SELECT LABEL_ID FROM WF_APP_LABEL WHERE 
                                      APP_ID = @APP_ID)
                                      
      DELETE FROM WF_APP_LABEL WHERE APP_ID = @APP_ID
                                      
      DELETE FROM WF_LARGE_DATA WHERE ELEMENT_ID IN (SELECT FILE_ID FROM WF_APPLICATION_FILE WHERE 
                                      APP_ID = @APP_ID)
                                      
      DELETE FROM WF_APPLICATION_FOLDER WHERE APP_ID IN (@APP_ID)
                                      
      DELETE FROM WF_APP_GLB_SETTINGS WHERE APP_NAME IN (SELECT APP_NAME FROM WF_ENABLED_APPS WHERE 
                                      APP_ID = @APP_ID)
                                      
      DELETE FROM WF_APPLICATION_FILE WHERE APP_ID = @APP_ID
                                      
      DELETE FROM WF_ENABLED_APPS WHERE APP_ID = @APP_ID

      Example:

      DELETE FROM WF_LABEL_FILE_REL WHERE LABEL_ID IN (SELECT LABEL_ID FROM WF_APP_LABEL WHERE 
                                      APP_ID = '9BCA68F728F9FB141166FE4B85C90279')
                                      
      DELETE FROM WF_APP_LABEL WHERE APP_ID = '9BCA68F728F9FB141166FE4B85C90279'
                                      
      DELETE FROM WF_LARGE_DATA WHERE ELEMENT_ID IN (SELECT FILE_ID FROM WF_APPLICATION_FILE WHERE 
                                      APP_ID = '9BCA68F728F9FB141166FE4B85C90279')
                                      
      DELETE FROM WF_APPLICATION_FOLDER WHERE APP_ID IN ('9BCA68F728F9FB141166FE4B85C90279')
                                      
      DELETE FROM WF_APP_GLB_SETTINGS WHERE APP_NAME IN (SELECT APP_NAME FROM WF_ENABLED_APPS WHERE 
                                      APP_ID = '9BCA68F728F9FB141166FE4B85C90279')
                                      
      DELETE FROM WF_APPLICATION_FILE WHERE APP_ID = '9BCA68F728F9FB141166FE4B85C90279'
                                      
      DELETE FROM WF_ENABLED_APPS WHERE APP_ID = '9BCA68F728F9FB141166FE4B85C90279'
    • To delete All applications and their data, execute this SQL command.
      DELETE FROM WF_LABEL_FILE_REL 
                                      
      DELETE FROM WF_APP_LABEL 
                                      
      DELETE FROM WF_LARGE_DATA 
                                      
      DELETE FROM WF_APPLICATION_FOLDER 
                                      
      DELETE FROM WF_APP_GLB_SETTINGS 
                                      
      DELETE FROM WF_APPLICATION_FILE 
                                      
      DELETE FROM WF_ENABLED_APPS
  2. If you are deleting All applications, execute this SQL command:
    delete WF_EVENTS
    delete WF_AUTO_WORKITEMS
    delete WF_MANUAL_WORKITEMS
    delete WF_ACTIVITY_INSTS
    delete WF_CUSTOM_ATTRS
    delete WF_PROC_TRACKINGS
    delete WF_LARGE_TEXTS where TEXT_ID in ( select PROC_INST_ID from WF_PROC_INSTS )
    delete WF_PROC_INSTS
    delete WF_MAIL_DELIVERABLES.