BpmnError catching
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2015 04:04 AM
Hello everyone,
Please I need some advice from you. I have som processes, that are using the same service task to find supervisor(manager) for logged user in LDAP using delegate expression, because every process is an osgi bundle.
How can i catch an BpmnError an send this error to another task e.g. to it admins.
[IMG]http://i62.tinypic.com/2qx858m.jpg[/IMG]
Is it possible to catch error on a service task an send it to userTask, or i need to use another path in case some exception occurs?
Here is my service task
<code>
import java.util.List;
imports…
public class Supervisor implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
try {
FindSuperiorLogic();
} catch (Exception e) {
execution.setVariable("bpmError", e.toString());
throw new BpmnError("BusinessExceptionOccurred");
}
}
}
<code>
Error boundary event should catch the "BusinessExceptionOccurred" and go to usertask to fix the error.
Thanks a lot for help and advice
Please I need some advice from you. I have som processes, that are using the same service task to find supervisor(manager) for logged user in LDAP using delegate expression, because every process is an osgi bundle.
How can i catch an BpmnError an send this error to another task e.g. to it admins.
[IMG]http://i62.tinypic.com/2qx858m.jpg[/IMG]
Is it possible to catch error on a service task an send it to userTask, or i need to use another path in case some exception occurs?
Here is my service task
<code>
import java.util.List;
imports…
public class Supervisor implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
try {
FindSuperiorLogic();
} catch (Exception e) {
execution.setVariable("bpmError", e.toString());
throw new BpmnError("BusinessExceptionOccurred");
}
}
}
<code>
Error boundary event should catch the "BusinessExceptionOccurred" and go to usertask to fix the error.
Thanks a lot for help and advice
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2015 05:51 AM
Yes the Boundary error event should catch the error thrown from the service task. Isn't it working for you?
Best regards,
Best regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2015 06:08 AM
No, at the moment the process will start but no task is generated, maybe there is another problem with identityservice or ldap integration.
But if it should catch the error event then great. I read on the userguide that "Defining a boundary error event makes most sense on an embedded subprocess, or a call activity, as a subprocess creates a scope for all activities inside the subprocess. Errors are thrown by error end events. Such an error will propagate its parent scopes upwards until a scope is found on which a boundary error event is defined that matches the error event definition"
But if it should catch the error event then great. I read on the userguide that "Defining a boundary error event makes most sense on an embedded subprocess, or a call activity, as a subprocess creates a scope for all activities inside the subprocess. Errors are thrown by error end events. Such an error will propagate its parent scopes upwards until a scope is found on which a boundary error event is defined that matches the error event definition"
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2015 06:12 AM
Hi,
have a look on the following jUnit test in activiti source:
org.activiti.spring.test.servicetask.BoundaryErrorEventSpringTest
Regards
Martin
have a look on the following jUnit test in activiti source:
org.activiti.spring.test.servicetask.BoundaryErrorEventSpringTest
Regards
Martin
