You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apache NiFi integration should allow us to use Expression Language for PLC connection string and PLC resource address string.
We sometimes need to get data from 100 different addresses. Current processors doesn't allow us to create those strings on the fly. So we need to enter them manually or we need utilize NiFi API to create flows automatically.
If those parameters allows us to use expression language, we can read a list from csv file or from database and then we can read them in a loop in Apache NiFi.
So it will be very handy feature to dynamically specify the connection string and the address string.
For starting point PutFile processor can be examined. This processor utilizes expression language for it's "Directory" parameter.
Define the parameter as expression language supported.
public static final PropertyDescriptor DIRECTORY = new PropertyDescriptor.Builder()
.name("Directory")
.description("The directory to which files should be written. You may use expression language such as /aa/bb/${path}")
.required(true)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR) .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.build();
...
And then script can be evaluated in the onTrigger event like
Apache NiFi integration should allow us to use Expression Language for PLC connection string and PLC resource address string.
We sometimes need to get data from 100 different addresses. Current processors doesn't allow us to create those strings on the fly. So we need to enter them manually or we need utilize NiFi API to create flows automatically.
If those parameters allows us to use expression language, we can read a list from csv file or from database and then we can read them in a loop in Apache NiFi.
So it will be very handy feature to dynamically specify the connection string and the address string.
For starting point PutFile processor can be examined. This processor utilizes expression language for it's "Directory" parameter.
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFile.java
Notable Lines:
import org.apache.nifi.expression.ExpressionLanguageScope;
...
Define the parameter as expression language supported.
public static final PropertyDescriptor DIRECTORY = new PropertyDescriptor.Builder()
.name("Directory")
.description("The directory to which files should be written. You may use expression language such as /aa/bb/${path}")
.required(true)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.build();
...
And then script can be evaluated in the onTrigger event like
context.getProperty(DIRECTORY).evaluateAttributeExpressions(flowFile).getValue()
Imported from Jira PLC4X-196. Original Jira may contain additional context.
Reported by: turker.tunali.
The text was updated successfully, but these errors were encountered: