pvillard31 commented on code in PR #11562:
URL: https://github.com/apache/nifi/pull/11562#discussion_r3893468477
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java:
##########
@@ -1810,14 +1812,31 @@ private void setEffectiveParameterUpdates(final
ParameterContextDTO parameterCon
parameterEntity =
dtoFactory.createParameterEntity(parameterContext, parameter, revisionManager,
parameterContextDAO);
}
- // Parameter is inherited if either this is the removal of a
parameter not directly in this context, or it's parameter not specified
directly in the DTO
- final boolean isInherited = (parameter == null &&
!parameterContext.getParameters().containsKey(new
ParameterDescriptor.Builder().name(parameterName).build()))
- || (parameter != null &&
!parameterEntities.containsKey(parameterName));
- parameterEntity.getParameter().setInherited(isInherited);
+ if (parameter == null) {
+ parameterEntity.getParameter().setInherited(!locallyOwned);
+ } else {
+ final ParameterContext containingParameterContext =
getContainingParameterContext(parameterContext, parameter, locallyOwned);
+ final boolean isInherited = !locallyOwned &&
!Objects.equals(parameterContext.getIdentifier(),
containingParameterContext.getIdentifier());
Review Comment:
This was a real issue in the initial implementation.
`getEffectiveParameterUpdates()` resolves `#{...}` references, so a locally
configured alias could have been added to the DTO using its resolved value
rather than preserving the configured reference.
I updated `setEffectiveParameterUpdates()` so that locally owned parameters
are represented using the raw parameter from the target context, while the
effective parameter is still used to determine the provided/inherited status
and source context. I also extended the repeated-analysis test with a local
alias and verified that its raw `#{...}` value and local provenance are
preserved across both passes. Inherited provider-backed parameters continue to
use their effective values.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]