-
Notifications
You must be signed in to change notification settings - Fork 491
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
Boolean input without feel
property in a template throws an error
#4593
Comments
This problem can be mitigated by adding |
I think we should just make |
I had a look with @marstamm. The root cause is that certain properties must be FEEL expressions from the engine's point of view (e.g., input and output {
"name": "InputOutputParameter",
"properties": [
{
"name": "source",
"isAttr": true,
"type": "String"
},
{
"name": "target",
"isAttr": true,
"type": "String"
}
],
"meta": {
"feel": "required"
}
} Both bpmn-js-properties-panel and bpmn-js-element-templates would then read this information from the meta model. When adding a new property to the meta model the information that it must be a FEEL expression could be added without having to adjust the bpmn-js-properties-panel and bpmn-js-element-templates which could easily be forgotten. |
Sorry for a way too late feedback. So essentially you're proposing to shift the information on whether a property can/must be FEEL to the metamodel. At first sight, this sounds correct. We need to carefully consider whether it blocks any existing behaviors though. What if a property can be a FEEL expression in the engine, but an element template author wants it to be provided as plain text only? Is this a use case already? |
I did some digging and this is something that doesn't work at the moment. The
No error, but template doesn't show up: Since the template defines what the UI looks like we could convert whenever we find that the meta model requires a FEEL expression. We currently do this only when dealing with boolean and number values (cf. https://github.com/bpmn-io/bpmn-js-element-templates/blob/main/src/cloud-element-templates/util/FeelUtil.js#L1). |
After a second look, perhaps we could mitigate this with the validator? So instead of encoding the FEEL information in the meta-model, we could just outright reject the templates which don't contain the required feel property. |
We now customers running into this issue: https://jira.camunda.com/browse/SUPPORT-25273?atlLinkOrigin=c2xhY2staW50ZWdyYXRpb258aXNzdWU%3D |
Yes, this would be the most straight forward solution I think. This would mean that the affected element template would need a fix. |
This is the affected element template: https://github.com/camunda/connectors/blob/59eefdc4fe27048f1be1f52da2c764fe5211d32f/connectors/http/rest/element-templates/http-json-connector.json#L393 And this the property: {
"id" : "storeResponse",
"label" : "Store response",
"description" : "Store the response as a document in the document store",
"optional" : false,
"value" : false,
"group" : "endpoint",
"binding" : {
"name" : "storeResponse",
"type" : "zeebe:input"
},
"type" : "Boolean"
} |
The issue with adding a new condition that requires Not sure if this is a good idea. @barmac 👀 |
I've just verified with the engine that inputs and outputs have to be expressions regardless of the property type (text, number, boolean). If we pass a value which does not start with This means that even if we fix the top-comment bug and allow users to apply the template, they still won't be able to deploy the elements to the engine. So the proper solution is to make sure that the property value is set to a FEEL expression. There are essentially two possible ways to proceed:
The decision seems to be a trade-off between no magic and do the hard work to make it simple. However, if we frame the template developer expectation as plain UI when |
Turns out we attempted to fix this issue before: bpmn-io/bpmn-js-element-templates#121 The issue is that we added a casting mechanism but didn't enforce the |
@barmac I was able to deploy a process with <zeebe:ioMapping>
<zeebe:input source="true" target="invalid" />
<zeebe:input source="=true" target="valid" />
</zeebe:ioMapping> and according to Operate the value is cast to a string. 🤔 |
Furthermore, the docs seem to be incorrect: https://docs.camunda.io/docs/components/modeler/desktop-modeler/element-templates/defining-templates/#feel-static
should instead be _For Boolean and Number fields the value of |
OK so it fails for output only:
|
This implied that |
Yes, unless you template core |
My understanding is that for |
Yes, for correct handling it has to always be serialized to expression: |
Yes. Let's summarize what we found out:
A proper working versions for
For other properties ( |
Describe the bug
Applying this template causes an error to be thrown:
Error:
Steps to reproduce
Expected behavior
No error is thrown. Two options:
Environment
Additional context
Related to #4517, but it's a new issue.
SUPPORT-25273
The text was updated successfully, but these errors were encountered: