I would like to write back a status information of my camunda workflow to an application which is located somewhere else (in my Cloud Foundry environment). I thought to do that via a PATCH/POST request to my target URL.
I would favor the second approach and “just” give it a second Client which is my target application and there invoke the post request including my variables which I want to write back. Is that approach recommendable or should I rather go with the first/another one?
The POST Call works fine.
After approving the workflow I now want to write everything inside my context (basically all variables) back to my app instance. Therefore I use a PATCH Call. I would like to write back the “status_wf” variable to my target App ( there the field is called equally "status_wf) The question in my scenario is - how can I assign either all variables from my workflow into my payload (Variable Assignment Values) or only the status_wf so it only updates the status_wf field in my target app?
The PATCH Request to the same URL in Postman works fine with the body {“status_wf” : “approved”}. How do I apply this body equally to my payload inside my service connector http task?
${variables} does not work - neither does ${status_wf} or ${variables.status_wf} or {“status_wf” : “approved”} work
You should have a Script for your payload input.
Then create a JS object with your status_wf property, and have the script return a stringified json object.
I tried many combinations within Type: inline Script and Format: javascript
could you perhaps provide some template codesnippet for the script part? like {“status” : “approved”}
I followed your advises: please see my header and payload which is a copy of my postman Headers and Body ( the body in Postman is: {“status_wf”:“approved”} ). In Postman it works fine.
I am still receiving the error:
{“error”:{“code”:“400”,“message”:“Invalid value “undefined” in content-type header. The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined.”}}
I am wondering what the cause of this is. the payload seems fine. If I am missing something in my headers I am wondering what it is. Do you have any idea?