So I’m trying to collect the most recent process instance value for a workflow that can be started and ended repeatedly for the same data values. The way I’ve tried to get the “latest” was to take the largest process instance ID. But I’m finding that flowable, while it generates unique IDs for each workflow, does not seem to increment the process instance ID by a reliable value. I can see in the Flowable database tables that the process IDs seem to have circled around, because my latest process instance has a lower process instance ID that processes that were terminated earlier.
Process termination, in the sense that I use it, occurs via the Flowable API function of the runtimeService, deleteProcessInstance().