Skip to content

NIFI-15829 - Support parameter value references to parameters from inherited parameter contexts#11130

Merged
markap14 merged 5 commits into
apache:mainfrom
pvillard31:NIFI-15829
May 19, 2026
Merged

NIFI-15829 - Support parameter value references to parameters from inherited parameter contexts#11130
markap14 merged 5 commits into
apache:mainfrom
pvillard31:NIFI-15829

Conversation

@pvillard31
Copy link
Copy Markdown
Contributor

@pvillard31 pvillard31 commented Apr 12, 2026

Summary

NIFI-15829 - Support parameter value references to parameters from inherited parameter contexts

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@pvillard31 pvillard31 changed the title NIFI-15829 - Support parameter value references to provided parameters from inherited parameter contexts NIFI-15829 - Support parameter value references to parameters from inherited parameter contexts May 18, 2026
* @param value the parameter value to check
* @return the referenced parameter name if the value is a one-to-one reference, or null otherwise
*/
static String extractOneToOneParameterReference(final String value) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure that this util method should really be on the interface. It would make sense to pull this out into a separate util class.

if (value == null || value.length() < 4) {
return null;
}
if (value.startsWith("#{") && value.endsWith("}") && value.indexOf('}') == value.length() - 1) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a bit overly simplistic. It does not account for things like quoted parameter names. So it will work with #{MyParam} and properly catches issues like #{a}b}} But it misses cases like #{'My Parameter'}
We should instead probably make use of ExpressionLanguageAgnosticParameterParser, and do something along the lines of:

final ParameterParser parser = new ExpressionLanguageAgnosticParameterParser();
final ParameterTokenList tokenList = parser.parseTokens(value);
final List<ParameterToken> tokens = tokenList.toList();
if (tokens.size() != 1) {
  logger.warn("Invalid Parameter Reference: " + value);
}
final ParameterToken firstToken = tokens.getFirst();
if (!firstToken.isParameterReference()) {
  logger.warn("Invalid Parameter Reference: " + value);
}

return tokenList.toReferenceList().getFirst().getParameterName();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, fair, I went for the easiest approach but you're absolutely right, especially with provided parameters, we may have names where simple quoting will be cleaner.

Copy link
Copy Markdown
Contributor

@markap14 markap14 left a comment

Choose a reason for hiding this comment

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

Thanks @pvillard31 I think the approach makes sense. I did flag a couple of concerns about how we're handling the parsing specifically but otherwise I think this is a reasonable approach. It would probably also be good to go ahead and update the User Guide as well.

@pvillard31
Copy link
Copy Markdown
Contributor Author

Thanks @markap14 - I pushed a commit to address your comments

Copy link
Copy Markdown
Contributor

@markap14 markap14 left a comment

Choose a reason for hiding this comment

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

Thanks @pvillard31 changes look good to me. +1 will merge on successful Github Actions completions.

@markap14 markap14 merged commit c5fc02d into apache:main May 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants