Discussion:
[jboss-user] [jBPM] - How to remove the process instance when the abort fails
Ashok Kuppuswamy
2013-03-25 14:13:29 UTC
Permalink
Ashok Kuppuswamy [https://community.jboss.org/people/akuppu] created the discussion

"How to remove the process instance when the abort fails"

To view the discussion, visit: https://community.jboss.org/message/804617#804617

--------------------------------------------------------------
Because of a system error in the backend, some process instances went into some state that it's not able to proceed further.
I thought I should always be able to abort the process instance in the event something like this happens.
But in some cases abort process instance also fails and there seems to be no other way to get rid of that process instance.
I can paste the whole stack trace error here.

But I am just wondering if there is a alternate way to get rid of these like removing some entries in the backend.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/804617#804617]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-03-26 15:56:47 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to remove the process instance when the abort fails"

To view the discussion, visit: https://community.jboss.org/message/804883#804883

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/804883#804883]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Ashok Kuppuswamy
2013-03-27 17:05:07 UTC
Permalink
Ashok Kuppuswamy [https://community.jboss.org/people/akuppu] created the discussion

"Re: How to remove the process instance when the abort fails"

To view the discussion, visit: https://community.jboss.org/message/805081#805081

--------------------------------------------------------------
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)
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/805081#805081]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-03-29 16:39:16 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to remove the process instance when the abort fails"

To view the discussion, visit: https://community.jboss.org/message/805543#805543

--------------------------------------------------------------
Looks like issue with transaction and persistence context, I see you use spring so might be some configuration issue.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/805543#805543]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Eduard Rameder
2013-07-25 09:52:18 UTC
Permalink
Eduard Rameder [https://community.jboss.org/people/jboss-at-rameder.com] created the discussion

"Re: How to remove the process instance when the abort fails"

To view the discussion, visit: https://community.jboss.org/message/829689#829689

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829689#829689]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-07-26 07:49:39 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to remove the process instance when the abort fails"

To view the discussion, visit: https://community.jboss.org/message/829921#829921

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829921#829921]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...