Java Reference
In-Depth Information
Stopping a Process
Problem
You want to immediately end the execution of a process.
Solution
Use the <exit> activity.
Discussion
In general, you should have good fault handling defined in your process. There are many prob-
lematic situations that we as process developers can anticipate and handle gracefully. This is
no different from how we would work in any programming language with structured excep-
tion handling.
But there are times when something severe, something so outrageous happens that you want
to shut down the process immediately, ending all current activities, without compensating or
rolling back in-flight transactions, without performing error handling, and without notifying
any other process. To do this, you use the <exit> activity. It looks like this:
<if>
<condition>...
<else>
<condition>...
</else>
<elseif>
<exit />
</elseif>
</if>
There certainly are times when you are simply unable to handle a severe error on the server,
and may have few other options than to just stop the process. But keep in mind that this is
considered a serious, if not brutal, way to handle a flow. If you're thinking of using <exit> ,
put your Java programmer hat back on for a moment and consider how frequently you actu-
ally resort to Thread.stop or System.exit . (Hopefully not very often!)
Search WWH ::




Custom Search