2
votes

I have an Activiti workflow in my project. It contains several service tasks which perform not trivial logic and may fail due to multiple reasons.

I deploy Activiti as a REST standalone application.

When I call the Activiti REST API and it fails with some error it returns "500 Internal Server Error" without any details and to get the problem cause I need to check the logs.

I tried to store problem cause in process variables and to check these variables with an additional request after failure but it seems to be not right because this error may be overridden with consequent requests. (Concurrency issues)

So, could you please advise how to get the service task problem cause using Activiti REST API? It would be great to do it without additional requests.

1
Probably the best approach in your case is to roll your own API, complementing Activiti's native one in order to return the information you need. Please note that errors in asynchronous service tasks will not be "seen" by the initial call. - Philippe Sevestre
can you please be more specific in your problem? A snippet of code would be helpful. You can have boundary events, exception handlers in latest versions of activiti. - yaswanth
for example service task witj following code:{if (random % 2 == 0) throw new exception1() else throw new exception 2() } how can i know which specific exception was thrown via rest api? - evgeniy44

1 Answers

1
votes

I have written some code for activiti for exception logging, that will save any kind of exception that may occur in workflow into DB. This code is still not merged into activiti but you can use it for your testing purpose.

You can find the code here: https://github.com/anoopvrma/Activiti/tree/resume-process

This will give you enough details of exceptions.