[
https://issues.apache.org/jira/browse/NIFI-16616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153084#comment-18153084
]
ASF subversion and git services commented on NIFI-16616:
--------------------------------------------------------
Commit ba68915e4b67916952e206d5a1661c6f608561b5 in nifi's branch
refs/heads/main from Joe Witt
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=ba68915e4b6 ]
NIFI-16616 Resolve Parameters when evaluating Search Context properties (#11955)
* NIFI-16616 Use effective property values in StandardSearchContext
Co-authored-by: Cursor <[email protected]>
* NIFI-16616 Preserve raw Search Context values and resolve matching Parameters
on evaluation
Co-authored-by: Cursor <[email protected]>
* NIFI-16616 Clarify SensitivityMatchingParameterLookup Javadoc and assert
exact values in tests
Co-authored-by: Cursor <[email protected]>
---------
Co-authored-by: Cursor <[email protected]>
> Canvas search does not resolve Parameter Context values for Searchable
> processors (ExecuteScript Script File)
> -------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-16616
> URL: https://issues.apache.org/jira/browse/NIFI-16616
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 2.12.0
> Reporter: Joe Witt
> Assignee: Joe Witt
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Canvas search (GET /nifi-api/flow/search-results) logs FileNotFoundException
> for every ExecuteScript (and other Searchable scripting processors) whose
> Script File is parameterized, e.g. #{scripts.dir}/file.groovy.
> The processor runs correctly. FlowFiles are unaffected. Search resolves the
> path without the Parameter Context, so it tries to read /file.groovy.
> SearchableMatcher builds a StandardSearchContext. getProperty() wraps the raw
> configured value with ParameterLookup.EMPTY. ScriptingComponentUtils.search
> then calls evaluateAttributeExpressions() and opens that path. Runtime
> evaluation uses ProcessorNode.getParameterLookup(), which is the process
> group's Parameter Context.
> This is present on 2.7.2 and still present on main. It is a framework
> search-context bug, not a script-execution bug.
> Expected: Search substitutes Parameter Context values the same way
> scheduling/runtime does, then searches the script contents (or skips quietly
> if the file is absent).
> Actual: #{param} is stripped, the remaining path is opened, and each search
> logs an error.
> Fix: StandardSearchContext.getProperty should use
> processorNode.getParameterLookup() instead of ParameterLookup.EMPTY.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)