-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration keys overwrite each other #47
Comments
I'll PR it in. |
Hey @jwulf, I'm not sure about the expected behavior you describe. Merging the custom headers with the variables was not intended originally. And it is nothing that is supported by the broker. Introducing this special logic only for this worker could be confusing for users. We will add advanced expression support in the broker that will allow to do this in the variable mappings without defining the task header (camunda/camunda#3417). |
Ar the moment you can merge headers and variables, but not in depth. Top-level keys overwrite everything when merged. The current naive implementation is here: This is in the body of the POST request. So I can either set the POST body via a custom header, or via an input variable mapping, but I cannot do both - because any input variable mapping I do overwrites the entire custom header object. This is a problem because the CAMUNDA-HTTP task cannot be specialised in the model where the specialisation requires a constant field in the POST body. It is so close right now. It means that - as it stands - if you create a message publishing task using the Camunda Cloud GitHub Message Publish Workflow, you can either specialise the task in the model, but send no variables in the message, or else you have to put the message name in the variable payload, which is pretty useless. |
See here for the use case. |
Configuration keys from variable mappings clobber those from custom headers when merged to form the body of a POST request. For example:
Custom Header:
body
:{event_type: "message", client_payload: {message_name: "THROW_YO"}}
Input Variable mapping:
test
:body.client_payload.test
Expected Output:
Actual output:
I expect a JSON merge. It's probably non-trivial to write in Java, but if you create a ScriptEngine you can have it convert the Maps to JSON and do an Object.assign.
"JavaScript: JSON done right"
The text was updated successfully, but these errors were encountered: