T4S4  18.2 C7549 A21431
Teamcenter Gateway for SAP S/4HANA API Reference
TEAMCENTER DATA handling

Functions

 tpco_tcdcreate
 This function creates a TCData storage. More...
 
 tpco_tcddelete
 This function deletes a TCData storage. More...
 
 tpco_tcddump
 This function is a debug function and dumps the TCData storage into a file. More...
 
 tpco_tcdexists
 This function tests if a TAG/KEY exists. More...
 
 tpco_tcdexport
 This function exports a TCData storage to a platform dependent string. More...
 
 tpco_tcdget
 This function gets the value from a TAG/KEY. More...
 
 tpco_tcdgetall
 This function gets all KEYs and values from a TAG. More...
 
 tpco_tcdgetalltags
 This function gets all TAGs. More...
 
 tpco_tcdgetflag
 This function gets the TAG flag. More...
 
 tpco_tcdgetmem
 This function calculates the memory usage of a TCData storage. More...
 
 tpco_tcdimport
 This function imports a TCData storage from a platform dependent string. More...
 
 tpco_tcdsetencode
 This function sets the encoding for a TCData storage. More...
 
 tpco_tcdstore
 This function stores a value in the TCData stroage. More...
 
 tpco_tcdtagexists
 This function tests if a TAG exists. More...
 
 tpco_tcdtcldump
 This function is a debug function and dumps the TCData storage as TCL commands into a file . More...
 

Detailed Description

Function Documentation

◆ tpco_tcdcreate()

tpco_tcdcreate

This function creates a TCData storage.

Parameters
tagsizeThe maximum expected number of TAGs. This number is needed to determine the size of Hash-Keys.
maxmemThe maximum size of the memory usage (MByte). (0= unlimited)
Returns
handle ID
1 set tcdhd [tpco_tcdcreate 10000 0]

◆ tpco_tcddelete()

tpco_tcddelete

This function deletes a TCData storage.

Parameters
handleTCData handle ID
Returns
none

Referenced by T4X::BATCHJOB::EXPORT::executeExportJob(), T4X::BATCHJOB::IMPORT::executeImportJob(), and ITK::getObjectData().

◆ tpco_tcddump()

tpco_tcddump

This function is a debug function and dumps the TCData storage into a file.

Parameters
handleTCData handle ID
dumpfiledump filename
Returns
none
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000002 "hello 5" 8
7 tpco_tcddump $tcdhd tcdata.debug
8 puts [tpco_readfile tcdata.debug]
9 
10 output:
11 TAG :: tag0001
12  ATTR :: A000001 => hello 1
13  ATTR :: B000001 => hello 2
14 
15 TAG :: tag0002
16  ATTR :: A000001 => hello 3
17  ATTR :: B000001 => hello 4
18 
19 TAG :: tag0003
20  ATTR :: A000002 => hello 5

◆ tpco_tcdexists()

tpco_tcdexists

This function tests if a TAG/KEY exists.

Parameters
handleTCData handle ID
tagthe TAG name
tagthe KEY name
Returns
1= exists 0=not exists
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000001 "hello 5" 8
7 puts [tpco_tcdexists $tcdhd tag0002 B000001]
8 puts [tpco_tcdexists $tcdhd tag0002 C000001]
9 
10 output:
11 1
12 0

Referenced by T4X::TC::MAPPING::FieldMapping(), T4X::TC::MAPPING::findIndexedObjectId4Value(), T4X::TC::MAPPING::findIndexedObjectList4Attribute(), T4X::TC::MAPPING::findObjectId4Value(), T4X::TC::MAPPING::findObjectList(), T4X::TC::MAPPING::findObjectList4Value(), T4X::TC::MAPPING::findRootTaskObjectList(), T4X::TC::MAPPING::getObjectAttributeValue(), T4X::TC::MAPPING::getObjectsValueList(), T4X::TC::MAPPING::getPreferenceValue(), T4X::TC::MAPPING::getRootTaskFieldMappingValueList(), T4X::TC::MAPPING::IndexedFieldMapping(), T4X::TC::MAPPING::RootTaskFieldMapping(), T4X::TC::MAPPING::testFieldExists(), T4X::TC::MAPPING::testIndexedFieldExists(), and T4X::TC::MAPPING::testRootTaskFieldExists().

◆ tpco_tcdexport()

tpco_tcdexport

This function exports a TCData storage to a platform dependent string.

Warning: this representation of the string is only valid for the same platform (alignment, order, word size).

Parameters
tcdhdTCData handle ID
export-varnameTCL variable name
Returns
none

exports a TCData storage and writes the data into the file persistent.tcdata.

1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdexport $tcdhd tcdhdexport
3 tpco_writeflag persistent.tcdata $tcdhdexport

◆ tpco_tcdget()

tpco_tcdget

This function gets the value from a TAG/KEY.

Parameters
handleTCData handle ID
tagthe TAG name
tagthe KEY name
Returns
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000001 "hello 5" 8
7 puts [tpco_tcdget $tcdhd tag0002 A000001]
8 
9 output:
10 hello 3

Referenced by T4X::TC::MAPPING::FieldMapping(), T4X::TC::MAPPING::findIndexedObjectId4Value(), T4X::TC::MAPPING::findObjectId4Value(), T4X::TC::MAPPING::findObjectList4Value(), T4X::TC::MAPPING::getObjectAttributeValue(), T4X::TC::MAPPING::getObjectsValueList(), T4X::TC::MAPPING::getPreferenceValue(), T4X::TC::MAPPING::getRootTaskFieldMappingValueList(), T4X::TC::MAPPING::IndexedFieldMapping(), and T4X::TC::MAPPING::RootTaskFieldMapping().

◆ tpco_tcdgetall()

tpco_tcdgetall

This function gets all KEYs and values from a TAG.

Parameters
handleTCData handle ID
tagthe TAG name
Returns
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000001 "hello 5" 8
7 puts [tpco_tcdgetall $tcdhd tag0002]
8 
9 output:
10 A000001 {hello 3} B000001 {hello 4}

Referenced by T4X::TC::MAPPING::printIndexTcData(), T4X::TC::MAPPING::printTcBomLineData(), T4X::TC::MAPPING::printTcData(), and T4X::TC::MAPPING::printTcRootTaskData().

◆ tpco_tcdgetalltags()

tpco_tcdgetalltags

This function gets all TAGs.

Parameters
handleTCData handle ID
Returns
none
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000001 "hello 5" 8
7 puts [tpco_tcdgetalltags $tcdhd]
8 
9 output:
10 tag0001 tag0002 tag0003

◆ tpco_tcdgetflag()

tpco_tcdgetflag

This function gets the TAG flag.

Parameters
handleTCData handle ID
tagthe TAG name
Returns
the TAG flag
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000001 "hello 5" 8
7 puts [tpco_tcdgetflag $tcdhd tag0002]
8 
9 output:
10 6

◆ tpco_tcdgetmem()

tpco_tcdgetmem

This function calculates the memory usage of a TCData storage.

Returns
memory usage in byte
1 set tcdhd [tpco_tcdcreate 10000 0]
2 puts [tpco_tcdgetmem $tcdhd]#
3 
4 output:
5 3670200

◆ tpco_tcdimport()

tpco_tcdimport

This function imports a TCData storage from a platform dependent string.

Warning: this representation of the string is only valid for the same platform (alignment, order, word size).

Parameters
tcd-stringthe platform dependent string (persistent tcdata)
Returns
handle ID

import a TCData storage from the file persistent.tcdata.

1 set tcdata [tpco_readfile persistent.tcdata]
2 if {$tcdata != 1} {
3  set tcdhd [tpco_tcdimport $tcdata]
4  }

◆ tpco_tcdsetencode()

tpco_tcdsetencode

This function sets the encoding for a TCData storage.

Parameters
handleTCData handle ID
encodingtcl encoding (e.g. iso8859-15)
Returns
none
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdsetencode $tcdhd iso8859-15

◆ tpco_tcdstore()

tpco_tcdstore

This function stores a value in the TCData stroage.

Parameters
handleTCData handle ID
modeoverwrite= if exists leave= if exists not overwrite
tagthe tag name
keythe key name
valuethe tag/key value
flagthe tag flag (32 Bit interger). The new tag-value is TAGflag&= flag
Returns
none
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000001 "hello 5" 8

◆ tpco_tcdtagexists()

tpco_tcdtagexists

This function tests if a TAG exists.

Parameters
handleTCData handle ID
tagthe TAG name
Returns
1= exists 0=not exists
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000001 "hello 5" 8
7 puts [tpco_tcdtagexists $tcdhd tag0002]
8 
9 output:
10 1

Referenced by T4X::TC::MAPPING::printTcData().

◆ tpco_tcdtcldump()

tpco_tcdtcldump

This function is a debug function and dumps the TCData storage as TCL commands into a file .

You can dump the TCData storage to a TCL file, which can then be sourced. After the sourcing, the variable ::it includes the tcdata handle.

Parameters
handleTCData handle ID
dumpfiledump filename
Returns
none
1 set tcdhd [tpco_tcdcreate 10000 0]
2 tpco_tcdstore $tcdhd leave tag0001 A000001 "hello 1" 0
3 tpco_tcdstore $tcdhd leave tag0001 B000001 "hello 2" 1
4 tpco_tcdstore $tcdhd leave tag0002 A000001 "hello 3" 2
5 tpco_tcdstore $tcdhd leave tag0002 B000001 "hello 4" 4
6 tpco_tcdstore $tcdhd leave tag0003 A000002 "hello 5" 8
7 tpco_tcdtcldump $tcdhd tcdata.tcl
8 tpco_tcddelete $tcdhd
9 
10 source tcdata.tcl
11 puts [tpco_tcdget $::it tag0002 A000001]
12 
13 output:
14 hello 3