Using Predefined Patterns

Most repository entities can be represented with the predefined patterns in \<EA Home>\Data\Legacy.xml.api. These patterns do virtually all of the work of the specification for you, supplying the relationship of the entity to the called program, its internal name, and so forth. They are guaranteed to provide consistent data to EA databases.

To specify a predefined pattern, use the pattern name as a tag (for example, <tip-file>) anywhere you might use a <rel> tag. If the predefined pattern is specified at the top level of the entry, the parser creates a relationship with the calling program. If the predefined pattern is nested in an entity specification, the parser creates a relationship with the parent entity.

Each pattern has parameters that you can code as XML attributes or as subtags. So:

<transaction name='%2' params='' hc-kind='dpsSETRX'/>

is equivalent to:

<transaction params=''>
  <name value='%2'/>
  <hc-kind value ='dpsSETRX'/
</transaction>

Use the subtag method when a parameter can have multiple values:

<file filename= '%2' data-record='%3'>
  <action switch-var='%op'>
    <case eq='1' value='Reads'/>
    <case eq='2' value='Reads'/>
    <case eq='4' value='Updates'/>
    <case eq='28' value='Inserts'/>
  </action>
  <hc-kind switch-var='%op'>
    <case eq='1' value='fcssRR'/>
    <case eq='2' value='fcssRL'/>
    <case eq='4' value='fcssWR'/>
    <case eq='28' value='fcssAW'/>
  </hc-kind>
</file>

Look at Legacy.xml.api for further details of predefined pattern usage and for required parameters and values.