Delete partially completed applications
Partial applications are those applications that users save without submitting or save and resume later. This section explains how to set up Civic Platform to remove all partially completed applications from Civic Platform. These configuration steps do not affect completed applications.
This setup requires setting a standard choice and creating a script. The script is then set up as a batch job. The batch job removes partially completed applications from Civic Platform on a regular schedule that you define. By purging the partial applications, it frees up disk space and it makes it more efficient for users to locate completed applications. Upon deleting partial applications from Civic Platform, the applications cannot be retrieved.
Use this scenario to further understand how the standard choice and batch job scheduling handle removing partial applications from Civic Platform.
To remove partial applications that are older than 30 days, set the value of the standard choice PARTIALLY_COMPLETED_CAP_PURGE_DAYS to 30. This is the number of days that partially completed applications remain in Civic Platform before Civic Platform removes them. If today is April 1, 2008, and the Value is 30 days, then all partial applications created on March 31, 2008 (which is day number 1 in counting) through March 2 remain in Civic Platform. Civic Platform removes partial applications created on March 1 and earlier. Civic Platform removes the partial applications when the scheduled batch job runs. Setting the batch job to execute the script on a daily basis removes all partial applications that were created on day 31 (March 1, in this case) and earlier.
To delete partially completed applications, there are three major steps:
As system administrator, you must define which partial application data you want to purge from Civic Platform. To do this, you must configure the related standard choice and write a script.
To define partial application information you want to purge
-
Go to Civic Platform.
-
Navigate to Admin tools > Application > Standard choices.
-
Configure the standard choice PARTIALLY_COMPLETED_CAP_PURGE_DAYS and set the standard choices value to the number of days Civic Platform stores partially completed applications.
This value specifies how many days partially completed applications remain in Civic Platform before they are removed from Civic Platform. Using the example above, if today is April 1, 2008, and the value is 30 days, then all partial applications created on March 31, 2008 (which is day number 1 in counting) through March 2 remain in Civic Platform. And Civic Platform removes those partial applications created on March 1 and earlier.
For information on creating a standard choice, refer to the Accela Civic Platform Configuration Reference.
Verify the script is working properly before defining it as a batch job.
To test the script
-
Go to Administrator tools > Event manager > Scripts.
-
Select Submit .
-
In the Script code field, locate CLEAREXPIREDINCOMPLETECAP.
-
Select the red dot next to the script code for CLEAREXPIREDINCOMPLETECAP.
-
Under the Script text area, select the Script test button.
-
Review the warning message that states improperly written scripts may incorrectly alter data for many records.
-
Under the Script text area, select Submit.
-
Select Close on the pop-up window.
-
If necessary, make any corrections to the script and select the Submit button to retest.
-
If you have changes you must save them to the original script. To do this, return to Administrator tools > Events > Scripts and locate the CLEAREXPIREDINCOMPLETECAP script and make the updates to the Script text and select Save.
After the script has passed testing, you can create a batch job. When the batch job is created, you can schedule the script to run as a regularly scheduled event in Civic Platform.
To schedule a batch job to run the script
-
Navigate to Setup portlet > System tools > Batch engine.
-
Select New .
-
Complete the following required fields:
Field name Field description Name
Enter a name to help you identify the batch job.
Description
Enter a description or comment to further clarify any aspects about the batch job.
Job server
Select the server for running the batch job.
Job type
Select job type Script from this menu.
Script code
Use the list and locate the existing script CLEAREXPIREDINCOMPLETECAP. This is the script that you just created and now need to run when executing this batch job.
Status
If you want to let users run this batch job, select Enable; otherwise, select Disable.
-
Select Submit to save the batch job.
-
Select the Job schedule tab.
-
Schedule the batch job and specify how often you want to execute the script. Complete these fields.
Field name Field description Frequency
Use the list and choose the interval of the batch job: Once, Daily, Weekly, or Monthly.
Schedule status
Specify if it is Scheduled, Not Scheduled, or Execute.
Start date
Use the Date button to search for the date when the batch job begins.
Start time
Enter the time when the batch job should begin and specify AM or PM with the list.
Time out (seconds)
Enter the number of seconds a batch job attempts to run before timing out.
-
To further explain how the standard choice setting and the batch job schedule work together, consider the standard choice is set to 90 days and this batch job Interval is set to Daily. These settings mean that partially completed applications remain in Civic Platform for 90 days, and the batch job removes all partial applications that were created on day 91 and earlier, on a daily basis.
-
Select the Save button to submit this batch job to Civic Platform.