Hide last authors
Achraf El Kari 1.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
Assala Chmiti 9.1 5 = __Introduction:__ =
Achraf El Kari 1.1 6
Assala Chmiti 10.1 7
Outhman Moustaghfir 7.1 8 "PurgeTracking" is a connector that allows administrators to delete all unused Tracking from the database by specifying some parameters to include in the format file.
Achraf El Kari 1.1 9
Outhman Moustaghfir 7.1 10 The need to use such a connector is to reach the database availability and scalability by allegiance the size of each table relating to the Tracking process knowing that it takes a lot of memory if not resolved.
Achraf El Kari 1.1 11
Outhman Moustaghfir 7.1 12 Our connector's presentation is going to be described in details in 3 parts :
Achraf El Kari 1.2 13
14 1. Parameters 
15 1*. format
16 1. Use
17
Outhman Moustaghfir 7.1 18 [[image:purgetrk.PNG]]
19
Assala Chmiti 9.1 20 = __Explaining the connector format:__ =
Achraf El Kari 1.1 21
Assala Chmiti 10.1 22
Achraf El Kari 1.2 23 The parameters used in this connector are :
Achraf El Kari 1.1 24
Assala Chmiti 10.1 25 * //**iXPurgeTrk**//: root node where should be specified 2 attributes :
26 ** "**Retention**": it refers to the number of days, if passed it should delete all Tracking created before that date.
27 ** "**stopTime**": attribute showing numbers of minutes to stop PurgeTracking. Passing this time, the connector should stop working and go to the next connector of the current scenario. 
Achraf El Kari 1.1 28
Assala Chmiti 10.1 29 * //**iXToDelete**//: a node where we add all tracking to be deleted in PurgeTracking. To add tracking to be deleted, we should follow these steps :
30 ** Add a node to the iXToDelete node.
31 ** Put the Tracking Type as the node name.
32 ** Specify Tracking Status type ID in the "StatusType" attribute. If it equals "*", it means we want to delete all Tracking regardless of Status. we can also put multiple status by separating them by comma, example : "StatusType" = "1,5,13,56".
33
34 * //**iXToForbid**//: an XML node to put trackings to not delete while executing PurgeTracking. It works similar to iXToDelete.
35
Assala Chmiti 9.1 36 [[image:purgetrk1.PNG||height="402" width="447"]]
Outhman Moustaghfir 7.1 37
Assala Chmiti 9.1 38 == ==
Outhman Moustaghfir 7.1 39
Assala Chmiti 9.1 40 == __Example Format:__ ==
Achraf El Kari 1.1 41
Outhman Moustaghfir 7.1 42 Below, we find an example showing a format file to delete trackings following some criteria :
Achraf El Kari 1.1 43
Assala Chmiti 10.1 44 * We want to delete all trackings of type 'Order' that its date passed 30 days. The connector will delete automatically all subtrackings of 'Order'  selected by a SQL query, __in this case, __**we should be careful and mention all trackings forbidden to be deleted**__.__ The trackings to **not be deleted** are:
Assala Chmiti 9.1 45 ** Tracking '**Order**' with StatusType **1** and **12**.
46 ** Tracking '**OrderLine**' with StatusType **1**.
47 ** All Status types for the tracking '**Product_Base**'.
Achraf El Kari 1.1 48
Assala Chmiti 9.1 49 * We set a stopTime of 7 hours. If PurgeTracking started at 1:00PM it should stop at 8:00PM, even if it didn't delete all tracking wanted.
50
Achraf El Kari 1.3 51 {{code language="XML"}}
52 <?xml version="1.0" encoding="windows-1250"?>
53
54 <iXDoc>
55 <iXPurgeTrk Retention = "30" stopTime="7">
56
57 <iXToDelete>
Achraf El Kari 1.10 58 <Order StatusType="*"></Order>
Achraf El Kari 1.3 59 </iXToDelete>
60
61 <iXToForbid>
Achraf El Kari 1.10 62 <Order StatusType="1,12"></Order>
63 <OrderLine StatusType="1"></OrderLine>
64 <Product_Base StatusType = "*"></Product_Base>
Achraf El Kari 1.3 65 </iXToForbid>
66
67 </iXPurgeTrk>
68 </iXDoc>
69
70 {{/code}}
71
72
Assala Chmiti 9.1 73 = __Use:__ =
Achraf El Kari 1.1 74
75 As explained before, the PurgeTracking connector is used to delete tracking and its subtrackings by writing the format file.
76
Outhman Moustaghfir 7.1 77 Practically, the delete of tracking that has a certain ID (eg.  TrkID = 1234 And TrackingType = 'OrderLine'), will generate all following deletes on this order :
Achraf El Kari 1.1 78
Assala Chmiti 10.1 79
Achraf El Kari 1.11 80 1. Delete Tracking file from 'TrackingFile' table where TrkID=1234
81 1. Delete Tracking environement from 'TrackingEnv' table where TrkID = 1234
Achraf El Kari 4.1 82 1. Delete all Tracking Links from "TrackingLink' table where TrkID = 1234 or ParentTrkID = 1234
83 1. Delete Tracking from '_OrderLine' table where TrkID = 1234
Achraf El Kari 1.11 84 1. Finally, delete Tracking from 'Tracking' Table where TrkID =1234
Achraf El Kari 1.1 85
Achraf El Kari 1.12 86 In addition to that, the connector makes the execution in the current environment and its sub-environments. For example, if there is an environnement (EnvID = 1) which has 2 sub-environments ( EnvID = 2 and EnvID = 3), and we start 'PurgeTracking' in EnvID = 1, the connector will be automaticly executed in environments  1,2 and 3. 
Achraf El Kari 1.1 87
88
Assala Chmiti 12.1 89 === **__When the purge is executed?:__** ===
Achraf El Kari 1.11 90
91
Assala Chmiti 14.1 92 As we can see in the format file, the tracking lines that are deleted are based on their status type. So, to delete the tracking lines, **consultants **needs only to set the status type of the tracking table lines that they want to delete to '**99**'. The value **99 **is the one that corresponds to the status '**to be purged**' in the database.
Achraf El Kari 1.11 93
Assala Chmiti 12.1 94 This step of changing the status type is necessary when a tracking table is no longer needed and the consultants are the ones that knows what are the tracking tables that should be deleted. The deletion will start once the tracking lines have a correct status type(with the value '**99**') mentionned in the **iXToDelete **tag in the format file and have a creation date that surpass the retention date from today's date.
Assala Chmiti 9.1 95
Assala Chmiti 12.1 96 This connector should only be executed by the iXPath members.
Assala Chmiti 9.1 97
Assala Chmiti 13.1 98 The retention attribute in the format file for the iXPurgeTrk tag is set to the value 180 (6 months) in the SIM and PROD server.
Assala Chmiti 9.1 99
Assala Chmiti 12.1 100
Assala Chmiti 13.1 101
Achraf El Kari 1.10 102 = =
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian