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

Richard Miskin commented on NIFI-826:
-------------------------------------

I'm not sure how the idea of creating an id on creation, and then maintaining 
it would work. What would happen in the scenario where I have a template, I put 
two copies of it into my flow, and select everything and save that as a new 
template. Wouldn't you have id collisions?

Without having looked into the code, I wondered if the components that do not 
themselves have a position could be ordered based on their name, followed by 
what they are connected to. That way the order of uniquely named items wouldn't 
change, but two identically named ControllerServices would be ordered based on 
the Processors that depend on them.

The id could be generated on a similar process, using just as much information 
as is needed to make the id unique, that way changing adding a new Processor 
that depends on a uniquely named ControllerService would not change the id of 
that ControllerService. Doing the same for Processors has the (possible) 
advantage that the id of a uniquely named Processor wouldn't change simply due 
to moving it.

If you can point me in the right direction I'll see if I can come up with some 
working code. Is SnippetUtils.populateFlowSnippet() a good place to start?


> Export templates in a deterministic way
> ---------------------------------------
>
>                 Key: NIFI-826
>                 URL: https://issues.apache.org/jira/browse/NIFI-826
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: Matt Gilman
>            Assignee: Matt Gilman
>
> Templates should be exported in a deterministic way so that they can be 
> compared or diff'ed with another. Items to consider...
> - The ordering of components
> - The id's used to identify the components
> - Consider excluding irrelevant items. When components are imported some 
> settings are ignored (run state).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to