I added handling of validation errors on process start using the withVariablesInReturn
as answered in my other question. Custom Exception Handling
Description of my Issue:
I complete a task form (custom frontend) using rest, which is followed by a syncron service task to validate user input. Now there is a problem with the data and i can throw a exception. That exception reaches my frontend as html exception, which can not be parsed. I do want a method to return json / or any other structured data describing the errors to the frontend.
Idea 1:
The user task complete sadly does not offer the withVariablesInReturn
option and camunda does not plan an adding it. -> Plans to add variable return on User Task Completion?
Idea 2:
Another method would be to offer us custom exceptions which can be returned as json from anywhere. But there are also no plans to add this: Limit number of concurrently running processes
Idea 3 (not good):
The only way i found that could work is to write a custom jax-rs app to wrap the engine-rest camunda api and adds a exception mapper. But i do don’t want to maintain a private jax-rs app just to add such a essential feature to the engine-rest
.
Are there any other ways (best-practice by camunda / no custom app) i’m unaware of or is there a public project for the jax-rs wrapper?
How did you handle this in your applications?
Kind Regards,
Philipp Heuer