feat(element-template-generator): add placeholder support to @TemplateProperty#6879
feat(element-template-generator): add placeholder support to @TemplateProperty#6879gbetances089 wants to merge 1 commit intomainfrom
Conversation
Now that element-template-generator supports @TemplateProperty(placeholder), use it to show example model IDs in the Anthropic and Bedrock model fields instead of embedding them in the description or setting value to empty string. Also removes 'value: ""' from JSON templates - the generator omits the value field when defaultValue is blank, so this was inconsistent and won't survive regeneration. Depends on: #6879
There was a problem hiding this comment.
Pull request overview
Adds first-class placeholder support to the element-template generator so connector developers can declare placeholders via @TemplateProperty(placeholder = "..."), and fixes extraction of tooltip for class-based connectors to ensure it’s consistently emitted into generated element templates.
Changes:
- Extended
@TemplatePropertyplus the generator DSL model/builders to carry a newplaceholderfield (String/Text only per schema). - Updated annotation processing/utilities to extract and propagate
tooltip(bugfix) andplaceholderinto generated properties. - Updated tests and regenerated Agentic AI element templates to include placeholder output.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| element-template-generator/annotations/src/main/java/io/camunda/connector/generator/java/annotation/TemplateProperty.java | Adds placeholder() attribute to the annotation. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/Property.java | Adds placeholder to the DSL property model and exposes getter. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/PropertyBuilder.java | Adds builder support for placeholder. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/StringProperty.java | Threads placeholder through String property construction/build. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/TextProperty.java | Threads placeholder through Text property construction/build. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/BooleanProperty.java | Ensures placeholder remains null for non String/Text types. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/NumberProperty.java | Ensures placeholder remains null for non String/Text types. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/DropdownProperty.java | Ensures placeholder remains null for non String/Text types. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/HiddenProperty.java | Ensures placeholder remains null for non String/Text types. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/java/processor/TemplatePropertyAnnotationProcessor.java | Extracts tooltip (bugfix) and placeholder from @TemplateProperty. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/java/util/TemplatePropertiesUtil.java | Extracts and applies placeholder when building properties from fields. |
| element-template-generator/core/src/main/java/io/camunda/connector/generator/java/util/OperationBasedConnectorUtil.java | Passes placeholder for operation-based header properties. |
| element-template-generator/core/src/test/java/io/camunda/connector/generator/java/example/outbound/MyConnectorInput.java | Adds placeholder usage in test fixture annotation. |
| element-template-generator/core/src/test/java/io/camunda/connector/generator/java/OutboundClassBasedTemplateGeneratorTest.java | Adds test asserting placeholder is present in generated template. |
| connectors/agentic-ai/src/main/java/io/camunda/connector/agenticai/aiagent/model/request/provider/AnthropicProviderConfiguration.java | Adjusts model defaulting/description for template generation. |
| connectors/agentic-ai/src/main/java/io/camunda/connector/agenticai/aiagent/model/request/provider/BedrockProviderConfiguration.java | Adjusts model defaulting/description for template generation. |
| connectors/agentic-ai/element-templates/agenticai-aiagent-outbound-connector.json | Regenerated template JSON to include placeholders for model fields. |
| connectors/agentic-ai/element-templates/agenticai-aiagent-job-worker.json | Regenerated template JSON to include placeholders for model fields. |
| connectors/agentic-ai/element-templates/hybrid/agenticai-aiagent-outbound-connector-hybrid.json | Regenerated hybrid template JSON to include placeholders for model fields. |
| connectors/agentic-ai/element-templates/hybrid/agenticai-aiagent-job-worker-hybrid.json | Regenerated hybrid template JSON to include placeholders for model fields. |
Comments suppressed due to low confidence (4)
connectors/agentic-ai/element-templates/agenticai-aiagent-outbound-connector.json:764
- This property is marked
notEmpty: truebut the template sets"value": "". That can put the Modeler UI into an immediately-invalid state by default. If you want to require user input while showing a suggested value, omitvalueand use onlyplaceholder(or remove/relax thenotEmptyconstraint).
"id" : "provider.anthropic.model.model",
"label" : "Model",
"description" : "Specify the model ID. Details in the <a href=\"https://docs.anthropic.com/en/docs/about-claude/models/all-models\" target=\"_blank\">documentation</a>.",
"optional" : false,
"value" : "",
"placeholder" : "claude-3-5-sonnet-20240620",
"constraints" : {
"notEmpty" : true
},
"feel" : "optional",
"group" : "model",
connectors/agentic-ai/element-templates/agenticai-aiagent-outbound-connector.json:854
- This property is marked
notEmpty: truebut the template sets"value": "". That can put the Modeler UI into an immediately-invalid state by default. If you want to require user input while showing a suggested value, omitvalueand use onlyplaceholder(or remove/relax thenotEmptyconstraint).
"id" : "provider.bedrock.model.model",
"label" : "Model",
"description" : "Specify an inference profile ID. Details in the <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html\" target=\"_blank\">documentation</a>.",
"optional" : false,
"value" : "",
"placeholder" : "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
"constraints" : {
"notEmpty" : true
},
"feel" : "optional",
"group" : "model",
connectors/agentic-ai/element-templates/agenticai-aiagent-job-worker.json:786
- This property is marked
notEmpty: truebut the template sets"value": "". That can put the Modeler UI into an immediately-invalid state by default. If you want to require user input while showing a suggested value, omitvalueand use onlyplaceholder(or remove/relax thenotEmptyconstraint).
"label" : "Model",
"description" : "Specify the model ID. Details in the <a href=\"https://docs.anthropic.com/en/docs/about-claude/models/all-models\" target=\"_blank\">documentation</a>.",
"optional" : false,
"value" : "",
"placeholder" : "claude-3-5-sonnet-20240620",
"constraints" : {
"notEmpty" : true
},
"feel" : "optional",
"group" : "model",
"binding" : {
connectors/agentic-ai/element-templates/agenticai-aiagent-job-worker.json:875
- This property is marked
notEmpty: truebut the template sets"value": "". That can put the Modeler UI into an immediately-invalid state by default. If you want to require user input while showing a suggested value, omitvalueand use onlyplaceholder(or remove/relax thenotEmptyconstraint).
"id" : "provider.bedrock.model.model",
"label" : "Model",
"description" : "Specify an inference profile ID. Details in the <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html\" target=\"_blank\">documentation</a>.",
"optional" : false,
"value" : "",
"placeholder" : "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
"constraints" : {
"notEmpty" : true
},
"feel" : "optional",
"group" : "model",
...core/src/main/java/io/camunda/connector/generator/java/util/OperationBasedConnectorUtil.java
Show resolved
Hide resolved
element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/Property.java
Show resolved
Hide resolved
...munda/connector/agenticai/aiagent/model/request/provider/AnthropicProviderConfiguration.java
Outdated
Show resolved
Hide resolved
...camunda/connector/agenticai/aiagent/model/request/provider/BedrockProviderConfiguration.java
Outdated
Show resolved
Hide resolved
connectors/agentic-ai/element-templates/hybrid/agenticai-aiagent-outbound-connector-hybrid.json
Show resolved
Hide resolved
connectors/agentic-ai/element-templates/hybrid/agenticai-aiagent-outbound-connector-hybrid.json
Outdated
Show resolved
Hide resolved
connectors/agentic-ai/element-templates/hybrid/agenticai-aiagent-job-worker-hybrid.json
Show resolved
Hide resolved
connectors/agentic-ai/element-templates/hybrid/agenticai-aiagent-job-worker-hybrid.json
Outdated
Show resolved
Hide resolved
44ed251 to
dcb921b
Compare
maff
left a comment
There was a problem hiding this comment.
I couldn't completely follow why the change/fix for tooltip is needed (as I think it generally works?), but otherwise LGTM 👍
dcb921b to
b79c9a9
Compare
…eProperty Add support for the placeholder attribute so it can be declared via @TemplateProperty(placeholder = "...") and is correctly emitted in generated JSON element templates. The Zeebe element-template JSON schema supports a placeholder field for String and Text property types. The generator previously had no way to set it from Java annotations, forcing developers to manually add placeholder to generated JSON templates which would be overwritten on every regeneration. Also fixes a bug where @TemplateProperty(tooltip = "...") was silently discarded on class-based connectors by TemplatePropertyAnnotationProcessor. Closes #6878
b79c9a9 to
ebde5a9
Compare
Description
Adds
placeholdersupport to the element-template-generator so it can be declared via@TemplateProperty(placeholder = "...")Java annotations and is correctly emitted in generated JSON element templates.The Zeebe element-template JSON schema supports a
placeholderfield forStringandTextproperty types. Previously there was no way to set it from Java annotations — developers had to manually add"placeholder"to generated templates, which would be overwritten on every regeneration.Also fixes a silent bug:
@TemplateProperty(tooltip = "...")was declared in the annotation since its introduction but was never extracted byTemplatePropertyAnnotationProcessoron class-based connectors (it only worked via theOperationBasedConnectorUtilpath).Changes
element-template-generator/annotationsString placeholder() default ""to@TemplatePropertyelement-template-generator/core— DSL modelProperty: addplaceholderfield, constructor param,getPlaceholder()getterPropertyBuilder: addplaceholderfield and builder methodStringProperty,TextProperty: passplaceholderthrough constructor and builderBooleanProperty,NumberProperty,DropdownProperty,HiddenProperty: passnull(placeholder is only valid for String/Text per schema)element-template-generator/core— annotation processingTemplatePropertyAnnotationProcessor: extracttooltip(bugfix) andplaceholderfrom annotationTemplatePropertiesUtil: extract and passplaceholderOperationBasedConnectorUtil: passplaceholderalongside existingtooltipTests
MyConnectorInput: addplaceholder = "placeholder"to test annotationOutboundClassBasedTemplateGeneratorTest: addannotatedProperty_placeholderPresenttestRelated issues
Closes #6878
Checklist