Bug 976163 - Cannot throw/propagate fault from BPMN process [NEEDINFO]
Summary: Cannot throw/propagate fault from BPMN process
Keywords:
Status: MODIFIED
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: David Ward
QA Contact: Matej Melko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-20 04:02 UTC by Jiri Pechanec
Modified: 2023-05-15 19:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:
dward: needinfo? (jpechane)
kbabo: needinfo? (jpechane)


Attachments (Terms of Use)

Description Jiri Pechanec 2013-06-20 04:02:31 UTC
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 15:57:57 UTC
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 15:19:48 UTC
Fault mapping was added here:
https://issues.jboss.org/browse/SWITCHYARD-1554

Documentation for how to configure throwing a detected Fault is here:
https://docs.jboss.org/author/display/SWITCHYARD/BPM#BPM-SwitchYardServiceTask
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:
https://issues.jboss.org/browse/SWITCHYARD-1606

Comment 4 David Ward 2013-08-09 15:20:50 UTC
To be clear, "FaultAction" = "throw" is the option.

Comment 5 David Ward 2013-08-09 15:33:29 UTC
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-09 02:07:24 UTC
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 08:08:48 UTC
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 16:49:50 UTC
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 14:04:00 UTC
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.