<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
Copyright (c) 2006 UGS Corp.

All Rights Reserved.

This software and related documentation are proprietary to UGS Corp.
-->
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Create a Checker from a Template</title>
      <script language="javaScript">
        abridged="false";
        displayConditions=new Array();
      </script>
      <link type="text/css" href="../css/main_styles.css" rel="stylesheet">
   </head>
   <body class="bodydocs" onload="top.pageLoader()" bgcolor="#FFFFFF">
      <div class="title_topic4" id="xps10_pagetitle">Create a Checker from a Template</div>
      <hr noshade="true"><a name="ndxgenid_checkmate135"></a><a name="ndxgenid_checkmate136"></a><table cellspacing="4" align="center">
         <tbody>
            <tr valign="top">
               <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
                  <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('checkmate/create_checkers_ovw.html');return(false);">Overview</a></p>
               </td>
               <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
                  <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('checkmate/overview_author_tasks.html');return(false);">How To</a></p>
               </td>
               <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
                  <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('checkmate/create_ck_options.html');return(false);">Options</a></p>
               </td>
               <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
                  <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('checkmate/auth_task_related.html');return(false);">Related Topics</a></p>
               </td>
            </tr>
         </tbody>
      </table><br><p class="para_topic">You can create a checker from a DFA template file. The file defines the class for the checker. This topic describes the major sections of the checker template DFA file, which are as follows:</p>
      <ul>
         <li>
            <p class="para_item">Storage category (optional).</p>
         </li>
         <li>
            <p class="para_item">The checker's class name and mix-in file(s).</p>
         </li>
         <li>
            <p class="para_item">The checker's documentation.</p>
         </li>
         <li>
            <p class="para_item">Attributes and parameters that are required for Check-Mate framework.</p>
         </li>
         <li>
            <p class="para_item">Attributes and parameters that are specific to the checker.</p>
         </li>
         <li>
            <p class="para_item">Checker Parameter customization.</p>
         </li>
         <li>
            <p class="para_item">Checker execution rules.</p>
         </li>
      </ul>
      <div class="title_division">Storage Category</div>
      <p class="para_division">The storage category specification is optional. This specification describes where the DFA file is stored on the disk.</p>
      <p class="para_division">Example:</p>
      <p class="para_division">#+@&lt;CATEGORY&gt; @</p>
      <p class="para_division">base.checker.template</p>
      <p class="para_division">#-@&lt;CATEGORY&gt; @</p>
      <p class="para_division">The &quot;#+@&lt;CATEGORY&gt; @&quot; and &quot;#-@&lt;CATEGORY&gt; @&quot; denote the open and close of the storage category specification.</p>
      <p class="para_division">The format of the category specification is:</p>
      <p class="para_division">&lt;path1&gt; .&lt;path2&gt; .&lt;path3&gt; .</p>
      <p class="para_division">The above example shows the DFA file being stored with a relative path of base/checker/template/.</p>
      <p class="para_division">Currently, there is no enforcement of storage category specification since the utility software is not available.</p>
      <p class="para_division">The utility software is needed to do the following things:</p>
      <ul>
         <li>
            <p class="para_item">Interpret this storage category specification.</p>
         </li>
         <li>
            <p class="para_item">Create the path specified in the storage category.</p>
         </li>
         <li>
            <p class="para_item">Check if the file exists in the specified path.</p>
         </li>
         <li>
            <p class="para_item">Copy the DFA file to the disk specified in the storage category.</p>
         </li>
      </ul>
      <div class="title_division">Class Name and Mix-in File(s)</div>
      <p class="para_division">The checker's class name must be a legal Knowledge Fusion rule name. &nbsp;Mix-in classes are additional classes needed by the checker.</p>
      <p class="para_division">Example:</p>
      <p class="para_division">DefClass: %mqc_checker_template( %ug_base_checker );</p>
      <p class="para_division">Tips</p>
      <ul>
         <li>
            <p class="para_item">Make sure that a checker class name starts with %, which means that it is hidden. &nbsp;A hidden class will not be displayed in the NX Knowledge Fusion Navigator; hence, it will not be instantiated in an unsupportable context.</p>
         </li>
         <li>
            <p class="para_item">A Check-Mate checker must have &quot;%ug_base_checker&quot; as the mix-in class. &nbsp;The %ug_base_checker class defines many attributes that are common to the checkers. &nbsp;Some of these attributes are used in the Check-Mate framework. &nbsp;Please see ug_base_checker.dfa for further information.</p>
         </li>
         <li>
            <p class="para_item">A checker class name must be unique.</p>
         </li>
      </ul>
      <div class="title_division">Documentation</div>
      <p class="para_division">A checker's documentation displays when you click the Documentation button on the Check-Mate dialog.</p>
      <p class="para_division">Example:</p>
      <p class="para_division">#++</p>
      <p class="para_division">Description:</p>
      <p class="para_division">[ Add the description of the checker's functionality here ]</p>
      <p class="para_division">Parameters:</p>
      <p class="para_division">[ Add the description of the checker's parameters ]</p>
      <p class="para_division">Results:</p>
      <p class="para_division">PASS &nbsp;&nbsp;&nbsp;-- </p>
      <p class="para_division">FAILED &nbsp;-- </p>
      <p class="para_division">WARNING --</p>
      <p class="para_division">INFO &nbsp;&nbsp;&nbsp;--</p>
      <p class="para_division">Object log:</p>
      <p class="para_division">[ Add the description of what NX object(s) have been logged. ]</p>
      <p class="para_division">#-</p>
      <p class="para_division">Tips</p>
      <ul>
         <li>
            <p class="para_item">Checker documentation must be wrapped with &quot;#++&quot; and &quot;#-&quot;.</p>
         </li>
         <li>
            <p class="para_item">The documentation section must be placed after the class definition statement. </p>
         </li>
         <li>
            <p class="para_item">Be as detailed as possible.</p>
         </li>
      </ul>
      <div class="title_division">Attributes and Parameters required by Check-Mate</div>
      <p class="para_division">The test category and display name of the checker are required attributes for the basic Check-Mate framework. Required parameters of the framework are the disabled? and save_log_in_part parameters.</p>
      <p class="para_division"># Check-Mate attributes and parameters</p>
      <p class="para_division">&nbsp;&nbsp;&nbsp;( String ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%test_category: &nbsp;&nbsp;&quot;Template.Checker X&quot;;</p>
      <p class="para_division">&nbsp;&nbsp;&nbsp;( String ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%displayed_name: &nbsp;&quot;A template checker for validating XXX&quot;;</p>
      <p class="para_division">&nbsp;&nbsp;&nbsp;( Boolean Parameter ) &nbsp;&nbsp;disabled?: false;</p>
      <p class="para_division">&nbsp;&nbsp;&nbsp;( Boolean Parameter ) &nbsp;&nbsp;save_log_in_part: true;</p>
      <p class="para_division">Tips</p>
      <ul>
         <li>
            <p class="para_item">Although these attributes and parameters are declared in %ug_base_checker, each checker must have the attributes and parameters explicitly defined in its own DFA file.</p>
         </li>
         <li>
            <p class="para_item">The attribute &quot;%displayed_name:&quot; defines the name for this checker class. This name will be displayed in <b class="uiTerm">Check-Mate</b> dialog instead of the class name; it is meant to be human readable and informative. Since it is a quoted string, spaces are allowed in the displayed name.
            </p>
         </li>
         <li>
            <p class="para_item">The attribute &quot;%test_category:&quot; defines the category and category levels to be displayed in the checker selection window of the<b class="uiTerm"> Check-Mate</b> dialog. The format is:
            </p>
         </li>
         <li>
            <p class="para_item">&lt;Highest category&gt; [.&lt;next level category&gt; ]*</p>
         </li>
         <li>
            <p class="para_item">It is a quoted string, so spaces are allowed in category names.</p>
         </li>
         <li>
            <p class="para_item">The parameter &quot;disabled?:&quot; defines whether or not to disable the checker function.</p>
         </li>
         <li>
            <p class="para_item">The parameter &ldquo;save_log_in_part&rdquo;: indicates whether the results of the checker is saved to the part file or not. &nbsp;Under most conditions set this to true as the default. &nbsp;Since it is a parameter, the user can change it even during run-time via the <b class="uiTerm">Customize</b> button in the <b class="uiTerm">Check-Mate</b> dialog.
            </p>
         </li>
      </ul>
      <div class="title_division">Checker Specific Attributes and Parameters</div>
      <p class="para_division">This is free space for specifying a checker's own rules. When you design a base checker template, consider these requirements:</p>
      <ul>
         <li>
            <p class="para_item">Give the user the flexibility to change the result to be displayed as</p>
         </li>
      </ul>
      <p class="para_division">FAILED/WARNING/INFO</p>
      <p class="para_division">For example, if a checker reports &quot;number of promoted bodies in a part &nbsp;file&quot;, some users would define the check result as &quot;FAILED&quot;, while other users would define it as a &quot;WARNING&quot; and still others, as &quot;INFO&quot;.</p>
      <ul>
         <li>
            <p class="para_item">Consider adding the option of allowing user-defined messages.</p>
         </li>
         <li>
            <p class="para_item">If new Knowledge Fusion functions are to be implemented to support the new checkers, consider having the functions return the status, instead of logging the status to the LOG system inside of the functions. &nbsp;Let the logging be done in the DFA file where the user's choice of failed/warning/info can be applied.</p>
         </li>
      </ul>
      <div class="title_division">Checker Parameter Customization</div>
      <p class="para_division">If a checker wants to expose the parameters to the user for customization, the parameters need to be defined in checker's local DFA file (versus the mix-in DFA file).</p>
      <p class="para_division">The following extensions are recognized by the Check-Mate framework to indicate certain user interface styles and values to be used in parameter presentation/choices during &quot;customization&quot;:</p>
      <p class="para_division">_label = a string to define the label for the user interface element</p>
      <p class="para_division">_option = a list of strings to define choices for an option menu</p>
      <p class="para_division">_init &nbsp;= a list of strings to define choices for a list</p>
      <p class="para_division">_range = a list of numbers for the values of the scale</p>
      <div class="title_division">Checker Execution Rules</div>
      <p class="para_division">This is the basic checker function the system executes.</p>
      <p class="para_division"># checking ...</p>
      <p class="para_division">&nbsp;&nbsp;&nbsp;(Any Uncached) &nbsp;&nbsp;do_check:</p>
      <p class="para_division">@{</p>
      <p class="para_division">ug_mqc_check_xxx();</p>
      <p class="para_division">};</p>
      <p class="para_division">Check-Mate evaluates the attribute &nbsp;&quot;do_check:&quot; during checker execution. Within this attribute lies a function call that performs the checker's main test.</p>
   </body>
</html>