DCOSetupNode APIs

You can use the DCOSetupNode API properties and methods to access and modify Setup DCO child objects, including rules and variables.

Each runtime DCO object inherits attributes and variables from the corresponding DCOSetupNode object. For example, as demonstrated in the following setup node sample, all documents that are identified as Invoice documents include the TYPE, STATUS, DOC DATA, MIN_TYPES, MAX_TYPES, and rules variables. The Invoice document object must also contain at least one Main_Page page object. Similarly, all runtime objects that are identified as Main_Page types must be in the first position of the Invoice document.
<D type="Invoice">   1 
	 <V n="ID">0</V>
	 <V n="TYPE">Document</V>
	 <V n="STATUS">0</V>
	 <V n="DOC DATA">0</V>
	 <V n="MIN_TYPES">0</V>   2  
	 <V n="MAX_TYPES">0</V>
   <V n="rules"><in&gt;<r id=&quot;1&quot; rs=&quot;11&quot;
    /&gt;<r id=&quot;5&quot; rs=&quot;7&quot; /&gt;<r
    id=&quot;4&quot; rs=&quot;16&quot; /&gt;</in&gt;</V>

	<P type="Main_Page" pos="1" min="1" max="1"/>
	<P type="Trailing_Page" pos="0" min="0" max="0"/>	  3  
  <P type="Attachment" pos="0" min="0" max="0"/>

</D>

 1  Setup node for the document type Invoice

 2  Variables

 3  Parameters

DCOSetupNode objects are created and accessed through the parent DCOSetup object.

The SetupNode object also defines the document integrity rules for that object type. The following example specifies that a Tax Return document must have at least one (min="1") and at most one (max="1") page of type 1040EZ. The relative position attribute (pos="2") specifies that the 1040EZ page must come after the TaxSep page (if present) and before the Attachment page (if present):

<D type="Tax Return">
      <V n="ID">0</V>
      <V n="ID">0</V>
      <V n="TYPE">Document</V>
      <V n="STATUS">0</V>
      <V n="DOC DATA">0</V>
      <V n="MIN_TYPES">2</V>
      <V n="MAX_TYPES">0</V>
      <V n="rules"></V>
      <P type="TaxSep" pos="1" min="0" max="1"/>
      <P type="1040EZ" pos="2" min="1" max="1"/>      <--- Rule for page 1040EZ
      <P type="Attachment" pos="3" min="0" max="0"/>
</D>

The max="0" value means unlimited. In the example, there can be any number of attachment pages. The MIN_TYPES and MAX_TYPES variables define the minimum and maximum number of child object types that must be present at run time to constitute a valid document. The MIN_TYPES value (2) specifies that each runtime document must have at least two different page types.

After you obtain an interface to the DCOSetup object, you can obtain an interface to any DCOSetupNode object by using the GetNode method or the GetNodeByName method, as shown in the following example:
TDCOLib.DCOSetupNode m_oDCOSetupNode = m_oDCOSetup.GetNodeByName(2, "Main_Page");
Through the DCOSetup object interface, you can access all of the DCOSetupNode object properties and methods.