[ 
https://issues.apache.org/jira/browse/PLC4X-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17630916#comment-17630916
 ] 

Lukas Ott commented on PLC4X-196:
---------------------------------

This issue has been migrated to https://github.com/apache/plc4x/issues/593

> Apache NiFi integration should allow Expression Language
> --------------------------------------------------------
>
>                 Key: PLC4X-196
>                 URL: https://issues.apache.org/jira/browse/PLC4X-196
>             Project: Apache PLC4X
>          Issue Type: New Feature
>          Components: Integration-NiFi
>    Affects Versions: 0.7.0
>            Reporter: Turker TUNALI
>            Priority: Major
>              Labels: feature-request
>
> 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()



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to