Skip to content

feat(element-template-generator): add placeholder support to @TemplateProperty#6879

Open
gbetances089 wants to merge 1 commit intomainfrom
6878-placeholder-support-element-template-generator
Open

feat(element-template-generator): add placeholder support to @TemplateProperty#6879
gbetances089 wants to merge 1 commit intomainfrom
6878-placeholder-support-element-template-generator

Conversation

@gbetances089
Copy link
Copy Markdown
Member

Description

Adds placeholder support 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 placeholder field for String and Text property 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 by TemplatePropertyAnnotationProcessor on class-based connectors (it only worked via the OperationBasedConnectorUtil path).

Changes

element-template-generator/annotations

  • Add String placeholder() default "" to @TemplateProperty

element-template-generator/core — DSL model

  • Property: add placeholder field, constructor param, getPlaceholder() getter
  • PropertyBuilder: add placeholder field and builder method
  • StringProperty, TextProperty: pass placeholder through constructor and builder
  • BooleanProperty, NumberProperty, DropdownProperty, HiddenProperty: pass null (placeholder is only valid for String/Text per schema)

element-template-generator/core — annotation processing

  • TemplatePropertyAnnotationProcessor: extract tooltip (bugfix) and placeholder from annotation
  • TemplatePropertiesUtil: extract and pass placeholder
  • OperationBasedConnectorUtil: pass placeholder alongside existing tooltip

Tests

  • MyConnectorInput: add placeholder = "placeholder" to test annotation
  • OutboundClassBasedTemplateGeneratorTest: add annotatedProperty_placeholderPresent test

Related issues

Closes #6878

Checklist

  • Milestone set
  • Backport labels set (if applicable)

@gbetances089 gbetances089 requested review from a team as code owners April 2, 2026 14:45
gbetances089 added a commit that referenced this pull request Apr 2, 2026
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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @TemplateProperty plus the generator DSL model/builders to carry a new placeholder field (String/Text only per schema).
  • Updated annotation processing/utilities to extract and propagate tooltip (bugfix) and placeholder into 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: true but 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, omit value and use only placeholder (or remove/relax the notEmpty constraint).
    "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: true but 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, omit value and use only placeholder (or remove/relax the notEmpty constraint).
    "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: true but 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, omit value and use only placeholder (or remove/relax the notEmpty constraint).
    "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: true but 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, omit value and use only placeholder (or remove/relax the notEmpty constraint).
    "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",

@gbetances089 gbetances089 force-pushed the 6878-placeholder-support-element-template-generator branch from 44ed251 to dcb921b Compare April 2, 2026 15:00
@gbetances089 gbetances089 requested review from Copilot and removed request for a team April 2, 2026 15:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

@gbetances089 gbetances089 requested a review from a team April 7, 2026 06:29
Copy link
Copy Markdown
Member

@maff maff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't completely follow why the change/fix for tooltip is needed (as I think it generally works?), but otherwise LGTM 👍

@gbetances089 gbetances089 force-pushed the 6878-placeholder-support-element-template-generator branch from dcb921b to b79c9a9 Compare April 7, 2026 17:10
@gbetances089 gbetances089 requested a review from Szik April 7, 2026 17:10
…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
@gbetances089 gbetances089 force-pushed the 6878-placeholder-support-element-template-generator branch from b79c9a9 to ebde5a9 Compare April 8, 2026 07:17
@gbetances089 gbetances089 self-assigned this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add placeholder support to element-template-generator

5 participants