You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Dmitry Lukyanov (Jira)" <ji...@apache.org> on 2019/11/07 17:35:00 UTC
[jira] [Commented] (NIFI-6852) CTL doesn't work in
ExecuteGroovyScript processor with Apache NiFi 1.10.0
[ https://issues.apache.org/jira/browse/NIFI-6852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16969445#comment-16969445 ]
Dmitry Lukyanov commented on NIFI-6852:
---------------------------------------
Details about this bug:
In {{ExecuteGroovyScript}} processor it's possible to define {{CTL.*}} parameters with link to {{ControllerService}} by {{ControllerService.class}}
It means any controller service could be linked to this property.
Dynamic property definition in ExecuteGroovyScript.java|https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java#L427]:
{code:java}
if (property.getKey().getName().startsWith("CTL.")) {
//get controller service
ControllerService ctl = context.getProperty(property.getKey()).asControllerService(ControllerService.class);
CTL.put(property.getKey().getName().substring(4), ctl);
} else ...
{code}
However, when you define any property with name {{CTL.*}} ( * - means any name ) then
there is an error message on nifi screen
!NIFI_CTL.png!
And seems the error raised in [AbstractComponentNode.java|https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractComponentNode.java#L746]:
{code:java}
final boolean matchesApi = matchesApi(extensionManager, controllerServiceBundle, controllerServiceApiCoordinate);
if (!matchesApi) {
final String controllerServiceType = controllerServiceNode.getComponentType();
final String controllerServiceApiType = controllerServiceApiClass.getSimpleName();
final String explanation = new StringBuilder()
.append(controllerServiceType).append(" - ").append(controllerServiceCoordinate.getVersion())
.append(" from ").append(controllerServiceCoordinate.getGroup()).append(" - ").append(controllerServiceCoordinate.getId())
.append(" is not compatible with ").append(controllerServiceApiType).append(" - ").append(controllerServiceApiCoordinate.getVersion())
.append(" from ").append(controllerServiceApiCoordinate.getGroup()).append(" - ").append(controllerServiceApiCoordinate.getId())
.toString();
return createInvalidResult(serviceId, propertyName, explanation);
{code}
Could somebody explain the validation above?
> CTL doesn't work in ExecuteGroovyScript processor with Apache NiFi 1.10.0
> -------------------------------------------------------------------------
>
> Key: NIFI-6852
> URL: https://issues.apache.org/jira/browse/NIFI-6852
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.10.0
> Reporter: Behrouz
> Priority: Major
> Attachments: NIFI_CTL.png
>
>
> more information is available in this stackoverflow question:
> [https://stackoverflow.com/questions/58731092/why-ctl-doesnt-work-in-executegroovyscript-processor-with-apache-nifi-1-10-0]
> according to daggett comment in stackoverflow the source of error seems to be [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractComponentNode.java#L746|http://example.com/]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)