Red Hat Bugzilla – Bug 976163
Cannot throw/propagate fault from BPMN process
Last modified: 2018-03-29 17:51:12 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.
David added this in 1.0.0.Final. I will let him link to the associated documentation and JIRA.
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:
To be clear, "FaultAction" = "throw" is the option.
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...
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!
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
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?
Please try again per my comment on 2013-09-18 12:49:50 EDT.