AnsweredAssumed Answered

Customizing exception alert 'Workflow could not be started'

Question asked by michalwrobel on May 29, 2012
Latest reply on Jun 12, 2012 by swemon
Hi,


I've created my own workflow with a java ServiceTask.
After filling initial form I do some checks in this ServiceTask and I throw exception of my own type (extending Exception) if something is wrong.

I want to customize the error message 'Workflow could not be started', which is passed to user.

I figured out that in AtomicOperationActivityExecute class exceptions of all types are caught and decorated with some additional text, so I made some amendments there
….
try {
      activityBehavior.execute(execution);
    } catch (RuntimeException e) {
      throw e;
    }
    catch (MyOwnException e)
    {
        throw new PvmException(e.getMessage());       
    }
    catch (Exception e) {
        throw new PvmException("couldn't execute activity <"+activity.getProperty("type")+" id=\""+activity.getId()+"\" …>: "+e.getMessage(), e);
    }


but I still get my message prefixed with runtime exception class name "org.activiti.engine.impl.pvm.PvmException:".
[img]http://dl.dropbox.com/u/1846654/error.jpg[/img]
I want just my exception message.

I tried to debug it further, but after the lines above 'magic' happens. I couldn't find any spot where the exception message is  concatenated with class name.

Is it somewhere in Spring/Surf code or in Share javascript? Could you please show me where should I look to change this behavior?

After a whole day with debugger I am stuck, any help will be appreciated :(

Outcomes