Tough to answer without knowing process, the version you are using and the types of exceptions (business or system) you are trying to catch, and if you meant the subprocess activity or a process that is invoked by a parent process.
If you are using Oracle BPM 12c and have not done so already, you might want to start by reading these two excellent blogs by Antonis Antoniou:
Oracle BPM 12c Advanced Error Handling and Recovery - Part 1 https://community.oracle.com/docs/DOC-910406
Oracle BPM 12c Advanced Error Handling and Recovery - Part 2https://community.oracle.com/docs/DOC-913363
Oracle BPM 12c's exception handling is more flexible with its ability to catch exceptions in an event subprocess and then return the instance to the main process once it is handled using "back" or "skip". The new policy editor in 12c simplifies the handling of system exceptions at the composite level.
I know your question was specifically around handling exceptions in subprocesses, but you might want to clarify if you mean a "Subprocess" activity or a subprocess that is invoked. Know this is vague, but you meant a subprocess activity, both system and business exceptions can be handled by using boundary error events, or by letting it be caught by an event subprocess in the process. If it is a system exception, it also could (and probably should in most cases) be handled by a policy.
Thanks for your reply. This is a snapshot of my process.
Here am using 18.104.22.168.0
My intention is if any exception occurs when the instance arrives at human task or while processing the service task, it should be handled and and an mail notification to be triggered.
So, would like to know whether i am going in the right direction ?
Also, in the boundary events have checked catch all system exceptions, catch all business exceptions, recoverable error .
Tried creating an scenario where the person itself is not there in my realm, hence resulted in an exception. But unfortunately it wasn't handled.
So, raised this post to get suggestions for handling exceptions in a inline subprocess.
Thanks for the additional information.
Others might disagree, but going just from what I see in your process (and not all related to exception handling):
- In your subprocess that is in a loop, your two boundary events in the "project concept..." and "update Project ..." activities seem to be unnecessary because they are there to throw an exception at an error end event. You will have more flexibility if you just let the exceptions be thrown without catching them in boundary error events inside the subprocess.
- What exception is getting thrown in the User activity? If it is thrown due to the instance being assigned to someone who does not exist in your realm, there is a better way to handle this using a property in the human task. This would result in the person assigned to be the error handler for the human task receiving the emails you want to send out and eliminate the need for your boundary error event on the user activity. The way you have it now, the task would not be able to be handled. If you assign it instead to an error handler in the human task, the task can be reassigned to someone who does exist and you have not lost your task in this context.
- Probably just me, but unless they are management chain escalation approvals, I'd suggest modeling the "project concept..." user activity in a separate process as individual user activities. This would make it easily understood who is doing the work with the process swimlanes clearly defined. You would not be stuck using the default application roles defined by the swimlanes when you deploy the project (see Excluding Previous Lane Participants in Oracle BPM 12cExcluding Previous Lane Participants in Oracle BPM 12c and Dynamic Assignment of Human Task to a User, Application Role, and/or a Group ).
- Your Script activity at the end of the inline subprocess is probably unnecessary. One of the properties of the multi-instance inline subprocess allows and XPath expression to be added that defines when to break out of the subprocess early.
- Because you have a multi-instance loop, I'd suggest you prototype this using a simple example. My concern is that you are throwing exceptions from inside of a multi-instance subprocess to the main process. There are other approaches to what you are doing and it would be good to know if there are issues before you get too far down this path.
Thanks a lot for your detailed suggestions Dan.
Will try to implement as you suggested and will comeback if stuck anywhere.
Is that possible to share any sample example for handling exceptions in a subprocess. Request to share it.