<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Johan Mulder dot com &#187; Project</title>
	<atom:link href="https://johanmulder.com/?feed=rss2&#038;tag=project" rel="self" type="application/rss+xml" />
	<link>https://johanmulder.com</link>
	<description>Blogging about IT and stuff</description>
	<lastBuildDate>Mon, 19 Jan 2015 15:45:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.39</generator>
	<item>
		<title>Export enumerations of an AX project using AOT traversal</title>
		<link>https://johanmulder.com/?p=19</link>
		<comments>https://johanmulder.com/?p=19#comments</comments>
		<pubDate>Fri, 25 Jul 2014 11:22:16 +0000</pubDate>
		<dc:creator><![CDATA[johanmulder]]></dc:creator>
				<category><![CDATA[Dynamics AX Development]]></category>
		<category><![CDATA[AOT]]></category>
		<category><![CDATA[AX 2012]]></category>
		<category><![CDATA[Pattern]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Traversal]]></category>
		<category><![CDATA[Tree]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://johanmulder.com/?p=19</guid>
		<description><![CDATA[While working on the documentation phase for an AX 2012 project I needed a way to speed up a few things. One of the requirements for the documentation was to add a description of all enumerations that has been used by this project. The result was a simple but powerful script which recursively traverse all &#8230; <a href="https://johanmulder.com/?p=19" class="more-link">Continue reading <span class="screen-reader-text">Export enumerations of an AX project using AOT traversal</span></a>]]></description>
				<content:encoded><![CDATA[<p>While working on the documentation phase for an AX 2012 project I needed a way to speed up a few things. One of the requirements for the documentation was to add a description of all enumerations that has been used by this project. The result was a simple but powerful script which recursively traverse all nodes of a project to find all enumerations. For each enumeration that is found the actual values are printed.</p>
<p>Of course it is a very specific script for a certain purpose but you can of course change it to gather other kinds of information.</p>
<pre class="brush:cpp" style="font-size: 0.8em">
static void JM_ExportProjectEnumValues(Args _args)
{
    ProjectListNode sharedProjList = infolog.projectRootNode().AOTfindChild("Shared");
    ProjName projName;
    ProjectNode projNode;
    ProjectNode projNodeLoad;

    #TreeNodeSysNodeType

    // warning: recursive function
    void traverseProjectNodes(ProjectNode _rootNode)
    {
        TreeNode childNode;
        TreeNodeIterator rootNodeIterator;
        TreeNodeType treeNodeType;
        DictEnum dictEnum;
        int enumValueIdx;
        ;

        if (_rootNode)
        {
            rootNodeIterator = _rootNode.AOTiterator();
            childNode = rootNodeIterator.next();
            while (childNode)
            {
                treeNodeType = childNode.treeNodeType();
                //info(strfmt("%1: %2 - %3", treeNodeType.id(), rootNode.AOTname(), childNode.AOTname()));

                // found group: jump in
                if (treeNodeType.id() == #NT_PROJECT_GROUP)
                    traverseProjectNodes(childNode);

                // found base enum
                if (treeNodeType.id() == #NT_DBENUMTYPE)
                {
                    dictEnum = new DictEnum(enumName2Id(childNode.AOTname()));
                    if(dictEnum)
                    {
                        info(strFmt("ID:%1 NAME:%2", dictEnum.id(), dictEnum.name()));
                        for(enumValueIdx = 0; enumValueIdx &lt; dictEnum.values(); enumValueIdx++)
                        {
                            info(strFmt("%1 = %2", dictEnum.index2Value(enumValueIdx), dictEnum.index2Label(enumValueIdx)));
                        }
                    }
                }
                childNode = rootNodeIterator.next();
            }
        }
    };

    // traverse all enums of a given project
    projName = ""';
    projNode = sharedProjList.AOTfindChild(projName);
    projNodeLoad = projNode.loadForInspection();
    traverseProjectNodes(projNodeLoad);
    projNodeLoad.treeNodeRelease();
}

</pre>
]]></content:encoded>
			<wfw:commentRss>https://johanmulder.com/?feed=rss2&#038;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
