Start over | clear all processes

Is there is a clean way to start over ? i.e clean all the process and executions and their state

What do you exactly mean with start over? Can you give some more context please. Are you talking about testing or something else?

Here Spock test on how I do it. Removes the runtime, but not history

@Ignore("Convenience method to clean up workflow processes")
def "delete all active process instances"() {


        def processInstances = runtimeService.createProcessInstanceQuery().active().list()

        println("Found ${processInstances.size()}")
        processInstances.each {
            println "deleting processs id: ${it.processInstanceId}"
            runtimeService.deleteProcessInstance(it.processInstanceId, "Cleaning up developemnt env")

@Ignore("Convenience method to clean up workflow deployments")
def "delete deployments"() {


        def deployments = repositoryService.createDeploymentQuery().list()
        println "Found ${deployments.size()} deployments"

        deployments.each { deployment ->
            println "Deployment Name: $  Deployment Id: $ Deployment Key: ${deployment.key}"
            try {

            } catch (e) {

                println "ERROR : $e"