Bug 976163 - Cannot throw/propagate fault from BPMN process [NEEDINFO]
Cannot throw/propagate fault from BPMN process
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: David Ward
Matej Melko
Depends On:
  Show dependency treegraph
Reported: 2013-06-20 00:02 EDT by Jiri Pechanec
Modified: 2018-03-29 17:51 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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: ---
dward: needinfo? (jpechane)
kbabo: needinfo? (jpechane)

Attachments (Terms of Use)

  None (edit)
Description Jiri Pechanec 2013-06-20 00:02:31 EDT
There is not an easy way how to throw or propagate a fault from BPMN process. Now the result of BPMN process is always put into message contents.

There should be either special mapping that will send a fault based on value of a parameter instead of just filling a message content.

Or much preferable way nicely integrated with BPMN - use one of the end events - probably error - to propagate an existing fault or throw a new one.
Comment 2 Keith Babo 2013-08-02 11:57:57 EDT
David added this in 1.0.0.Final.  I will let him link to the associated documentation and JIRA.
Comment 3 David Ward 2013-08-09 11:19:48 EDT
Fault mapping was added here:

Documentation for how to configure throwing a detected Fault is here:
Note that even though this is a visible config option for the "custom" SwitchYard Service Task, it is still a viable option for the "standard" BPMN2 Service Task.  You just have to set it as an I/O In parameter (as a literal expression value) on said Service Task.

Further, there is a jira for 1.1 that will make throwing an exception the default behavior when encountering Faults:
Comment 4 David Ward 2013-08-09 11:20:50 EDT
To be clear, "FaultAction" = "throw" is the option.
Comment 5 David Ward 2013-08-09 11:33:29 EDT
And..... I might have misunderstood.  The details I gave above are for throwing Faults from process tasks back up to the process.  Perhaps here we're instead talking about throwing faults out of the process itself.

If that's the case, the fault mapping documentation I gave would still work.  You can select a process instance variable that represent the fault by using the <fault from="faultExceptionVar" to="message.content"/>, and the handler processing should bubble that out as an exception from the bpm component itself.  That is to say, if the Fault object itself is an Exception.  To my understanding, sending the Fault in the message content *is* the "blessed" way to do things in SwitchYard.

Aside, wouldn't throwing a fault as part of an end event be basically the same thing?

We should probably have a meeting to discuss this further...
Comment 6 David Ward 2013-09-08 22:07:24 EDT
Please describe how the fault mapping capability described in the documentation does not sufficiently and easily allow someone to propagate a fault from a BPMN2 process out of SwitchYard.  Also, a sample SwitchYard application complete with BPMN2 which showcases the deficiency would be appreciated.  Thank you!
Comment 7 Jiri Pechanec 2013-09-18 04:08:48 EDT
I think that fault mapping as is now mentioned in the documentation is sufficient albeit not ideal.

Still I'd like to see (probably in future version) to have the ability to use BPMN2 end ERROR event in the process to generate a fault as it is better aligned with BPMN philosophy - but as I told it is probably RFE for next version.

Sorry for not providin an example - BPMN2 editor + SY task is throwing NPE right now :-(

See figure 5 in https://www.google.cz/url?sa=t&rct=j&q=&esrc=s&source=web&cd=25&ved=0CFUQFjAEOBQ&url=http%3A%2F%2Fwww.omgwiki.org%2Fbpmn2.0-ftf%2Flib%2Fexe%2Ffetch.php%3Fid%3Dpublic%253Asub-teams%253Aexamples%26cache%3Dcache%26media%3Dpublic%3Asub-teams%3Abpmn_2.0_by_example_version_alpha_8.pdf&ei=0F45Ur-3JdP20gXdioGACQ&usg=AFQjCNGAlR351BEvrBXtV0WYgNlpjgqj2g&sig2=UgSUvt4oB18UEg7tkwPubw&bvm=bv.52288139,d.d2k&cad=rja
Comment 8 David Ward 2013-09-18 12:49:50 EDT
I looked at figure 5. That *should* work with latest SwitchYard (1.1.0-SNAPSHOT). If you can get past your editor issues, give it a shot with the latest SwitchYard runtime (a Hudson build of 1.1.0-SNAPSHOT), please?
Comment 12 David Ward 2015-01-12 09:04:00 EST
Please try again per my comment on 2013-09-18 12:49:50 EDT.

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