This tool provides the capability to purge finished (archived) process instances from Bonita Runtime environment. By default, all archives are preserved forever in Bonita runtime, but if your functional context allows you to remove old unused process instances, as example, if you only need to keep a history of last 6 months, use this tool to cleanup your Bonita database.
Bonita Purge Tool uses gradle & spring boot to build. Before building, it's recommended to modify the application.properties file located in src/main/resources to enter your database connection information.
Make sure you have Java 8+ installed and simply run: ./gradlew bootDistZip
# Unzip the previously built tool:
unzip -d . build/distributions/bonita-purge-tool.zip
# go to the tool folder:
cd bonita-purge-tool/
# run the command-line tool:
bin/bonita-purge-tool(.bat) <PROCESS_DEFINITION_ID> <OLDEST_DATE_TIMESTAMP> [<TENANT_ID>]
This command will delete all archived process instances belonging to the process identified by PROCESS_DEFINITION_ID, that are finished since at least OLDEST_DATE_TIMESTAMP.
An optional TENANT_ID parameter can be given if the platform uses multiple tenants to specify on which tenant should the process instances be deleted. If multi-tenancy is used and the TENANT_ID is not set, an error is issued and the program stops.
OLDEST_DATE_TIMESTAMP must be a Timestamp (in milliseconds) from which all process instances that finished before that date will be deleted. Unfinished process instances and process instances that finished after that date will not be affected. Its format is a standard Java timestamp since EPOCH (in milliseconds). You can use websites such as Epoch Converter to format such a timestamp.
./gradlew test
Integration tests rely on database docker images that are only available for internal Bonitasofter's for now.
./gradlew integrationTest
or
./gradlew iT
to specify the database vendor on which to run the integration tests add -Ddb.vendor=<DB_VENDOR>
. For instance:
./gradlew iT -Ddb.vendor=mysql
valid DB vendor values are: mysql | oracle | postgres | sqlserver
.
If not specified, it will start a Postgres docker container and run tests against it.
./gradlew bootRun -Pargs=8901055312492483521,165000000,1
It runs on PostgreSQL by default. Change the default database parameters to run it on your database.
This reference page provides the tests run on all supported databases.