SyncWith Property
Introduction
The syncWith property is used to establish synchronization between two different trackings that have distinct trackingTypes.
Setup
let's suppose that we have 2 'trackingTypes' : 'TrkA'', 'TrkB'.
if we chose to synchronize the TrkB with TrkA, we need to update it on the 'Tracking Editor' page :
TrkA :
TrkB :
Usage
The use of `syncWith` covers both the creation and updating of a tracking by setting the same `TrkID` for synchronized trackings. It ensures that only the shared `dataTypes` between the trackings are synchronized.
By taking the last example, let's create a 'TrkB' tracking using setTracking :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:ixf="http://www.ixPath.com/Function" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ix="localFunction">
<xsl:output method="xml" indent="yes" ></xsl:output>
<!-- Beginning of the Translation -->
<xsl:template match="/">
<xsl:variable name="varrr">
<Trk>
<TrkB>
<Name>Santos</Name>
<City>Rio</City>
<Country>Brazil</Country>
</TrkB>
<TrkB>
<Name>Roberto</Name>
<City>Torino</City>
<Country>Italy</Country>
</TrkB>
</Trk>
</xsl:variable>
<iXDOC>
<testt>
<xsl:value-of select="ixf:SetTracking($varrr)" ></xsl:value-of>
<!-- <xsl:value-of select="ixf:RemoveTracking('TrkA',
'6717c0d3f2e8d678a560e6ff','true')" ></xsl:value-of> -->
</testt>
</iXDOC>
</xsl:template>
</xsl:stylesheet>
the result for TrkA and TrkB, with GetTracking :
<testtt>
<xsl:copy-of select="ixf:GetTracking('TrkB[id=6718bab123b8281ad212c4cf]')" ></xsl:copy-of>
<xsl:copy-of select="ixf:GetTracking('TrkA[id=6718bab123b8281ad212c4cf]')" ></xsl:copy-of>
</testtt>
<iXDOC xmlns:ix="localFunction"
xmlns:ixf="http://www.ixPath.com/Function"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<testtt>
<iXDoc>
<TrkB CreationDate="2024-10-23 08:58:25"
Current="true"
EnvID="R1"
ModificationDate="2024-10-23 08:58:25"
Status="Available"
UserID=""
Version="1"
VersionID="6718bab123b8281ad212c4cf"
id="6718bab123b8281ad212c4cf">
<City>Rio</City>
<Name>Santos</Name>
<_accessStatus>OPEN</_accessStatus>
<_accessStatusHistory>
<modificationDate>2024-10-23 08:58:25</modificationDate>
<accessStatus>OPEN</accessStatus>
</_accessStatusHistory>
<Country>Brazil</Country>
</TrkB>
</iXDoc>
<iXDoc>
<TrkA CreationDate="2024-10-23 08:58:25"
Current="true"
EnvID="R1"
ModificationDate="2024-10-23 08:58:25"
Status="Available"
UserID=""
Version="1"
VersionID="6718bab123b8281ad212c4d0"
id="6718bab123b8281ad212c4cf">
<City>Rio</City>
<Name>Santos</Name>
<_syncWith>TrkB</_syncWith>
<_accessStatus>OPEN</_accessStatus>
<_accessStatusHistory>
<modificationDate>2024-10-23 08:58:25</modificationDate>
<accessStatus>OPEN</accessStatus>
</_accessStatusHistory>
</TrkA>
</iXDoc>
</testtt>
</iXDOC>
As you can see, a tracking 'TrkA' has been created automatically with the same TrkID, and a metadata '_syncWith' that maps the related syncWith tracking 'TrkB'.
Handled Cases
- The update of a tracking that has 'syncWith' metadata will update automatically the tracking associated and vice versa.
- The delete of tracking synchronized can delete all its trackings related, to enable this option in RemoveTracking function you add a third boolean param as true.
eg : <xsl:value-of select="ixf:RemoveTracking('TrkA','6717c0d3f2e8d678a560e6ff;6718bab123b8281ad212c4cf','true')" /> - By taking our use case, if a new TrkA is created, this will not create another TrkB , since only TrkB can be synchronized through trackingType.