[ 
https://issues.apache.org/jira/browse/NIFI-3571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Neil Derraugh updated NIFI-3571:
--------------------------------
    Description: 
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.

  was:
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.


> 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)

Reply via email to