cancel
Showing results for 
Search instead for 
Did you mean: 

managementService.getJobExceptionStacktrace

cirerenat
Champ in-the-making
Champ in-the-making
Is there a way to get the exception stacktrace  from the Runtimeservice similar to the managementService.getJobExceptionStacktrace ?


runtimeProcessId = runtimeService.startProcessInstanceByKey(processId,vars).getId();
// I want to see the access the stack trace if something went wrong.
// something like below
// runtimeService.getExceptionStacktrace( runtimeProcessId ) ;

is there a way to achieve this ?
3 REPLIES 3

cirerenat
Champ in-the-making
Champ in-the-making
new year, new hopes to get an answer  Smiley Happy Any suggestions ?

meyerd
Champ on-the-rise
Champ on-the-rise
Hi cirerenat,

Activiti uses the caller thread for doing its work. That means that if an exception occurs while executing
runtimeService.startProcessInstanceByKey(processId,vars);the method witll throw that exception.

So you can write code like:

try {
   runtimeService.startProcessInstanceByKey(processId,vars);
}catch(ActivitiException e) {
  // do sth about it
}

This is for processing of sync activities. All background work is not performed in the caller thread but by the job executor.
Exceptions for that can be retrieved using the ManagementService, as you already found out.

Read the userguide: http://activiti.org/userguide/index.html#N10562

cirerenat
Champ in-the-making
Champ in-the-making
Thanks Daniel,
Do I have to convert all of my ServiceTask and CallActivity task to asynchronous though ?
Because in my bpmn flow they are not, and in the exception handler when I try to use the management service I get an empty list for the below call.

List<Job> jobs = managementService.createJobQuery().list();
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.