<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    How to handle failed processes/states due to server crashes?
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/mrinneL1">Michael Rinne</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/555485#555485">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Concerning exception handling, I saw that advice to take care of exceptions in the user code a couple of times in this forum, but I am not totally convinced that this is capable to handle all cases that arise in BPM.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Let us assume I have a process definition containing the sequence state1 -&gt; task1 -&gt; task2 -&gt; state2. Let us further assume there is some sort of dependency between task1 and task2, i.e. if task2 fails we have to perform some kind of undo for task1. If I handle exceptions within the user code for task2 I am not able to undo task1, because I do not want task2 to know about task1. For the same reason, I do not want to combine task1 and task2 into a single task.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The solution in jpdl 4 seems to be adding another transition from task2 to a task "undo_task1" and any exception in task2 will make sure that we take the transition to "undo_task1". Another transition from "undo_task1" will lead back to state1 and of course we add a decision in order to prevent processing from taking this circle endlessly.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>However, an <code>exception-handler </code>as provided by jpdl 3 seems to be a convenient way to handle most exceptions on a BPM scale, although it will most likely not be as flexible as the explicit solution sketched above.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>What are you opinions on this?</p><p>Does anyone have a better idea on how to do exception handling on BPM scale with jpdl 4?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks,</p><p>Michael</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/555485#555485">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>