rfellows commented on code in PR #11946:
URL: https://github.com/apache/nifi/pull/11946#discussion_r4741515679


##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/operation-control/operation-control.component.html:
##########
@@ -30,6 +30,15 @@
     </mat-expansion-panel-header>
     <div class="flex flex-col gap-y-2">
         <component-context [type]="contextType()" [name]="contextName()" 
[id]="contextId()"></component-context>
+        @if (isDraining()) {

Review Comment:
   Addressed the part that doesn't depend on backend changes. While the drain 
of the current Process Group still has FlowFiles queued:
   - Start is disabled for its source components (processors with no incoming 
non-loop connection, and the group's input ports), and Stop is disabled for its 
other processors and output ports. This covers the Operate panel and the 
context menu, since both go through `CanvasUtils.isRunnable` / `isStoppable`. 
Run Once in the context menu is gated the same way as Start.
   - A child Process Group can't be stopped. A Stateless child is blocked only 
while one of its input ports has an incoming connection. That approximates 
`keepsRunning(statelessGroup)`, because whether the child contains a source 
processor isn't visible from the parent.
   
   Independently of that, Start and Stop are disabled for a selected child 
Process Group that is draining, and for the current Process Group when it or 
one of its direct children is draining with FlowFiles queued. The Operate panel 
Start/Stop buttons stay hoverable while disabled and explain why in their 
tooltip. Everything becomes available again on the next refresh after the queue 
empties or the drain ends.
   
   Not covered, because it needs drain information the backend doesn't expose 
today:
   - Starting a non-draining child Process Group inside the drained group isn't 
gated, because its contents aren't known at this level. The server rejects it 
when that child has source processors.
   - Components inside a child of the drained group, and drains nested deeper 
than a direct child, aren't gated.
   
   The Processor, Port and Controller Service dialogs, Controller Service 
disable, remote process group transmission and the connector canvas also still 
rely on the server's rejection.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to