lordgamez commented on code in PR #1792:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1792#discussion_r1668752869


##########
CONFIGURE.md:
##########
@@ -121,8 +124,101 @@ It's recommended to create your configuration in YAML 
format or configure the ag
                 max concurrent tasks: 1
                 Properties:
 
+Besides YAML configuration format, MiNiFi C++ also supports JSON 
configuration. To see different uses cases in both formats, please refer to the 
[examples page](examples/README.md) for flow config examples.
+
 **NOTE:** Make sure to specify id for each component (Processor, Connection, 
Controller, RPG etc.) to make sure that Apache MiNiFi C++ can reload the state 
after a process restart. The id should be unique in the flow configuration.
 
+### Parameter Contexts
+
+Processor properties in flow configurations can be parameterized using 
parameters defined in parameter contexts. Flow configurations can define 
parameter contexts that define parameter-value pairs to be reused in the flow 
configuration as per the following rules:
+ - Parameters within a process group can only be used if the parameter context 
is assigned to that process group.
+ - Each process group can be assigned only one parameter context.
+ - Parameter contexts can be assigned to multiple process groups.
+ - The assigned parameter context has the scope of the process group, but not 
its child process groups.
+ - The parameters can be used in the flow configuration by using the 
`#{parameterName}` syntax for processor properties.
+ - Only alpha-numeric characters (a-z, A-Z, 0-9), hyphens ( - ), underscores ( 
_ ), periods ( . ), and spaces are allowed in parameter name.
+ - `#` character can be used to escape the parameter syntax. E.g. if the 
`parameterName` parameter's value is `xxx` then `#{parameterName}` will be 
replaced with `xxx`, `##{parameterName}` will be replaced with 
`#{parameterName}`, and `#####{parameterName}` will be replaced with `##xxx`.
+ - Parameters can only be used in values of non-sensitive processor properties.
+
+An example for using parameters in a JSON configuration file:
+
+```json
+{
+    "parameterContexts": [
+        {
+            "identifier": "804e6b47-ea22-45cd-a472-545801db98e6",
+            "name": "root-process-group-context",
+            "description": "Root process group parameter context",
+            "parameters": [
+                {
+                    "name": "tail_base_dir",
+                    "description": "Base dir of tailed files",
+                    "value": "/tmp/tail/file/path"
+                }
+            ]
+        }
+    ],
+    "rootGroup": {
+        "name": "MiNiFi Flow",
+        "processors": [
+            {
+                "name": "Tail test_file1.log",
+                "identifier": "83b58f9f-e661-4634-96fb-0e82b92becdf",
+                "type": "org.apache.nifi.minifi.processors.TailFile",
+                "schedulingStrategy": "TIMER_DRIVEN",
+                "schedulingPeriod": "1000 ms",
+                "properties": {
+                    "File to Tail": "#{tail_base_dir}/test_file1.log"
+                }
+            },
+            {
+                "name": "Tail test_file2.log",
+                "identifier": "8a772a10-7c34-48e7-b152-b1a32c5db83e",
+                "type": "org.apache.nifi.minifi.processors.TailFile",
+                "schedulingStrategy": "TIMER_DRIVEN",
+                "schedulingPeriod": "1000 ms",
+                "properties": {
+                    "File to Tail": "#{tail_base_dir}/test_file2.log"
+                }
+            }
+        ],
+        "parameterContextName": "root-process-group-context"

Review Comment:
   Yes, this works the same way in NiFi



-- 
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]

Reply via email to