<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Dynamically Accessing Parameter Contexts Values in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371935#M241121</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/98065"&gt;@ChuckE&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for the details as they are very helpful.&lt;BR /&gt;The ValidateJson processor was a new community contribution to Apache NiFi in version 1.19.&lt;BR /&gt;&lt;A href="https://issues.apache.org/jira/browse/NIFI-7392" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-7392&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does not appear the processor supports dynamic Json Schema values a runtime. It requires exactly one resource.&lt;BR /&gt;I don't know if this was because of the "Schema Version" property aspect, where supporting dynamic Json could cause issues since each Json Schema may use different schema versions.&lt;BR /&gt;&lt;BR /&gt;I'd encourage you to create an Apache NiFi jira enhancement request for this component.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic"&gt;If you found that the provided solution(s) assisted you with your query, please take a moment to login and click&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Accept as Solution&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;below each response that helped.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;Matt&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2023 14:42:25 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2023-06-01T14:42:25Z</dc:date>
    <item>
      <title>Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/370903#M240848</link>
      <description>&lt;P&gt;I am storing several JSON Schemas as Parameter Contexts, and I need to access the schemas dynamically to validate flowfiles.&amp;nbsp; But which schema depends on the flowfile, so I want to access a particular schema in the Parameter Contexts dynamically using an attribute value.&amp;nbsp; How do I do that?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is what I've tried:&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;#{${schema.name}}&lt;/LI-CODE&gt;&lt;LI-CODE lang="python"&gt;${schema.name:evaluateELString()}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second technique I am using creates the exact string that I need&amp;nbsp;#{Blue_JSON_Schema}, and then I try to perform an eval on it.&amp;nbsp; But unfortunately it doesn't work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully someone knows how to do this.&amp;nbsp; Thanks for taking the time to read this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 14:42:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/370903#M240848</guid>
      <dc:creator>ChuckE</dc:creator>
      <dc:date>2023-05-16T14:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371074#M240889</link>
      <description>&lt;P&gt;I am having the same problem with version&amp;nbsp;&lt;SPAN&gt;1.20.0. I am using the advanced properties from "UpdateAttribute" to set up the attribute name to:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;s3_bucket&lt;BR /&gt;#{s3_my_bucket}&lt;/PRE&gt;&lt;DIV class="attribute-name"&gt;and then using it on my next processor:&lt;/DIV&gt;&lt;PRE&gt;s3_buc: ${s3_bucket:evaluateELString()}&lt;/PRE&gt;&lt;P&gt;And is not working, the value that I am getting is:&lt;/P&gt;&lt;PRE&gt;s3_buc&lt;BR /&gt;&lt;SPAN class="blank"&gt;Empty string set&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;This functionality used to work in prev. versions.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 09:37:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371074#M240889</guid>
      <dc:creator>Amnr</dc:creator>
      <dc:date>2023-05-18T09:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371786#M241086</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/98065"&gt;@ChuckE&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I would not expect this to work.&amp;nbsp; The "evaluateELString()" NiFi Expression Language (NEL) function triggers the evaluation of any NEL statements found in the subject passed to that function.&amp;nbsp; An NEL statement always starts with "${"; however, what you have is "#{" since you have a parameter context reference in your subject.&amp;nbsp; So the expected output would be the literal subject in your case.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Somewhere in your dataflow you are assigning the literal parameter name to a FlowFile Attribute. Why not evaluate the parameter rather then assign it as a literal string in an FlowFile attribute?&amp;nbsp; Perhaps some more context/details around your use case would help here?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 21:03:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371786#M241086</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2023-05-30T21:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371807#M241093</link>
      <description>&lt;P&gt;The concept is EXACTLY the same concept as using the AvroSchemaRegistry, which holds a bunch of schemas, and as each flowfile gets read by a single processor that uses a NiFi Recordset Reader/Writer service (e.g. ConvertRecord), they will individually reference their own schema.&amp;nbsp; Some are Red data, some are Blue data, and some are Purple data, and they each dynamically reference their corresponding Avro schema.&amp;nbsp; In fact, you can specify the "schema.name" attribute, which references said schema in the AvroSchemaRegistry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The premise of my inquiry is that I want to achieve something similar using JSON Schemas despite the fact there is no JSON Schema Registry.&amp;nbsp; So I want to use Parameter Context parameters to hold the schemas, then dynamically refer to them in a similar manner as we can do with Avro schemas.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 04:46:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371807#M241093</guid>
      <dc:creator>ChuckE</dc:creator>
      <dc:date>2023-05-31T04:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371866#M241105</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/98065"&gt;@ChuckE&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Understood.&amp;nbsp; What i am curious about is where in your dataflow do you implement the logic to determine which schema needs to be used?&lt;BR /&gt;&lt;BR /&gt;So you have some FlowFile with json content in your dataflow.&lt;BR /&gt;-&amp;nbsp; &amp;nbsp;You then need to determine which schema needs to go with this specific FlowFile's content.&amp;nbsp;&lt;BR /&gt;-&amp;nbsp; &amp;nbsp;Then you want to return that schema text from a parameter context.&lt;BR /&gt;&lt;BR /&gt;So how do you make that determination of what schema goes with which FlowFile?&amp;nbsp; Simply by where data was consumed from?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Have you considered using the "Advanced" UI of the updateAttribute to create rules based on how you make your determinations to add a new FlowFIle Attribute with the extracted schema from the parameter context(s)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 16:47:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371866#M241105</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2023-05-31T16:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371886#M241108</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exactly, the advanced feature in UpdateAtrributes is how we tag all in the incoming data.&amp;nbsp; Flowfile comes in and the &lt;STRONG&gt;schema.name&lt;/STRONG&gt; attribute gets set.&amp;nbsp; Then later down the line we do some validation on the data as it gets read into a NiFi Recordset object in conjunction with the AvroSchemaRegistry.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, we would like to switch to using JSON Schema, but the ValidateJSON processor doesn't support attribute references so the "JSON Schema" parameter needs to either the whole JSON Schema itself, or a hard-coded Parameter Context parameter reference.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What this means is that we need to use a separate ValidateJson processor for each JSON Schema (i.e. 20 schemas = 20 processors).&amp;nbsp; Ugh!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a very significant shortcoming of the ValidateJson processor and makes it unusable except for simple flows with homogenous data.&amp;nbsp; Hopefully there are plans to expand out its features.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached a couple of screenshots to help illustrate the problem.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-31 at 19.37.38.png" style="width: 754px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37701iAE4C29837D9BD02E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-31 at 19.37.38.png" alt="Screenshot 2023-05-31 at 19.37.38.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-31 at 19.36.01.png" style="width: 548px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37700i4EFF90C7F9BACBA6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-31 at 19.36.01.png" alt="Screenshot 2023-05-31 at 19.36.01.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-31 at 19.39.34.png" style="width: 561px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37699i0FB8E1706FBA3E21/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-31 at 19.39.34.png" alt="Screenshot 2023-05-31 at 19.39.34.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 00:52:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371886#M241108</guid>
      <dc:creator>ChuckE</dc:creator>
      <dc:date>2023-06-01T00:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371935#M241121</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/98065"&gt;@ChuckE&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for the details as they are very helpful.&lt;BR /&gt;The ValidateJson processor was a new community contribution to Apache NiFi in version 1.19.&lt;BR /&gt;&lt;A href="https://issues.apache.org/jira/browse/NIFI-7392" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-7392&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does not appear the processor supports dynamic Json Schema values a runtime. It requires exactly one resource.&lt;BR /&gt;I don't know if this was because of the "Schema Version" property aspect, where supporting dynamic Json could cause issues since each Json Schema may use different schema versions.&lt;BR /&gt;&lt;BR /&gt;I'd encourage you to create an Apache NiFi jira enhancement request for this component.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic"&gt;If you found that the provided solution(s) assisted you with your query, please take a moment to login and click&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;Accept as Solution&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;below each response that helped.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" color="#000000"&gt;Matt&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 14:42:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371935#M241121</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2023-06-01T14:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Accessing Parameter Contexts Values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371952#M241125</link>
      <description>&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/NIFI-11627" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-11627&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Idea.&amp;nbsp; Here is the reference.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 17:33:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Dynamically-Accessing-Parameter-Contexts-Values/m-p/371952#M241125</guid>
      <dc:creator>ChuckE</dc:creator>
      <dc:date>2023-06-01T17:33:51Z</dc:date>
    </item>
  </channel>
</rss>

