NIFI-258:

- Ensuring connection stays up to date when processor configuration changes.
This commit is contained in:
Matt Gilman 2015-01-13 15:54:21 -05:00
parent b142d7a9bd
commit 80793ccbb8
1 changed files with 22 additions and 1 deletions

View File

@ -363,6 +363,20 @@ nf.ProcessorConfiguration = (function () {
return true; return true;
} }
}; };
/**
* Reloads the outgoing connections for the specified processor.
*
* @param {object} processor
*/
var reloadProcessorConnections = function (processor) {
var connections = nf.Connection.getComponentConnections(processor.id);
$.each(connections, function (_, connection) {
if (connection.source.id === processor.id) {
nf.Connection.reload(connection);
}
});
};
return { return {
/** /**
@ -601,8 +615,11 @@ nf.ProcessorConfiguration = (function () {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
// set the new processor state // set the new processor state based on the response
nf.Processor.set(response.processor); nf.Processor.set(response.processor);
// reload the processor's outgoing connections
reloadProcessorConnections(processor);
// close the details panel // close the details panel
$('#processor-configuration').modal('hide'); $('#processor-configuration').modal('hide');
@ -632,7 +649,11 @@ nf.ProcessorConfiguration = (function () {
// show the custom ui // show the custom ui
nf.CustomProcessorUi.showCustomUi($('#processor-id').text(), processor.config.customUiUrl, true).done(function () { nf.CustomProcessorUi.showCustomUi($('#processor-id').text(), processor.config.customUiUrl, true).done(function () {
// once the custom ui is closed, reload the processor
nf.Processor.reload(processor); nf.Processor.reload(processor);
// and reload the processor's outgoing connections
reloadProcessorConnections(processor);
}); });
}; };