2. Scenario - XMLToTrk

Page / - last modified by Outhman Moustaghfir on 2022/06/13 13:18

XMLToTrk

last modified by Outhman Moustaghfir

on 2022/06/13 13:18

Table of Contents

Introduction

Configuration

Tracking

Sub Tracking :

File

Introduction

XMLtoTracking connector allows users to create new trackings or update old ones by inserting an XML file.

Configuration

Tracking

The connector requires an input XML file which must contain a parent tag <ixDoc> that includes all other tracking tags.

And here are some attributes that can be defined inside a tracking tag :

Attribute	Explanation	Example
TrkStatusTypeID	setting the ID of tracking status that would be changed.	TrkStatusTypeID = "12"
TrkStatusTypeAlias	It's another way to declare the tracking status using directly the alias	TrkStatusTypeAlias= ‘Delivred’
UpdateAllStatusFrom	The attribute allows updating the status of all trackings which have a certain status defined with TrkStatusTypeID or TrkStatusTypeAlias.	<Order TrkStatusTypeAlias = ‘Closed’ UpdateAllStatusFrom=‘Available’> --> this will change the value of status from 'Closed' to "Available" in all "Order" trackings.
TrkID	This will update a certain tracking with the TrkID value if it exists. If not, it will be added with this TrkID.	TrkID = 245
EnvAlias	It aims to relate the tracking to the indicated environments, which should be split by ';' inside the attribute.	EnvAlias = ‘Ixpath;loreal’
Key-Value	These 2 attributes retrieve a certain tracking with pairs of Key-Value split by ';', and update the corresponding tracking without creating a new one with the updated values. This pair came to replace the old method of GetTrkDataByData.	<Order Key="OrderNumber;BuyerCode" Value="19222;4000"> --> it will retrieve the first 'Order' that contains OrderNumber = 19222 and BuyerCode=4000, and update it.

Example of the input XML file :

The following example updates a tracking with TrkID=162470 with embedded tags data and the status, and an other one with Key-Value pair (LineNumber=12 and ProdItemNb=3300).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

<CMO_OrderLine TrkID="162470"
TrkStatusTypeID="0"
TrkTypeID="86">
<SAP_ProductCode>1050634</SAP_ProductCode>
<LabelProduct>FORLAXGO 12STICKS CZ PL</LabelProduct>
<OrderedQuantity>7000</OrderedQuantity>
<DeliveryDate>2019-02-10</DeliveryDate>
<ProductionEndDate></ProductionEndDate>
<LineNumber>10</LineNumber>
<ConfirmedQty>7000</ConfirmedQty>
<ProdItemNb>3</ProdItemNb>
</CMO_OrderLine>
<CMO_OrderLine Key ="LineNumber;ProdItemNb" Value="12;3300"
TrkStatusTypeID="0"
TrkTypeID="86">
<SAP_ProductCode>1670634</SAP_ProductCode>
<LabelProduct>FORLAXGO 12STICKS MA FR</LabelProduct>
<OrderedQuantity>7000</OrderedQuantity>
<DeliveryDate>2019-08-10</DeliveryDate>
<ProductionEndDate></ProductionEndDate>
<LineNumber>10</LineNumber>
<ConfirmedQty>7000</ConfirmedQty>
<ProdItemNb>3</ProdItemNb>
</CMO_OrderLine>

Sub Tracking :

"XMLToTrk" allows also creating or updating sub-trackings.

an XML tag is recognized as sub-tracking if :

the tag has an attribute "Type" equal to 'Tracking.

OR

The tag name exists in the tracking type table of the database.

Example of the input XML file :

The folowing example include 2 sub-trackings of "CMO_ProdLine" inside the "CMO_OrderLine" tracking : first one has a TrkID = 162471 which need to be updated, and the other one is a new sub-tracking to be inserted.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

<CMO_OrderLine TrkID="162470" TrkStatusTypeID="0">
<SAP_ProductCode>1050634</SAP_ProductCode>
<LabelProduct>FORLAXGO 12STICKS CZ PL</LabelProduct>
<OrderedQuantity>7000</OrderedQuantity>
<DeliveryDate>2019-02-10</DeliveryDate>
<CMO_ProdLine TrkID="162471" TrkStatusTypeID="0">
<ProductionQty>2000</ProductionQty>
<BatchNumber>BL-112273</BatchNumber>
</CMO_ProdLine>
<CMO_ProdLine >
<ProductionQty>3000</ProductionQty>
<BatchNumber>CT-478743</BatchNumber>
</CMO_ProdLine>
</CMO_OrderLine>

File

We attach session files to a given tracking by adding a tag named 'FILE' inside the tracking wanted.

There are some attributes that would be filled to satisfy some criteria:

Attribute	Explanation	Example
FileTypeAlias	The type of files attached to Tracking.	Attachment, log, Work,… (EDI as the default value)
FileSensAlias	File sens	'in' , 'out' ('in' is the default value)
Connector	The name of the connector in the scenario, and that's will include all its files.	Connector = "XMLtoXML1"
UserFile	The path of the attached file to a user(absolute path).
SessionFile	The path of the attached file to a session (relative path to this session).	sessionFile= ‘in/7300111890.pdf’

Example of the input XML file :

1
2
3
4
5
6
7
8
9

<?xml version="1.0" encoding="UTF-8"?>
<ixDOC xmlns:ixf="http://www.ixPath.com/Function">
<CMO_OrderHeader TrkID="162469">
<File FileSensAlias="out"
FileTypeAlias="Attachment"
SessionFile="in/7300111890.pdf"></File>
</CMO_OrderHeader>
</ixDOC>

This example will add a session file "in/7300111890.pdf" for the TrkID = 162469 as an 'Attachment' with sens = 'out'.