Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class DataMapperCreationBuilder extends NodeBuilder {
public static final String OUTPUT_LABEL = "Output";
public static final String OUTPUT_DOC = "Output type of the data mapper";

private static final String FUNCTION_NAME = "transform";

private static final Gson gson = new Gson();

public static final String RETURN_TYPE = TypeKind.ANYDATA.typeName();
Expand Down Expand Up @@ -84,6 +86,10 @@ protected String getNodeDefinitionFile() {
return DATA_MAPPER_DEFINITION_FILE;
}

protected String getFunctionName() {
return FUNCTION_NAME;
}

@Override
public void setConcreteConstData() {
metadata().label(LABEL).description(DESCRIPTION);
Expand All @@ -96,7 +102,7 @@ public static Property getParameterSchema() {

@Override
public void setConcreteTemplateData(TemplateContext context) {
properties().functionNameTemplate("transform", context.getAllVisibleSymbolNames(),
properties().functionNameTemplate(getFunctionName(), context.getAllVisibleSymbolNames(),
getNameLabel(), getNameDoc());

setMandatoryProperties(context, this, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class FunctionCreationBuilder extends DataMapperCreationBuilder {

private static final String FUNCTION_DEFINITION_FILE = "functions.bal";

private static final String FUNCTION_NAME = "function";

@Override
protected String getNameLabel() {
return FUNCTION_NAME_LABEL;
Expand Down Expand Up @@ -71,6 +73,11 @@ protected String getNodeDefinitionFile() {
return FUNCTION_DEFINITION_FILE;
}

@Override
protected String getFunctionName() {
return FUNCTION_NAME;
}

@Override
protected void endSourceGeneration(SourceBuilder sourceBuilder, String returnBody) {
sourceBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"selected": true
}
],
"value": "transform1",
"value": "function1",
"optional": false,
"editable": true,
"advanced": false,
Expand Down
Loading