This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Process Instance Cleanup

Configure process instance cleanup. A large number of process instance data will be accumulated in the BPEL engine's persistence storage if processes are persisted. Process instance cleanup is used to reduce performance overhead introduced by database size. The process instance cleanup feature can be configured with periodic cleanup tasks based on various process instance properties, to remove data from WSO2 EI persistence storage.

The 'Schedules' section in bps.xml can be used to configure instance cleanup. The 'Schedules' section can contain multiple 'Schedule' elements with multiple 'cleanup' elements. In each 'Schedule' element, the attribute 'when' states the time that the instance cleanup task gets executed. Time is configured using cron expressions (http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger). Inside the cleanup element, filter elements can be used with various instance properties, which help select the instance to be deleted.

For example, the following code schedule is configured to initiate a cleanup task at 5:11 PM every day to clean completed process instances.

<tns:Schedules>
    <tns:Schedule when="0 11 17 * * ?">
           <tns:cleanup>
                <tns:filter><![CDATA[status=completed]]></tns:filter>
           </tns:cleanup>
    </tns:Schedule>
</tns:Schedules>