Catch org.jbpm.workflow.instance.WorkflowRuntimeException with Error Boundary Event
marcj Jun 6, 2014 4:13 AMHI guys,
I'm recently working with error boundary events and already posted several questions regarding that topic. At the moment, I want to catch a org.jbpm.workflow.instance.WorkflowRuntimeException via a error boundary event. My setup is as follows:
- Sample process incorporates a custom web service task retrieving the current conversion rate between two currencies. Works fine.
- I now have attached an error boundary event to this service task.
- When throwing a java.lang.RuntimeException as OnEntry or OnExit operation, the approprate configured error boundary event gets triggered as expected.
- I now provoke a org.jbpm.workflow.instance.WorkflowRuntimeException by submitting an incorrect payload to the web service (currency code ABC, which does not exist)
- The updated error boundary event (catching exactly this error type) does not get triggered.
- Instead of that, I receive the following error message when initiating the process via the REST interface:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<status>FAILURE</status>
<error>[payments_PT_IRL.payments_PT_IRL:7.253 - Validate Payee IBAN:7] -- [payments_PT_IRL.payments_PT_IRL:7.253 - Get Exchange Rate:14] -- No enum constant net.webservicex.Currency.ABC</error>
<stackTrace>org.jbpm.workflow.instance.WorkflowRuntimeException: [payments_PT_IRL.payments_PT_IRL:7.253 - Validate Payee IBAN:7] -- [payments_PT_IRL.payments_PT_IRL:7.253 - Get Exchange Rate:14] -- No enum constant net.webservicex.Currency.ABC
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:135)
[...]
at java.lang.Thread.run(Thread.java:744)
Caused by: org.jbpm.workflow.instance.WorkflowRuntimeException: [payments_PT_IRL.payments_PT_IRL:7.253 - Get Exchange Rate:14] -- No enum constant net.webservicex.Currency.ABC
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:135)
[...]
... 89 more
Caused by: java.lang.IllegalArgumentException: No enum constant net.webservicex.Currency.ABC
at java.lang.Enum.valueOf(Enum.java:236)
at net.webservicex.Currency.valueOf(Currency.java:172)
at net.webservicex.Currency.fromValue(Currency.java:333)
at org.jbpm.payments.services.ExchangeRateWorkItemHandler.executeWorkItem(ExchangeRateWorkItemHandler.java:33)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:56)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:124)
... 131 more
</stackTrace>
</response>
- When changing the error boundary event to be triggered by a java.lang.IllegalArgumentException, I receive the following stack trace:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<status>FAILURE</status>
<error>[payments_PT_IRL.payments_PT_IRL:7.254 - Validate Payer IBAN:6] -- [payments_PT_IRL.payments_PT_IRL:7.254 - Get Exchange Rate:14] -- unable to execute Action</error>
<stackTrace>org.jbpm.workflow.instance.WorkflowRuntimeException: [payments_PT_IRL.payments_PT_IRL:7.254 - Validate Payer IBAN:6] -- [payments_PT_IRL.payments_PT_IRL:7.254 - Get Exchange Rate:14] -- unable to execute Action
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:135)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:155)
[...]
... 133 more
Caused by: java.lang.UnsupportedOperationException: Not supported yet.
at org.jbpm.payments.services.ExchangeRateWorkItemHandler.abortWorkItem(ExchangeRateWorkItemHandler.java:45)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalAbortWorkItem(JPAWorkItemManager.java:93)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.cancel(WorkItemNodeInstance.java:285)
at org.jbpm.process.instance.impl.CancelNodeInstanceAction.execute(CancelNodeInstanceAction.java:41)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.executeAction(NodeInstanceImpl.java:182)
... 142 more
</stackTrace>
</response>
I'm confuesed - can someone clarify that for me?
Thanks in advance!
Cheers,
MarcJ