You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/12/16 19:03:25 UTC

[GitHub] [nifi] mattyb149 commented on a change in pull request #4668: NIFI-7991 Flow Configuration History displays "annotation data not fo…

mattyb149 commented on a change in pull request #4668:
URL: https://github.com/apache/nifi/pull/4668#discussion_r544549281



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessorAuditor.java
##########
@@ -400,4 +444,39 @@ private PropertyDescriptor locatePropertyDescriptor(Set<PropertyDescriptor> prop
         return specDescriptor;
     }
 
+    /**
+     * Gets Item Paths and set path and node in Map map
+     * @param nl NodeList to generate path
+     * @param path String path to ParentNode
+     * @param map  Map of path to node, and node reference
+     */
+    private void getItemPaths(NodeList nl, String path, Map<String,Node> map){
+        if(nl!=null) {
+
+
+            for (int i = 0; i < nl.getLength(); i++) {
+                Node n;
+                if (( n = nl.item(i)) != null) {
+                    if(n.getNodeType() == Node.ELEMENT_NODE || n.getNodeType() == Node.TEXT_NODE) {
+                        if(n.hasChildNodes()){
+                           if(n.getNodeType() == Node.ELEMENT_NODE) {
+                                getItemPaths(n.getChildNodes(), path + ":" + n.getNodeName(), map);
+                           }
+                        }
+                        if(!n.hasChildNodes()) {
+                            map.put(path + ":" + n.getNodeName().trim()+":"+n.getNodeValue(), n);
+                        }
+
+                        if (n.hasAttributes()) {
+                            NamedNodeMap na = n.getAttributes();
+                            for (int j = 0; j < na.getLength(); j++) {
+                                map.put(path + ":" + n.getNodeName() + ":" + na.item(j).getNodeName().trim()+":"+na.item(j).getNodeValue(), n);

Review comment:
       I'm seeing something like this displayed:
   `:#document:criteria:rules:conditions:expression:#text:${filename:equals("hello!")}`
   Is that intended? I would think it would be more helpful (if possible) to have something like the Rule Name then the condition or action or whatever changed.




----------------------------------------------------------------
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.

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