mcgilman commented on code in PR #8296:
URL: https://github.com/apache/nifi/pull/8296#discussion_r1466836265


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/service/canvas-utils.service.ts:
##########
@@ -464,6 +464,28 @@ export class CanvasUtils {
         return selection.size() === 1 && selection.classed('funnel');
     }
 
+    /**
+     * Determines whether the current selection is a stateful processor.
+     *
+     * @param {selection} selection
+     */
+    public isStatefulProcessor(selection: any): boolean {
+        // ensure the correct number of components are selected
+        if (selection.size() !== 1) {
+            return false;
+        }
+        if (this.canRead(selection) === false || this.canModify(selection) === 
false) {
+            return false;
+        }
+
+        if (this.isProcessor(selection)) {
+            const processorData: any = selection.datum();
+            return processorData.component.persistsState === true;
+        } else {
+            return false;
+        }
+    }

Review Comment:
   This naming and logic was brought over from NiFi without much thought. I can 
rename the method if desirable. The logic is correct. We want to verify the 
selection contains a single Processor, the user has access, and it persists 
state.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to