Hi all,
I’m trying to delete a process instance via the Java API at the end of a task based on a variable;
runtimeService.deleteProcessInstance(String processInstanceId, String deleteReason);
When this code is in a ‘complete’ task listener, I get following exception:
2016-08-09 13:16:23,421 WARNING [ExceptionHandler] (default task-17) org.camunda.bpm.engine.rest.exception.RestException: Cannot submit task form a29ce949-5e22-11e6-9e2b-4e8dcd585ba0: cannot signal execution 87f889fb-5e22-11e6-9e2b-4e8dcd585ba0: it has no current activity
When called in an ‘end’ execution listener, the submit-form call hangs and after a while following exception occurs:
2016-08-09 13:31:16,768 ERROR [org.jboss.as.ejb3.invocation] (default task-6) WFLYEJB0034: EJB Invocation failed on component ApproveNotification for method public abstract void org.camunda.bpm.engine.delegate.ExecutionListener.notify(org.camunda.bpm.engine.delegate.DelegateExecution) throws java.lang.Exception: javax.ejb.EJBTransactionRolledbackException: WFLYEJB0378: Failed to acquire a permit within 5 MINUTES
2016-08-09 13:31:29,646 WARN [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012108: CheckedAction::check - atomic action 0:ffffc0a80c1e:78ef5394:57a99fd5:2a4b aborting with 1 threads active!
2016-08-09 13:31:29,657 WARN [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012121: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,main] successfully canceled TX 0:ffffc0a80c1e:78ef5394:57a99fd5:2a4b
I have no idea how to solve the exception. My intent is to stop a process instance (based on user form unput) while keeping the history in the tables + having the delete_reason filled in.