public static void buildRowKeys(OrganigramNode node) {
        if (node.getChildren() != null && node.getChildCount() > 0) {
            for (int i = 0; i < node.getChildCount(); i++) {
                OrganigramNode childNode = node.getChildren().get(i);

                String childRowKey = (node.getParent() == null) ? String.valueOf(i) : node.getRowKey() + "_" + i;
                childNode.setRowKey(childRowKey);

                buildRowKeys(childNode);
            }
        }
    }
Loops the {@link OrganigramNode}s and generates a rowKey for each node on the basis of the parent and child index.

@param node The root node.
primefaces/src/main/java/org/primefaces/component/organigram/OrganigramHelper.java