Skip to content

Instantly share code, notes, and snippets.

@mattyb149
Created March 17, 2016 20:34
Show Gist options
  • Save mattyb149/bd725cba2c34fb0f465f to your computer and use it in GitHub Desktop.
Save mattyb149/bd725cba2c34fb0f465f to your computer and use it in GitHub Desktop.
A NiFi template that iterates over child array elements in a JSON file, and filters on a specific property
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><template><description>This template uses SplitJson to split a JSON file by child array elements, then routes on certain values of the child's &quot;phone&quot; value.</description><name>IterateJsonArray</name><snippet><processGroups><id>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</id><parentGroupId>624b3e60-03e2-439f-8e68-9cdb2fc1e404</parentGroupId><position><x>-85.208424518031</x><y>-104.95458750260781</y></position><activeRemotePortCount>0</activeRemotePortCount><comments></comments><contents><connections><id>afffc4df-44e5-4ef9-b188-cefc622afc07</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPressureObjectThreshold><destination><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>4e82ff05-5ad6-43a8-a2ce-270c0fc1bc9a</id><type>PROCESSOR</type></destination><flowFileExpiration>0 sec</flowFileExpiration><labelIndex>1</labelIndex><name></name><selectedRelationships>matched</selectedRelationships><source><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>598c731f-6898-4b31-8f28-9831414ab0e2</id><type>PROCESSOR</type></source><zIndex>0</zIndex></connections><connections><id>ab35d68a-82c4-41f0-896f-72ce67f83b27</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPressureObjectThreshold><destination><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>598c731f-6898-4b31-8f28-9831414ab0e2</id><type>PROCESSOR</type></destination><flowFileExpiration>0 sec</flowFileExpiration><labelIndex>1</labelIndex><name></name><selectedRelationships>matched</selectedRelationships><source><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>3e004af3-cb94-400b-a198-909c621ac93d</id><type>PROCESSOR</type></source><zIndex>0</zIndex></connections><connections><id>ecc61515-940c-427d-8091-067f659eafc7</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPressureObjectThreshold><destination><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>f9a865a9-e1ff-42dd-9ad5-c87771997c07</id><type>PROCESSOR</type></destination><flowFileExpiration>0 sec</flowFileExpiration><labelIndex>1</labelIndex><name></name><selectedRelationships>success</selectedRelationships><source><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>24553122-3ff5-4e41-9e48-897275022fe2</id><type>PROCESSOR</type></source><zIndex>0</zIndex></connections><connections><id>42da58b2-bf0e-46a0-aba5-4f7b884efe00</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPressureObjectThreshold><destination><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>3e004af3-cb94-400b-a198-909c621ac93d</id><type>PROCESSOR</type></destination><flowFileExpiration>0 sec</flowFileExpiration><labelIndex>1</labelIndex><name></name><selectedRelationships>split</selectedRelationships><source><groupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</groupId><id>f9a865a9-e1ff-42dd-9ad5-c87771997c07</id><type>PROCESSOR</type></source><zIndex>0</zIndex></connections><processors><id>24553122-3ff5-4e41-9e48-897275022fe2</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><position><x>328.00001134807326</x><y>21.99998590129053</y></position><config><bulletinLevel>WARN</bulletinLevel><comments></comments><concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount><defaultConcurrentTasks><entry><key>TIMER_DRIVEN</key><value>1</value></entry><entry><key>EVENT_DRIVEN</key><value>0</value></entry><entry><key>CRON_DRIVEN</key><value>1</value></entry></defaultConcurrentTasks><defaultSchedulingPeriod><entry><key>TIMER_DRIVEN</key><value>0 sec</value></entry><entry><key>CRON_DRIVEN</key><value>* * * * * ?</value></entry></defaultSchedulingPeriod><descriptors><entry><key>Script Engine</key><value><allowableValues><displayName>ECMAScript</displayName><value>ECMAScript</value></allowableValues><allowableValues><displayName>Groovy</displayName><value>Groovy</value></allowableValues><allowableValues><displayName>lua</displayName><value>lua</value></allowableValues><allowableValues><displayName>python</displayName><value>python</value></allowableValues><allowableValues><displayName>ruby</displayName><value>ruby</value></allowableValues><defaultValue>ECMAScript</defaultValue><description>The engine to execute scripts</description><displayName>Script Engine</displayName><dynamic>false</dynamic><name>Script Engine</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Script File</key><value><description>Path to script file to execute. Only one of Script File or Script Body may be used</description><displayName>Script File</displayName><dynamic>false</dynamic><name>Script File</name><required>false</required><sensitive>false</sensitive><supportsEl>true</supportsEl></value></entry><entry><key>Script Body</key><value><description>Body of script to execute. Only one of Script File or Script Body may be used</description><displayName>Script Body</displayName><dynamic>false</dynamic><name>Script Body</name><required>false</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Module Directory</key><value><description>Comma-separated list of paths to files and/or directories which contain modules required by the script.</description><displayName>Module Directory</displayName><dynamic>false</dynamic><name>Module Directory</name><required>false</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>File Content</key><value><description>The content for the generated flow file</description><displayName>File Content</displayName><dynamic>false</dynamic><name>File Content</name><required>false</required><sensitive>false</sensitive><supportsEl>true</supportsEl></value></entry><entry><key>Evaluate Expressions in Content</key><value><allowableValues><displayName>true</displayName><value>true</value></allowableValues><allowableValues><displayName>false</displayName><value>false</value></allowableValues><defaultValue>false</defaultValue><description>Whether to evaluate NiFi Expression Language constructs within the content</description><displayName>Evaluate Expressions in Content</displayName><dynamic>false</dynamic><name>Evaluate Expressions in Content</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Filename</key><value><description>The name of the flow file to be stored in the filename attribute</description><displayName>Filename</displayName><dynamic>false</dynamic><name>Filename</name><required>false</required><sensitive>false</sensitive><supportsEl>true</supportsEl></value></entry></descriptors><lossTolerant>false</lossTolerant><penaltyDuration>30 sec</penaltyDuration><properties><entry><key>Script Engine</key><value>Groovy</value></entry><entry><key>Script File</key></entry><entry><key>Script Body</key><value>class GenerateFlowFileWithContent implements Processor {
def REL_SUCCESS = new Relationship.Builder()
.name('success')
.description('The flow file with the specified content and/or filename was successfully transferred')
.build();
def CONTENT = new PropertyDescriptor.Builder()
.name('File Content').description('The content for the generated flow file')
.required(false).expressionLanguageSupported(true).addValidator(Validator.VALID).build()
def CONTENT_HAS_EL = new PropertyDescriptor.Builder()
.name('Evaluate Expressions in Content').description('Whether to evaluate NiFi Expression Language constructs within the content')
.required(true).allowableValues('true','false').defaultValue('false').build()
def FILENAME = new PropertyDescriptor.Builder()
.name('Filename').description('The name of the flow file to be stored in the filename attribute')
.required(false).expressionLanguageSupported(true).addValidator(StandardValidators.NON_EMPTY_VALIDATOR).build()
@Override
void initialize(ProcessorInitializationContext context) { }
@Override
Set&lt;Relationship&gt; getRelationships() { return [REL_SUCCESS] as Set }
@Override
void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {
try {
def session = sessionFactory.createSession()
def flowFile = session.create()
def hasEL = context.getProperty(CONTENT_HAS_EL).asBoolean()
def contentProp = context.getProperty(CONTENT)
def content = (hasEL ? contentProp.evaluateAttributeExpressions().value : contentProp.value) ?: ''
def filename = context.getProperty(FILENAME)?.evaluateAttributeExpressions()?.getValue()
flowFile = session.write(flowFile, { outStream -&gt;
outStream.write(content.getBytes(&quot;UTF-8&quot;))
} as OutputStreamCallback)
if(filename != null) { flowFile = session.putAttribute(flowFile, 'filename', filename) }
// transfer
session.transfer(flowFile, REL_SUCCESS)
session.commit()
} catch(e) {
throw new ProcessException(e)
}
}
@Override
Collection&lt;ValidationResult&gt; validate(ValidationContext context) { return null }
@Override
PropertyDescriptor getPropertyDescriptor(String name) {
switch(name) {
case 'File Content': return CONTENT
case 'Evaluate Expressions in Content': return CONTENT_HAS_EL
case 'Filename': return FILENAME
default: return null
}
}
@Override
void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { }
@Override
List&lt;PropertyDescriptor&gt; getPropertyDescriptors() { return [CONTENT, CONTENT_HAS_EL, FILENAME] as List }
@Override
String getIdentifier() { return 'GenerateFlowFile-InvokeScriptedProcessor' }
}
processor = new GenerateFlowFileWithContent()</value></entry><entry><key>Module Directory</key></entry><entry><key>File Content</key><value>{
&quot;Parent&quot;: {
&quot;Childrens&quot;: {
&quot;Child&quot;: [
{
&quot;Phone&quot;: 1
},
{
&quot;Phone&quot;: 111
},
{
&quot;Phone&quot;: 10
}
]
}
}
}</value></entry><entry><key>Evaluate Expressions in Content</key><value>false</value></entry><entry><key>Filename</key><value>input.json</value></entry></properties><runDurationMillis>0</runDurationMillis><schedulingPeriod>3 sec</schedulingPeriod><schedulingStrategy>TIMER_DRIVEN</schedulingStrategy><yieldDuration>1 sec</yieldDuration></config><name>GenerateFlowFileWithContent</name><relationships><autoTerminate>false</autoTerminate><description>The flow file with the specified content and/or filename was successfully transferred</description><name>success</name></relationships><state>STOPPED</state><style/><supportsEventDriven>false</supportsEventDriven><supportsParallelProcessing>true</supportsParallelProcessing><type>org.apache.nifi.processors.script.InvokeScriptedProcessor</type></processors><processors><id>3e004af3-cb94-400b-a198-909c621ac93d</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><position><x>338.1269675171894</x><y>321.91097472329795</y></position><config><bulletinLevel>WARN</bulletinLevel><comments></comments><concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount><defaultConcurrentTasks><entry><key>TIMER_DRIVEN</key><value>1</value></entry><entry><key>EVENT_DRIVEN</key><value>0</value></entry><entry><key>CRON_DRIVEN</key><value>1</value></entry></defaultConcurrentTasks><defaultSchedulingPeriod><entry><key>TIMER_DRIVEN</key><value>0 sec</value></entry><entry><key>CRON_DRIVEN</key><value>* * * * * ?</value></entry></defaultSchedulingPeriod><descriptors><entry><key>Destination</key><value><allowableValues><displayName>flowfile-content</displayName><value>flowfile-content</value></allowableValues><allowableValues><displayName>flowfile-attribute</displayName><value>flowfile-attribute</value></allowableValues><defaultValue>flowfile-content</defaultValue><description>Indicates whether the results of the JsonPath evaluation are written to the FlowFile content or a FlowFile attribute; if using attribute, must specify the Attribute Name property. If set to flowfile-content, only one JsonPath may be specified, and the property name is ignored.</description><displayName>Destination</displayName><dynamic>false</dynamic><name>Destination</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Return Type</key><value><allowableValues><displayName>auto-detect</displayName><value>auto-detect</value></allowableValues><allowableValues><displayName>json</displayName><value>json</value></allowableValues><allowableValues><displayName>scalar</displayName><value>scalar</value></allowableValues><defaultValue>auto-detect</defaultValue><description>Indicates the desired return type of the JSON Path expressions. Selecting 'auto-detect' will set the return type to 'json' for a Destination of 'flowfile-content', and 'scalar' for a Destination of 'flowfile-attribute'.</description><displayName>Return Type</displayName><dynamic>false</dynamic><name>Return Type</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Path Not Found Behavior</key><value><allowableValues><displayName>warn</displayName><value>warn</value></allowableValues><allowableValues><displayName>ignore</displayName><value>ignore</value></allowableValues><defaultValue>ignore</defaultValue><description>Indicates how to handle missing JSON path expressions when destination is set to 'flowfile-attribute'. Selecting 'warn' will generate a warning when a JSON path expression is not found.</description><displayName>Path Not Found Behavior</displayName><dynamic>false</dynamic><name>Path Not Found Behavior</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Null Value Representation</key><value><allowableValues><displayName>empty string</displayName><value>empty string</value></allowableValues><allowableValues><displayName>the string 'null'</displayName><value>the string 'null'</value></allowableValues><defaultValue>empty string</defaultValue><description>Indicates the desired representation of JSON Path expressions resulting in a null value.</description><displayName>Null Value Representation</displayName><dynamic>false</dynamic><name>Null Value Representation</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>phone</key><value><description></description><displayName>phone</displayName><dynamic>true</dynamic><name>phone</name><required>false</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry></descriptors><lossTolerant>false</lossTolerant><penaltyDuration>30 sec</penaltyDuration><properties><entry><key>Destination</key><value>flowfile-attribute</value></entry><entry><key>Return Type</key></entry><entry><key>Path Not Found Behavior</key></entry><entry><key>Null Value Representation</key></entry><entry><key>phone</key><value>$.Phone</value></entry></properties><runDurationMillis>0</runDurationMillis><schedulingPeriod>0 sec</schedulingPeriod><schedulingStrategy>TIMER_DRIVEN</schedulingStrategy><yieldDuration>1 sec</yieldDuration></config><name>EvaluateJsonPath</name><relationships><autoTerminate>true</autoTerminate><description>FlowFiles are routed to this relationship when the JsonPath cannot be evaluated against the content of the FlowFile; for instance, if the FlowFile is not valid JSON</description><name>failure</name></relationships><relationships><autoTerminate>false</autoTerminate><description>FlowFiles are routed to this relationship when the JsonPath is successfully evaluated and the FlowFile is modified as a result</description><name>matched</name></relationships><relationships><autoTerminate>true</autoTerminate><description>FlowFiles are routed to this relationship when the JsonPath does not match the content of the FlowFile and the Destination is set to flowfile-content</description><name>unmatched</name></relationships><state>STOPPED</state><style/><supportsEventDriven>true</supportsEventDriven><supportsParallelProcessing>true</supportsParallelProcessing><type>org.apache.nifi.processors.standard.EvaluateJsonPath</type></processors><processors><id>4e82ff05-5ad6-43a8-a2ce-270c0fc1bc9a</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><position><x>343.0222586625264</x><y>635.511582580978</y></position><config><bulletinLevel>WARN</bulletinLevel><comments></comments><concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount><defaultConcurrentTasks><entry><key>TIMER_DRIVEN</key><value>1</value></entry><entry><key>EVENT_DRIVEN</key><value>0</value></entry><entry><key>CRON_DRIVEN</key><value>1</value></entry></defaultConcurrentTasks><defaultSchedulingPeriod><entry><key>TIMER_DRIVEN</key><value>0 sec</value></entry><entry><key>CRON_DRIVEN</key><value>* * * * * ?</value></entry></defaultSchedulingPeriod><descriptors><entry><key>Log Level</key><value><allowableValues><displayName>trace</displayName><value>trace</value></allowableValues><allowableValues><displayName>debug</displayName><value>debug</value></allowableValues><allowableValues><displayName>info</displayName><value>info</value></allowableValues><allowableValues><displayName>warn</displayName><value>warn</value></allowableValues><allowableValues><displayName>error</displayName><value>error</value></allowableValues><defaultValue>info</defaultValue><description>The Log Level to use when logging the Attributes</description><displayName>Log Level</displayName><dynamic>false</dynamic><name>Log Level</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Log Payload</key><value><allowableValues><displayName>true</displayName><value>true</value></allowableValues><allowableValues><displayName>false</displayName><value>false</value></allowableValues><defaultValue>false</defaultValue><description>If true, the FlowFile's payload will be logged, in addition to its attributes; otherwise, just the Attributes will be logged.</description><displayName>Log Payload</displayName><dynamic>false</dynamic><name>Log Payload</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Attributes to Log</key><value><description>A comma-separated list of Attributes to Log. If not specified, all attributes will be logged.</description><displayName>Attributes to Log</displayName><dynamic>false</dynamic><name>Attributes to Log</name><required>false</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Attributes to Ignore</key><value><description>A comma-separated list of Attributes to ignore. If not specified, no attributes will be ignored.</description><displayName>Attributes to Ignore</displayName><dynamic>false</dynamic><name>Attributes to Ignore</name><required>false</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Log prefix</key><value><description>Log prefix appended to the log lines. It helps to distinguish the output of multiple LogAttribute processors.</description><displayName>Log prefix</displayName><dynamic>false</dynamic><name>Log prefix</name><required>false</required><sensitive>false</sensitive><supportsEl>true</supportsEl></value></entry></descriptors><lossTolerant>false</lossTolerant><penaltyDuration>30 sec</penaltyDuration><properties><entry><key>Log Level</key></entry><entry><key>Log Payload</key></entry><entry><key>Attributes to Log</key></entry><entry><key>Attributes to Ignore</key></entry><entry><key>Log prefix</key></entry></properties><runDurationMillis>0</runDurationMillis><schedulingPeriod>0 sec</schedulingPeriod><schedulingStrategy>TIMER_DRIVEN</schedulingStrategy><yieldDuration>1 sec</yieldDuration></config><name>LogAttribute</name><relationships><autoTerminate>true</autoTerminate><description>All FlowFiles are routed to this relationship</description><name>success</name></relationships><state>STOPPED</state><style/><supportsEventDriven>true</supportsEventDriven><supportsParallelProcessing>true</supportsParallelProcessing><type>org.apache.nifi.processors.standard.LogAttribute</type></processors><processors><id>f9a865a9-e1ff-42dd-9ad5-c87771997c07</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><position><x>336.00001134807326</x><y>185.99998590129053</y></position><config><bulletinLevel>WARN</bulletinLevel><comments></comments><concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount><defaultConcurrentTasks><entry><key>TIMER_DRIVEN</key><value>1</value></entry><entry><key>EVENT_DRIVEN</key><value>0</value></entry><entry><key>CRON_DRIVEN</key><value>1</value></entry></defaultConcurrentTasks><defaultSchedulingPeriod><entry><key>TIMER_DRIVEN</key><value>0 sec</value></entry><entry><key>CRON_DRIVEN</key><value>* * * * * ?</value></entry></defaultSchedulingPeriod><descriptors><entry><key>JsonPath Expression</key><value><description>A JsonPath expression that indicates the array element to split into JSON/scalar fragments.</description><displayName>JsonPath Expression</displayName><dynamic>false</dynamic><name>JsonPath Expression</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>Null Value Representation</key><value><allowableValues><displayName>empty string</displayName><value>empty string</value></allowableValues><allowableValues><displayName>the string 'null'</displayName><value>the string 'null'</value></allowableValues><defaultValue>empty string</defaultValue><description>Indicates the desired representation of JSON Path expressions resulting in a null value.</description><displayName>Null Value Representation</displayName><dynamic>false</dynamic><name>Null Value Representation</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry></descriptors><lossTolerant>false</lossTolerant><penaltyDuration>30 sec</penaltyDuration><properties><entry><key>JsonPath Expression</key><value>$.Parent.Childrens.Child</value></entry><entry><key>Null Value Representation</key></entry></properties><runDurationMillis>0</runDurationMillis><schedulingPeriod>0 sec</schedulingPeriod><schedulingStrategy>TIMER_DRIVEN</schedulingStrategy><yieldDuration>1 sec</yieldDuration></config><name>SplitJson</name><relationships><autoTerminate>true</autoTerminate><description>If a FlowFile fails processing for any reason (for example, the FlowFile is not valid JSON or the specified path does not exist), it will be routed to this relationship</description><name>failure</name></relationships><relationships><autoTerminate>true</autoTerminate><description>The original FlowFile that was split into segments. If the FlowFile fails processing, nothing will be sent to this relationship</description><name>original</name></relationships><relationships><autoTerminate>false</autoTerminate><description>All segments of the original FlowFile will be routed to this relationship</description><name>split</name></relationships><state>STOPPED</state><style/><supportsEventDriven>true</supportsEventDriven><supportsParallelProcessing>true</supportsParallelProcessing><type>org.apache.nifi.processors.standard.SplitJson</type></processors><processors><id>598c731f-6898-4b31-8f28-9831414ab0e2</id><parentGroupId>b45c83bf-615d-4a54-8b92-cc4b9ccb730d</parentGroupId><position><x>338.9944571488545</x><y>471.5282451786343</y></position><config><bulletinLevel>WARN</bulletinLevel><comments></comments><concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount><defaultConcurrentTasks><entry><key>TIMER_DRIVEN</key><value>1</value></entry><entry><key>EVENT_DRIVEN</key><value>0</value></entry><entry><key>CRON_DRIVEN</key><value>1</value></entry></defaultConcurrentTasks><defaultSchedulingPeriod><entry><key>TIMER_DRIVEN</key><value>0 sec</value></entry><entry><key>CRON_DRIVEN</key><value>* * * * * ?</value></entry></defaultSchedulingPeriod><descriptors><entry><key>Routing Strategy</key><value><allowableValues><description>A copy of the FlowFile will be routed to each relationship whose corresponding expression evaluates to 'true'</description><displayName>Route to Property name</displayName><value>Route to Property name</value></allowableValues><allowableValues><description>Requires that all user-defined expressions evaluate to 'true' for the FlowFile to be considered a match</description><displayName>Route to 'matched' if all match</displayName><value>Route to 'match' if all match</value></allowableValues><allowableValues><description>Requires that at least one user-defined expression evaluate to 'true' for hte FlowFile to be considered a match</description><displayName>Route to 'matched' if any matches</displayName><value>Route to 'match' if any matches</value></allowableValues><defaultValue>Route to Property name</defaultValue><description>Specifies how to determine which relationship to use when evaluating the Expression Language</description><displayName>Routing Strategy</displayName><dynamic>false</dynamic><name>Routing Strategy</name><required>true</required><sensitive>false</sensitive><supportsEl>false</supportsEl></value></entry><entry><key>phonematch</key><value><description></description><displayName>phonematch</displayName><dynamic>true</dynamic><name>phonematch</name><required>false</required><sensitive>false</sensitive><supportsEl>true</supportsEl></value></entry></descriptors><lossTolerant>false</lossTolerant><penaltyDuration>30 sec</penaltyDuration><properties><entry><key>Routing Strategy</key><value>Route to 'match' if all match</value></entry><entry><key>phonematch</key><value>${phone:equals(&quot;111&quot;)}</value></entry></properties><runDurationMillis>0</runDurationMillis><schedulingPeriod>0 sec</schedulingPeriod><schedulingStrategy>TIMER_DRIVEN</schedulingStrategy><yieldDuration>1 sec</yieldDuration></config><name>RouteOnAttribute</name><relationships><autoTerminate>false</autoTerminate><description>FlowFiles will be routed to 'match' if one or all Expressions match, depending on the configuration of the Routing Strategy property</description><name>matched</name></relationships><relationships><autoTerminate>true</autoTerminate><description>FlowFiles that do not match any user-define expression will be routed here</description><name>unmatched</name></relationships><state>STOPPED</state><style/><supportsEventDriven>true</supportsEventDriven><supportsParallelProcessing>true</supportsParallelProcessing><type>org.apache.nifi.processors.standard.RouteOnAttribute</type></processors></contents><disabledCount>0</disabledCount><inactiveRemotePortCount>0</inactiveRemotePortCount><inputPortCount>0</inputPortCount><invalidCount>0</invalidCount><name>IterateJsonArray</name><outputPortCount>0</outputPortCount><parent><id>624b3e60-03e2-439f-8e68-9cdb2fc1e404</id><name>TestCassy</name><parent><id>4c5b1a24-9a32-4fcb-ad29-ee1479c44d43</id><name>NiFi Flow</name></parent></parent><runningCount>0</runningCount><stoppedCount>5</stoppedCount></processGroups></snippet><timestamp>03/17/2016 16:33:58 EDT</timestamp></template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment