I am trying to build a workflow, locally, on my Ubuntu 22.04, using JDK 21. The desktop modeller version is 5.30.0.
I have a simple workflow. It starts when a Webhook calls into it. The variables that the Webhook carries are “bucket” : “” and “document”: .
Once the Webhook is received, these two values are stored in process variables of the same name: bucket and document.
The Workflow simply passes these two, to an outbound HTTP connector. This is a Spring Boot based Java application running, at a known port. The process variables (two, mentioned above) are to be associated with the payload (POST) of this outbound HTTP connector. So, this is what I do (in the modeller):
I have assumed that the exchange is going to be this much only. But, that is not the case. The call to the outbound HTTP connector fails. The ‘operate’ web console tells me that HTTP connector has responded with a HTTP:400 (Bad request).
It is obvious from the picture that the Webhook has done its job correctly and the process variables indeed are initialized alright. But, the outbound HTTP connector isn’t happy!
The Spring Boot application gives a better and more compact hint of what has gone wrong:
no String-argument constructor/factory method to deserialize from String value ('{<EOL> "bucket": {{bucket}},<EOL> "document": "greetings.csv"<EOL>}')]
I have tried by hardcoding the values of those two variables on the modeller, and thus effectively bypassed the step of process variable substitution (using “{{ … }}”). Then the workflow runs till the end without a whimper.
Obviously, I am making some mistake in the syntax that passes process variables to HTTP payload.
BTW, I have used the following combinations in the Request Body:
{
"bucket": ${bucket},
"document": ${document}
}
{
"bucket": $bucket,
"document": $document
}
{
"bucket": bucket,
"document": document
}
None of these, works (has the same problem).
Could someone please give me a hint, where I am going wrong?
PS: I have referred to this post but it doesn’t mention the final answer.