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

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

Neil Derraugh created NIFI-3571:
-----------------------------------

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