Skip to content

Commit

Permalink
feat(element-templates): support metadata with keywords
Browse files Browse the repository at this point in the history
Related to #3089
  • Loading branch information
philippfromme committed Oct 8, 2024
1 parent 97c0e45 commit 1c6a1ac
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"name",
"id",
"description",
"metadata",
"documentationRef",
"version",
"category",
Expand All @@ -46,6 +47,7 @@ public record ElementTemplate(
int version,
String documentationRef,
String description,
Metadata metadata,
Set<String> appliesTo,
ElementTypeWrapper elementType,
List<PropertyGroup> groups,
Expand Down Expand Up @@ -117,6 +119,14 @@ public String schema() {
return SCHEMA_URL;
}

public static class Metadata {
List<String> keywords;

public Metadata(List<String> keywords) {
this.keywords = keywords;
}
}

@JsonInclude(Include.NON_NULL)
public record ElementTypeWrapper(
String value, String eventDefinition, @JsonIgnore BpmnType originalType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.camunda.connector.generator.dsl;

import io.camunda.connector.generator.dsl.ElementTemplate.ElementTypeWrapper;
import io.camunda.connector.generator.dsl.ElementTemplate.Metadata;
import io.camunda.connector.generator.dsl.Property.FeelMode;
import io.camunda.connector.generator.dsl.PropertyBinding.ZeebeProperty;
import io.camunda.connector.generator.dsl.PropertyBinding.ZeebeTaskDefinition;
Expand Down Expand Up @@ -47,6 +48,7 @@ private ElementTemplateBuilder(Mode mode) {
protected ElementTemplateIcon icon;
protected String documentationRef;
protected String description;
protected Metadata metadata;
protected Set<String> appliesTo;
protected BpmnType elementType;
protected final List<PropertyGroup> groups = new ArrayList<>();
Expand Down Expand Up @@ -149,6 +151,11 @@ public ElementTemplateBuilder description(String description) {
return this;
}

public ElementTemplateBuilder metadata(Metadata metadata) {
this.metadata = metadata;
return this;
}

public ElementTemplateBuilder appliesTo(Set<BpmnType> appliesTo) {
this.appliesTo = appliesTo.stream().map(BpmnType::getName).collect(Collectors.toSet());
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import io.camunda.connector.generator.dsl.DropdownProperty.DropdownChoice;
import io.camunda.connector.generator.dsl.ElementTemplate.Metadata;
import io.camunda.connector.generator.dsl.Property.FeelMode;
import io.camunda.connector.generator.dsl.PropertyBinding.ZeebeInput;
import io.camunda.connector.generator.dsl.PropertyBinding.ZeebeTaskHeader;
Expand Down Expand Up @@ -48,6 +49,7 @@ void serializationTest() throws Exception {
.documentationRef(
"https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/available-connectors-overview/")
.description("Describe this connector")
.metadata(new Metadata(List.of("foo", "bar")))
.propertyGroups(
PropertyGroup.builder()
.id("authentication")
Expand Down

0 comments on commit 1c6a1ac

Please sign in to comment.