Hi,
could someone please help me with this simple scenario?
I have a rest call (with payload) using the http-connector. And I am tryint to pass the payload to the connector as a JSON object variable.
The problem is when I try to pass the payload (as a spin json object) to the connector the camunda will show this error:
org.camunda.spin.impl.json.jackson.JacksonJsonNode cannot be cast to java.lang.String
I can bypass this exception by creating the json object directly in the script as parameter, but in that case I will not see what was the payload in the cockpit (because there is no process var as payload).
Or another “solution” is to remove the SPIN (example below), but in that case the payload would be string and that is not ok (2000 char limitations).
Hi Aravindhrs,
I appreciate your time, but this won’t do the trick, the problem that I am trying to solve is not an invalid json format, the problem is that the http-connector does not accept the json object, as an input variable type for the payload parameter, it is only accepting the string.
Or did your proposal work when you tested it? It did not work for me, but maybe I have an incorrect version of camunda (tested it on comunity edition 7.11.0 and 7.9.0)
If you want to store it as a json string, it should be escaped json string format. You can’t store the json directly to engine. Have you tried below format?
Hi,
thank you again, but you can store json as a process variable and as I said, the problem is that the http connector does not accept the json as an input and for some reason it want a string. So the problem is not in storing variable as json in the engine, which is btw very common thing.
Hi,
sorry for the late reply, I only have this process, if you need to pass the payload as a variable we can try to figure it out (I remember that this was a problem) otherwise, the process is fully functional.