Pattern Definition

Unofficial Content

Is the <pattern name>.pattern file.

It defines the pattern to be generated. Remember that the Pattern name and GUID must be unique. These are the details at the beginning of the file. 
To obtain a unique ID, a GUID generator may be used. For example:

Also, references should be included to the Instance and Settings xml files and, optionally, to the dll that will be used.
This is done at the beginning of the file, for example, the Work With is shown below:


The object associated with the Pattern (ParentObject) should also be included. For instance, if it is a TRN:

<ParentObject Type="Transaction">

Once this data is configured, when running GX the Pattern will be displayed as another node in Preferences/Patterns. If the ParentObject selected is a TRN, the Pattern will be shown as another selector in the TRN.

It is also possible to create a Pattern not associated with any GX object, and in this case the ParentObject section should be left out of the .pattern file.
Here the Pattern will appear as a new object to be created upon selecting File / New / Object.
It is not necessary to run GX with /install, as the route is displayed by just opening GX.

The objects that will be imported the first time that the Pattern is applied are configured in the Resources section of this file.

<Resource Id="Resources" Version="0.4" Import="Apply" File="Resources\WorkWithResources.xml"/>

Lastly, it indicates which objects will be generated by applying the Pattern to the KB. 
Any type of objects can be created: transactions, attributes, subtype groups, Web Panels, Procedures, etc.
If the object has several parts (form, rules, events, etc.) each part to be generated should be indicated. Also, a template (.dkt file) must be generated for each part, for example:

<Object Type="Transaction" Id="CategoryRelationTrn" Name="{Element.categoryItem}" Description="{Element.categoryItem}" Element="instance/transactionsName" >
<Part Type="Structure" Template="Templates\CategoryRelationStructure.dkt" />
<Part Type="WebForm" Template="Templates\CategoryRelationWebForm.dkt" />
<Part Type="Rules" Template="Templates\CategoryRelationRules.dkt" />
<Part Type="Variables" Template="Templates\CategoryRelationVariables.dkt" />