-
1. Re: How to remove the process instance when the abort fails
swiderski.maciej Mar 26, 2013 11:56 AM (in response to akuppu)yes, the abort should be the way to go. Could you provide the stack trace for examination? We need to find the cause of why the process instance is in non recoverable state.
Cheers
-
2. Re: How to remove the process instance when the abort fails
akuppu Mar 27, 2013 1:05 PM (in response to swiderski.maciej){code}
2013-03-27 12:52:35 [http-49021-2] DEBUG bitronix.tm.BitronixTransaction - executing synchronization a ClearContextSynchronization for a Bitronix Transaction with GTRI
D [737072696E672D62746D0000013DACC3F19E00000032], status=COMMITTED, 0 resource(s) enlisted (started Wed Mar 27 12:52:35 EDT 2013) with status=COMMITTED
2013-03-27 12:52:35 [http-49021-2] DEBUG bitronix.tm.BitronixTransactionManager - clearing thread context: a ThreadContext with transaction a Bitronix Transaction with
GTRID [737072696E672D62746D0000013DACC3F19E00000032], status=COMMITTED, 0 resource(s) enlisted (started Wed Mar 27 12:52:35 EDT 2013), default timeout 60s
2013-03-27 12:52:35 [http-49021-2] INFO org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler - User '[User:'Administrator']' was unable to execution operation 'Exi
t' on task id 32 due to a no 'current status' match
2013-03-27 12:52:35 [http-49021-2] ERROR org.drools.persistence.SingleSessionCommandService - Could not commit session
java.lang.IllegalArgumentException: Removing a detached instance org.drools.persistence.info.WorkItemInfo#32
at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45)
at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:108)
at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:74)
at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:794)
at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:772)
at org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:253)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
at $Proxy32.remove(Unknown Source)
at org.drools.persistence.jpa.JpaPersistenceContext.remove(JpaPersistenceContext.java:54)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalAbortWorkItem(JPAWorkItemManager.java:88)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.cancel(WorkItemNodeInstance.java:257)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:257)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:269)
at org.jbpm.process.instance.ProcessRuntimeImpl.abortProcessInstance(ProcessRuntimeImpl.java:371)
at org.drools.impl.StatefulKnowledgeSessionImpl.abortProcessInstance(StatefulKnowledgeSessionImpl.java:301)
at org.drools.command.runtime.process.AbortProcessInstanceCommand.execute(AbortProcessInstanceCommand.java:42)
at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:373)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.abortProcessInstance(CommandBasedStatefulKnowledgeSession.java:131)
{code}
-
3. Re: How to remove the process instance when the abort fails
swiderski.maciej Mar 29, 2013 12:39 PM (in response to akuppu)Looks like issue with transaction and persistence context, I see you use spring so might be some configuration issue.
HTH
-
4. Re: How to remove the process instance when the abort fails
jboss-at-rameder.com Jul 25, 2013 5:52 AM (in response to akuppu)Hi,
We faced the exact same problem. It seams the process engine sends an abort signal to each workItem (actually the fitting workItemHandler). Which is fine.
BUT: standard implentation of the HumanTaskWorkItemHandler would fail if you send abort ("exit"-command) to a completed task.
Fix:
Allow the exit-command on an already completed task and do nothing with it.
operations-dsl.mvel:
...
} ], Operation.Exit : [ new OperationCommand().{ status = [ Status.Created, Status.Ready, Status.Reserved, Status.InProgress, Status.Suspended ], allowed = [ Allowed.BusinessAdministrator ], newStatus = Status.Exited },new OperationCommand().{ status = [ Status.Completed ], allowed = [ Allowed.BusinessAdministrator ], newStatus = Status.Completed } ] ] ...
regards from Vienna
Edi
-
5. Re: How to remove the process instance when the abort fails
swiderski.maciej Jul 26, 2013 3:49 AM (in response to jboss-at-rameder.com)The issue with this is that it would be very misleading as you call exit on already completed tasks and then leaving the status as completed again. I would vote more for protecting the abort operation to not fail on such situation, meaning if the task is in different state than expected by exit command it should issue warning instead of failing on that.
Moreover there must be something wrong when you have task completed but the work item is not completed and thus process instance abort aborts the work item as well. That indicates that your process instance was not notified about task completion and thus remains in active state instead of being completed.
HTH