Bug 1022833 - Fault stored in a BPM process is not always properly handled
Fault stored in a BPM process is not always properly handled
Status: ON_QA
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: Rules / jBPM integration (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ER1
: 6.3.0
Assigned To: Aileen
Matej Melko
Depends On:
  Show dependency treegraph
Reported: 2013-10-24 02:54 EDT by Jiri Pechanec
Modified: 2016-05-09 05:53 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In some cases, the MVEL expression in a BPM process extracts the 'fault' process variable contents and returns null instead of the value of the fault variable.
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Reproducer (28.49 KB, application/zip)
2013-10-24 02:54 EDT, Jiri Pechanec
no flags Details

  None (edit)
Description Jiri Pechanec 2013-10-24 02:54:08 EDT
The use case in question is having a service that is called from BPM which throws an exception (fault). This fault is stored in 'fault' process variable.

It is expected that at the end of the process when this variable is not null then the process generates fault.

The problem is that in some cases this does not work - see reproducer.

If you deploy the reproducer and send fail message - then the BPM service properly generates fault - see in log
08:41:20,835 INFO  [stdout] (Camel (camel-4) thread #5 - file:///home/jpechane/in) ############### Call result java.lang.reflect.UndeclaredThrowableException

But if you redeploy the application and send  -ok message you will see
06:58:49,823 INFO  [stdout] (Camel (camel-12) thread #13 - file:///home/jpechane/in) ############### Call result OrderAck [order=SimpleOrder [id=1, name=Sample Order 1, items=[OrderItem [sku=1, count=1, pricePerUnit=101.1], OrderItem [sku=11, count=2, pricePerUnit=202.2], OrderItem [sku=12, count=3, pricePerUnit=303.3], OrderItem [sku=13, count=4, pricePerUnit=404.4]], totalPrice=3032.999999999999914734871708787977695465087890625], accepted=true]

which is ok

and then if you send the fault message then you will see in the log
08:41:00,850 INFO  [stdout] (Camel (camel-3) thread #2 - file:///home/jpechane/in) ############### Call result null

I made some further investigation - the fault variable is properly filled but when MVEL expression is executed that extracts the variable contents it returns null instead of the fault.

Upon further investigation I found that in some cases the MVEL expression when compile will generate org.mvel2.optimizers.impl.refl.nodes.MapAccessor to get the value of the fault which works, but in another case generates org.mvel2.optimizers.impl.refl.nodes.VariableAccessor and this returns null even if variable contains something.
Comment 1 Jiri Pechanec 2013-10-24 02:54:43 EDT
Created attachment 815640 [details]
Comment 3 Anne-Louise Tangring 2014-06-19 14:42:28 EDT
This needs a corresponging BRMS issue for Rules/jBPM.
Comment 6 David Virgil 2015-08-03 08:23:04 EDT
It is working now. PR sent:


Note You need to log in before you can comment on or make changes to this bug.