Adobe Campaign Schema - Template vs Aggregate

While looking into the schema, I saw in some places we are referring to an element of a different schema instead of declaring it again and again. But in some places, it is done using template attribute and other places use aggregate attribute.
So to test, I though of using the element "auditTrail" declared inside the library xtk:common
The element is as as below

  <element name="auditTrail">
    <element defOnDuplicate="true" name="createdBy" template="xtk:common:createdBy"/>
    <element defOnDuplicate="true" name="modifiedBy" template="xtk:common:modifiedBy"/>
    <attribute defOnDuplicate="true" default="GetDate()" desc="Creation date" label="Creation date"
               name="created" type="datetime"/>
    <attribute defOnDuplicate="true" default="GetDate()" desc="Modification date"
               label="Last modified" name="lastModified" pkgStatus="always" type="datetime"/>
  </element>

I inserted the element inside one of my schema as below using both of aggregate and template
<element ...>
....
    <element aggregate="xtk:common:auditTrail" name="Audit" label="Audit using aggregate" />
    <element template="xtk:common:auditTrail" name="AuditTempl" label="Audit using template" />
 
  </element>

And here is the outcome. Aggregate doesn't add a grouping element with the label provided whereas template does.

Note, template attribute is used as an attribute of attribute declaration element as below too.
<attribute name="phone" template="nms:common:phone"/>

Here the template destination entity has to be declared as an element as below from the nms:common schema
<element dataPolicy="phone" desc="Phone number" label="Phone" length="32" name="phone" type="string"/>

Refer to: Adobe Link

Comments

Popular posts from this blog

Avoid Proxy for HttpClientRequest - IOB-090007 Network error (send(), errno=10054: an existing connection was forcibly closed by the remote host

Adobe Campaign: Call Java Script from Input Form

Broadlog Resequencing in Adobe Campaign Classic