Bug 1022833

Summary: Fault stored in a BPM process is not always properly handled
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Jiri Pechanec <jpechane>
Component: Rules / jBPM integrationAssignee: Aileen <aileenc>
Status: CLOSED UPSTREAM QA Contact: Matej Melko <mmelko>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: soa-p-jira
Target Milestone: ER1   
Target Release: 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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: Environment:
Last Closed: 2025-02-10 03:28:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Reproducer none

Description Jiri Pechanec 2013-10-24 06:54:08 UTC
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 06:54:43 UTC
Created attachment 815640 [details]
Reproducer

Comment 3 Anne-Louise Tangring 2014-06-19 18:42:28 UTC
This needs a corresponging BRMS issue for Rules/jBPM.

Comment 6 David Virgil 2015-08-03 12:23:04 UTC
It is working now. PR sent:

https://github.com/jboss-integration/fuse-bxms-integ/pull/96

Comment 10 Red Hat Bugzilla 2025-02-10 03:28:49 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.