Skip to content

Comments

Make the default name in function craetion node#729

Merged
KavinduZoysa merged 1 commit intoballerina-platform:1.7.xfrom
KavinduZoysa:fix-issue-2515
Feb 24, 2026
Merged

Make the default name in function craetion node#729
KavinduZoysa merged 1 commit intoballerina-platform:1.7.xfrom
KavinduZoysa:fix-issue-2515

Conversation

@KavinduZoysa
Copy link
Contributor

@KavinduZoysa KavinduZoysa commented Feb 23, 2026

Purpose

Addresses wso2/product-ballerina-integrator#2515

Summary

This pull request refactors the default naming mechanism for function creation nodes in the Ballerina flow model generator. The changes establish a consistent pattern for defining and retrieving default function names across different node types.

Changes

Core Implementation Updates:

  • Extract hardcoded function names into named constants (FUNCTION_NAME) in both the DataMapperCreationBuilder and FunctionCreationBuilder classes
  • Introduce a protected getFunctionName() method in DataMapperCreationBuilder that returns the constant, and override it in FunctionCreationBuilder to return "function" instead of the parent class default "transform"
  • This enables each builder class to define and maintain its own appropriate default function name

Test Data Updates:

  • Update the test configuration file to reflect the new default function name value ("function1" instead of "transform1") for function creation nodes

Intent

These changes improve code maintainability by centralizing default name definitions and create a flexible extension pattern. Subclasses can now easily override the default function name without relying on string literals scattered throughout the codebase. This addresses the inconsistency in default naming for function creation nodes and aligns with the intended behavior referenced in issue #2515.

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@KavinduZoysa KavinduZoysa merged commit 33c25a3 into ballerina-platform:1.7.x Feb 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants