NIFI-2401:

- Returning the enabled state of play and stop buttons in the palette. Allowing the user to always press if they have permissions to modify the selection.
 - Only attempting to schedule components that are not running, not disabled, and valid.

This closes #745

Signed-off-by: jpercivall <joepercivall@yahoo.com>
This commit is contained in:
Matt Gilman 2016-07-29 10:36:25 -04:00 committed by jpercivall
parent 4d17504a0f
commit 372a316deb
2 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ public interface ProcessGroup extends Authorizable, Positionable {
/**
* Predicate for filtering schedulable Processors.
*/
Predicate<ProcessorNode> SCHEDULABLE_PROCESSORS = node -> !node.isRunning() && node.getScheduledState() != ScheduledState.DISABLED;
Predicate<ProcessorNode> SCHEDULABLE_PROCESSORS = node -> !node.isRunning() && !ScheduledState.DISABLED.equals(node.getScheduledState()) && node.isValid();
/**
* Predicate for filtering unschedulable Processors.
@ -60,12 +60,12 @@ public interface ProcessGroup extends Authorizable, Positionable {
/**
* Predicate for filtering schedulable Ports
*/
Predicate<Port> SCHEDULABLE_PORTS = port -> port.getScheduledState() != ScheduledState.DISABLED;
Predicate<Port> SCHEDULABLE_PORTS = port -> !port.isRunning() && !ScheduledState.DISABLED.equals(port.getScheduledState()) && port.isValid();
/**
* Predicate for filtering schedulable Ports
*/
Predicate<Port> UNSCHEDULABLE_PORTS = port -> port.getScheduledState() == ScheduledState.RUNNING;
Predicate<Port> UNSCHEDULABLE_PORTS = port -> ScheduledState.RUNNING.equals(port.getScheduledState());
/**
* @return a reference to this ProcessGroup's parent. This will be

View File

@ -120,13 +120,13 @@
<div class="button-spacer-large">&nbsp;</div>
<div id="operate-start" class="action-button" title="Start">
<button ng-click="appCtrl.nf.Actions['start'](appCtrl.nf.CanvasUtils.getSelection());"
ng-disabled="!appCtrl.nf.CanvasUtils.areRunnable(appCtrl.nf.CanvasUtils.getSelection());">
ng-disabled="!appCtrl.nf.CanvasUtils.getSelection().empty() && !appCtrl.nf.CanvasUtils.canModify(appCtrl.nf.CanvasUtils.getSelection());">
<div class="graph-control-action-icon fa fa-play"></div></button>
</div>
<div class="button-spacer-small">&nbsp;</div>
<div id="operate-stop" class="action-button" title="Stop">
<button ng-click="appCtrl.nf.Actions['stop'](appCtrl.nf.CanvasUtils.getSelection());"
ng-disabled="!appCtrl.nf.CanvasUtils.areStoppable(appCtrl.nf.CanvasUtils.getSelection());">
ng-disabled="!appCtrl.nf.CanvasUtils.getSelection().empty() && !appCtrl.nf.CanvasUtils.canModify(appCtrl.nf.CanvasUtils.getSelection());">
<div class="graph-control-action-icon fa fa-stop"></div></button>
</div>
<div class="button-spacer-large">&nbsp;</div>