You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matt Gilman (JIRA)" <ji...@apache.org> on 2017/03/08 19:01:38 UTC

[jira] [Commented] (NIFI-3571) ProcessorConfigDTO not populating autoTerminatedRelationships

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

Matt Gilman commented on NIFI-3571:
-----------------------------------

The autoTerminatedRelationships array is currently used to set which relationships are auto-terminated. You can check ProcessorDTO.Relationship[].autoTerminate to see the current state. The Relationship[] is considered read-only (since the Processor drives the available relationships) so we wanted to use a separate field to set which relationships are auto-terminated.

However, I don't see any reasons why we cannot also populate the ProcessorConfigDTO.autoTerminatedRelationships when serializing the current state. 

> ProcessorConfigDTO not populating autoTerminatedRelationships
> -------------------------------------------------------------
>
>                 Key: NIFI-3571
>                 URL: https://issues.apache.org/jira/browse/NIFI-3571
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Neil Derraugh
>
> I'm using a Java client codegen-ed from the swagger file.  I'm using the client to instantiate a template and then set some properties on a custom processor in the instantiated template/processorGroup.  The custom processor has two pre-existing relationships and these are both autoTerminatedRelationships.  If I check the UI after the template is instantiated the processor's autoTerminatedRelationships are correctly checkmarked.  
> {code}
>     val flow = Try(pgApi.instantiateTemplate(nifiTemplateId, request))
>     val processor = pgApi.getProcessors(flow.get.getFlow.getProcessGroups.get(0).getComponent.getId).getProcessors.get(0)
>     val processorId = processor.getId
>     val processorComponent = processorsApi.getProcessor(processorId).getComponent
>     processorComponent.getConfig.getProperties.putAll(
>       Map("USERNAME" -> dataSource.username,
>         "PASSWORD" -> dataSource.password,
>         "URL" -> dataSource.url,
>         "GRANT_TYPE" -> "password",
>         "CLIENT_ID" -> "sugar",
>         "SENSOR_ID" -> dataSource.sensorId,
>         "API_KEY" -> apiKey.apiKeyUrlSafeString
>       ).asJava)
>     val relationships = processorComponent.getRelationships
>     val autoTerminatedRelationships = processorComponent.getConfig.getAutoTerminatedRelationships
>     processor.setComponent(processorComponent)
>     processorsApi.updateProcessor(processorId, processor)
> {code}
> In the code above the {{relationships}} autoTerminated values are true.  But {{autoTerminatedRelationships}} is empty.  When I update the processor the result is that the Automatically Terminated Relationships in the UI are no longer checked.
> To get the results I want I have to setAutoTerminatedRelationships(List("Success", "Failure").asJava) explicitly before updating the processor.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)