Handle technical problem in http-connector

Hello there

What would be the right strategy to handle technical problems?
I do not want to model technical problems as a busuness BPNMError but as an Incident.

Let say I use “http-connector” to make a REST call.
I expect HTTP 200 as successful result.
If I have java.net.ConnectException, then the engine create an incident and describe the root problem correct.

But if server responded with HTTP 500 (or 404, or other NOK), I can verify connector.getVariable(“statusCode”) in script and throw Exception or Error, but camunda treat this exception as a root problem, i.e. “Problem during script execution” .
And evenmore if I try to model this behaviour in JUnit test, then I did not get an Incident but direct an javax.script.ScriptException during test execution.

What I would like to have an option to create the incident direct from script? (I do not have access to “execution” at the connector scope, i.e. during verification of the connector output variables)

You can access your script through the “connector.” Variable. But given your more complex requirements have you thought about creating your own java delegate? You can rebuild http connector as a java delegate in a few minutes of effort using local variables/input variables

Also take a look at this for other options/: Replacing Http-Connector with Jsoup usage

Hi

This thread may be of interest. In particular have a look at the comments regarding handling of errors. As @BerndRuecker says, its how you react to errors which determines how they should be treated…

regards

Rob