Purge Script for Activiti Tables

We want to write purge script for Activiti tables to clear older entries from specific date. Is there any API exposed by Activiti or we have to write our own Manual Queries.Is there template for Purge Script available in Activiti or any auto purge option available in Activiti ?