0% found this document useful (0 votes)
162 views

csv2tcxml User Guide

Uploaded by

adarshahah97
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views

csv2tcxml User Guide

Uploaded by

adarshahah97
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

CSV2TCXML Converter Guide

Digital Industries Software TEAMCENTER

CSV2TCXML Converter Guide – Teamcenter 13.2

Unrestricted 1
CSV2TCXML Converter Guide

Contents
1. Introduction .............................................................................................................................................. 5
2. CSV input ................................................................................................................................................... 5
2.1 Encoding supported ............................................................................................................................ 6
3. Installation/Setup...................................................................................................................................... 6
4. Command Usage ....................................................................................................................................... 7
5. Tool configuration ..................................................................................................................................... 7
6. Features .................................................................................................................................................... 8
6.1 Object name - class name with tag ..................................................................................................... 8
6.2 Object type .......................................................................................................................................... 8
6.3 Value validation .................................................................................................................................. 9
6.3.1 String ............................................................................................................................................ 9
6.3.2 Integer ........................................................................................................................................ 10
6.3.3 Double ........................................................................................................................................ 10
6.3.4 Date ............................................................................................................................................ 10
6.3.5 Logical ........................................................................................................................................ 11
6.3.6 Reference ................................................................................................................................... 11
6.3.7 LOV ............................................................................................................................................. 11
6.4 Admin object and candidate key ...................................................................................................... 12
6.5 Principal object and its helper .......................................................................................................... 13
6.6 Object linking .................................................................................................................................... 14
6.6.1 Linking rule in the header .......................................................................................................... 15
6.6.2 Linking rule in class’s helper ...................................................................................................... 15
6.6.3 Linking rule in initial value ......................................................................................................... 16
6.6.4 Link without linking rule............................................................................................................. 16
6.7 Object GSID and PUID ....................................................................................................................... 16
6.7.1 Avoid GSID clash......................................................................................................................... 17
6.8 Object ID ........................................................................................................................................... 18
6.9 Cross file reference and multiple input files ..................................................................................... 18
6.10 Aggregation class ............................................................................................................................ 19
6.11 Attribute Propagation ..................................................................................................................... 19
6.11.1 Propagation Rule ...................................................................................................................... 19
6.11.2 Customized attribute propagation........................................................................................... 20

Unrestricted 2
CSV2TCXML Converter Guide

6.12 Object island ................................................................................................................................... 21


6.13 Object grouping .............................................................................................................................. 21
6.14 Combined column ........................................................................................................................... 22
6.15 Column Alias ................................................................................................................................... 22
6.16 Query database for existing objects ............................................................................................... 22
7. Templates/Objects supported ................................................................................................................ 23
7.1 Item & ItemRevision ......................................................................................................................... 23
7.2 Custom forms .................................................................................................................................... 23
7.3 Dataset .............................................................................................................................................. 24
7.3.1 Link Dataset to ItemRevision ..................................................................................................... 24
7.4 Work with ImanFiles ......................................................................................................................... 25
7.5 BOM Structure .................................................................................................................................. 26
7.5.1 PSOccurrence structure ............................................................................................................. 26
7.5.2 AbsOccurrence Structure ........................................................................................................... 27
7.6 GDE lines in BOM structure .............................................................................................................. 28
7.7 Table property................................................................................................................................... 29
7.8 4GD Support...................................................................................................................................... 29
7.8.1 Cpd0CollaborationDesign .......................................................................................................... 29
7.8.2 Partitions and its hierarchy ........................................................................................................ 30
7.8.3 Promissory and Shape Design Element...................................................................................... 30
7.8.4 Reuse and subordinate design element .................................................................................... 30
7.8.5 AttributeGroup and ManagedAttributeGroup .......................................................................... 31
7.9 Classification Object .......................................................................................................................... 31
7.10 Product Configurator ...................................................................................................................... 32
7.11 Schedule and ScheduleTask ............................................................................................................ 33
8. Update Mode .......................................................................................................................................... 34
8.1 Identify the object............................................................................................................................. 34
8.2 Update object attributes................................................................................................................... 35
9. Extend the framework ............................................................................................................................ 35
9.1 Support new type of object .............................................................................................................. 36
Appendices.................................................................................................................................................. 37
A. Encoding List ....................................................................................................................................... 37
B. Parameters.......................................................................................................................................... 38

Unrestricted 3
CSV2TCXML Converter Guide

B.1 Config ............................................................................................................................................ 38


B.2 InitialValues................................................................................................................................... 39
B.3 CsvReader ..................................................................................................................................... 40
B.4 QueryDB ........................................................................................................................................ 40
B.5 DatasetAttachments ..................................................................................................................... 40
B.6 PhysicalStructure .......................................................................................................................... 41
B.7 PropagationRule ........................................................................................................................... 41
B.8 Undocumented sections ............................................................................................................... 41
C. Admin classes and candidate attributes ............................................................................................. 41
D. Supported classes ............................................................................................................................... 42
D.1 Foundation.................................................................................................................................... 42
D.3 Appmodel ..................................................................................................................................... 42
D.3 Cpd ................................................................................................................................................ 42
D.4 Partition ........................................................................................................................................ 42
D.5 Realization .................................................................................................................................... 42
D.6 Mdc0mdconnectivity .................................................................................................................... 42
D.7 Smd0systemmodeling .................................................................................................................. 42
D.8 Pdm0plantdatamgmt.................................................................................................................... 42
D.9 Cfg0configurator ........................................................................................................................... 42
D.10 Mrocore ...................................................................................................................................... 43
D.11 Serviceplanning .......................................................................................................................... 43

Unrestricted 4
CSV2TCXML Converter Guide

1. Introduction
Bulk migration of data from legacy/enterprise systems to Teamcenter can be done by extracting the
data in CSV format (using SQL or other tools in that system), then converting it into TCXML using the
csv2tcxml converter, then the TCXML file can be imported into Teamcenter using Bulk loader.

This document is for the new utility shipped with Tc11.6, Tc12.1 and later. The old version is
deprecated now and will be removed from a future release.

To use the utility, basically there are 3 steps:

1. Prepare your data in CSV format


2. Convert your CSV input file to TCXML file using the csv2tcxml tool
3. Import the TCXML file into Teamcenter using tcxml_import utility

This utility is intended to be extendable to support any template or application. It is a framework and
easy to extend.

2. CSV input
CSV file has its own standard. There is an RFC document for it - https://tools.ietf.org/html/rfc4180.

The csv2tcxml tool now supports standard CSV file. It is recommended that you go through the standard
using the link above. Here are some highlighted points:

• If your data string contains commas, you need to quote the data string in double quotes. For
example:
aaa,bbb,”cc,c”
• If your data string contains double quotes, you need to quote the data string first and then
escape the double quote by preceding it with another double quote. For example:
aaa,”b””bb”,ccc

Although a header is optional for a CSV file, for the csv2tcxml tool, it is mandatory.

Unlike the old version, you don’t need to put an exclamation mark at the beginning of the header,
and you can use comma as separator in the header. An input file with an exclamation mark will be
treated as legacy input and a warning will be displayed.

There are some parameters relating to the CSV input file which may simplify CSV creation. For example,
in your data, you have a string like ‘12" CYL ASSEMBLY, APPROVED’. The string has a comma and a
double quote. According to the CSV standard, you need to represent it as “12”” CYL ASSEMBLY,
APPROVED”. But if you set the following two parameters for the tool, you don’t need to change the
value. The setting means you will use # as separator and $ as quote char. Then there is no conflict and
no quote or escape is needed. But accordingly, you must use ‘#’ as separator for the whole csv file.

sep=#

quote=$

Unrestricted 5
CSV2TCXML Converter Guide

Try to use different separator and quote chars to avoid quoting and escaping. It is much easier than
formatting the data.

To see how to set parameters, refer to Tool Configuration.

2.1 Encoding supported


The tool supports a long list of encodings now - not only ASCII and UTF-8. For a full list of supported
encoding, see appendix A.

Please note that the tool will not guess or deduce the encoding of the input file. You must specify the
encoding of your input file through the encoding parameter, otherwise some default value (utf8) in
configuration file - csv2tcxml.ini - will be used.

For example, if the input is in UTF-8, set the parameter as


encoding=utf8

If the input is in gb2312, change the setting to


encoding=gb2312

Create your own configuration file for each input csv in case they have different encodings.

For the output XML, it is always encoded in UTF-8.

3. Installation/Setup
Before you can convert any CSV file, you must perform the following setup steps. The following steps
need to be performed only once.

1) Open a Teamcenter command prompt and cd to the TC_DATA/csv2tcxml directory.


2) Execute the following command to let the tool parse the templates and generate the data model
files used by the tool.

csv2tcxml install [username password group] [-t template_name]* [-c|-


classification]

Arguments in bracket [] is optional. * means 0 or multiple times.

3) Open csv2tcxml.ini and set source_site to a migration ID provided by PLMS customer support.

Regarding step 2, the command will generate several files:


1. model/tc_datamodel.xml – the data model information extracted from the template files
2. model/csv2tcxml_datamodel.xml – data model override and definitions used by the csv2tcxml
tool. It is a combination of files in model/datamodel. If one template is not installed, it will not
be included in csv2tcxml_datamodel.xml neither.
3. model/datamodel.html – a simple offline web page in which you can search and check the data
model information.

Unrestricted 6
CSV2TCXML Converter Guide

4. model/tc_admin_data.json – a json file that contains the admin information fetched from the
Teamcenter in case you give the administrator credential. This information is used by the tool to
set some attributes for ImanFile object automatically, such as volume_tag and sd_path_name.
This json file will not be generated if the credential is not given.
If you are going to work with ImanFile object, giving administrator credential during install step is
strongly recommended.

If you know what templates you are going to work on, you can use the –t option to parse those
specific templates – the tool will take care of the template dependences. You can give multiple
templates with multiple –t options. Fewer templates mean better performance. If no option is given, all
templates in TC_DATA_MODEL folder will be parsed.
If you don’t have a Teamcenter environment, but just have a folder containing all the templates, you can
use the following command:

csv2tcxml install Templates_Folder [-t template_name]*

template_dependency.xml must exist in the same directory as the template file for the tool to
parse the data model correctly. The tool will handle the dependences properly.
Option –c is for generating classification definition page. If this option is given, the tool will call
plmxml_export to get the complete classification hierarchy from the database and then covert the
output XML to an html page – model/classification.html. This page is very usage for working with
classification objects – icm0. Since TC server connection is needed, you must give administrator
credential like – “tcadmin tcadmin dba”.

4. Command Usage
To convert a csv file, run following command:

csv2tcxml input.csv [–p ParameterName=Value]* [-o OutputFilePath]

Only the input CSV file is mandatory. You can define parameters in the command line and the values
given in the command take the highest precedence.

To import the data into Teamcenter, you need to run the following command from the Teamcenter
console:
tcxml_import –file=tcxml_path.xml –bulk_load

Check the import log to make sure the import completed successfully.

5. Tool configuration
This tool is configurable. You can change its default behavior through parameters. All parameters are
defined in the csv2tcxml.ini file. Each parameter belongs to one specific section. For example, ‘encoding’
is defined in the ‘Config’ section, and ‘sep’ is defined in ‘CsvReader’ section. The parameter name is
case-sensitive.

Unrestricted 7
CSV2TCXML Converter Guide

For csv2tcxml.ini, you should rarely change it, because most of the parameters are related to a specific
input file. You should create a dedicated .ini file for the input instead of modifying the global
csv2tcxml.ini file.

For example, if you have an input csv file - utf8_encoding.csv. Instead of setting encoding=utf8 in
csv2tcxml.ini, you can create an .ini file named utf8_encoding.csv.ini and add the following content:
[Config]

encoding=utf8

For another file, gb2312_encoding.csv, you can create another .ini file and set encoding to gb2312. Now
the configuration is modularized and less prone to error.

Any parameters in an .ini file can be overridden by the command line option –p. This is helpful for
automation. If you are setting a parameter through the command line for the [Config] section, you don’t
need to give the section name. But if you want to set a parameter from another section, full parameter
name needs to be given. For example, –p [CsvReader]sep=#.

It is recommended that you do not change any parameters in csv2tcxml.ini except


[Config]source_site. Create dedicated .ini files for your input files or use command line parameter
override.

6. Features
6.1 Object name - class name with tag
In the CSV header, normally you need to give classname:attribute-name as column name. Sometimes,
one row can create multiple objects of the same class. For example, master forms - there is one master
form for Item and one master form for ItemRevision. Although they have different types, most of the
time they are all of Form class. If you wanted to override some attribute on one of the forms, the old
script did not have that capability.

To solve this problem, we introduce object name. Each column would be object-name:attribute-name.
Object name is composed of the class name and an optional tag – like Dataset[UG]. The UG inside the
brackets is a tag. The tag could be any word characters ([-_0-9a-zA-Z]+).

Now in one row, you can create multiple objects of the same class. Refer to the example –
foundation/Item_two_DS.csv. In that file, it creates two Datasets for each row and the header is like:
Item:item_id,Item:object_type,ItemRevision:item_revision_id,Dataset[UG]
:dataset_type,Dataset[UG]:object_name,Dataset[JT]:dataset_type,Dataset[
JT]:object_name

Add a name tag only when it is needed. Class name alone can also be the object name.

6.2 Object type


When the converter tries to create an object/element, the first thing it needs to know is the type – not
the class. From type, we can find its class from data model. From class, we may not know the type. Let’s
say only the class name is given through the header. How will the tool find its type?

Unrestricted 8
CSV2TCXML Converter Guide

1. If there is a type whose typeClassName and typeName are both equal to the header class name,
then it will use this type.
2. Otherwise, find all the types whose typeClassName is equal to the header class name. If only
one type is found, use that type. Otherwise, report an error.

You can give the type information through an extra column like Item:object_type. This is referred to as a
dynamic type.

For example:
Item:item_id,ItemRevision:item_revision_id,Item:object_type
CSV_00001,A,Design
CSV_00002,A,Part
This will create two different types of Item in one file. The item for the first row is Design, the second is
Part.

Or, if the Item type is fixed in one file, you can author the csv like below:
Design:item_id,Design_0_Revision_alt:item_revision_id
CSV_00001,A
CSV_00002,A
For this case, the Item will be Design always.

6.3 Value validation


For any attribute, it can be one of the following types:

1) String
2) Integer
3) Double
4) Date
5) Logical
6) Reference

The attribute type is defined in data model. For VLA and LOV, this tool will also handle their value
validation.

If an attribute is a VLA or fix array, each value will be checked – no exception.

For a fix array attribute, if less values are given, empty values will be appended. If more values are given,
an error will be reported.

Note that empty string is always a valid value.

6.3.1 String
For string attribute, we will do Max String Length check. In data model, if a max string length is defined,
we will check if the value exceeds that limitation.

If longer value is given, a warning message will be reported, and the value will be truncated. There is no
way to bypass this check and truncation.

Unrestricted 9
CSV2TCXML Converter Guide

If an LOV is attached to this attribute, the value needs to be a valid value in the LOV, otherwise an error
will be logged. But the value will still be set.

The max string length is measured using database encoding in byte length instead of in character length.
So, one character may occupy different number of bytes in different databases with different encodings.
The tool will assume utf8 encoding for database encoding if you don’t set parameter db_encoding.

6.3.2 Integer
If the value is not an integer, an error will be logged. The value will be reset to empty.

If an LOV is attached to this attribute, the value needs to be a valid value in the LOV, otherwise an error
will be logged. But the value will still be set.

6.3.3 Double
A double value could be -123.4567e-89, or you can give integer like 123.

If an invalid value is given, an error will be logged, and the value will be reset to empty.

6.3.4 Date
By default, only the following format is supported:

YYYY\Dmm\Ddd(\DHH\DMM\DSS)?

\D means any non-digital character. Time part is optional – if not given, 00:00:00 will be set. Some
examples:

2018-12-06 9:10:8 or 2018/12/6-9:10:8

2018-12-6

The tool will convert them to 2018-12-06T09:12:13Z and 2016-12-06T00:00:00Z respectively which are
both GMT times.

If the input date string is not in the specific format, or you want to do some time zone conversion, set
the parameter local_time_zone to some time zone value. -500 means UTC-05:00 Eastern Time. +900
means UTC+09:00 time zone. GMT means GMT time. If you set this parameter, the tool can recognize
the following time formats beside the default format:

1) "Wed, 09 Feb 1994 22:23:32 GMT" -- HTTP format


2) "Thu Feb 3 17:03:55 GMT 1994" -- ctime(3) format
3) "Thu Feb 3 00:00:00 1994", -- ANSI C asctime() format
4) "Tuesday, 08-Feb-94 14:15:29 GMT" -- old rfc850 HTTP format
5) "Tuesday, 08-Feb-1994 14:15:29 GMT" -- broken rfc850 HTTP format
6) "03/Feb/1994:17:03:55 -0700" -- common logfile format
7) "09 Feb 1994 22:23:32 GMT" -- HTTP format (no weekday)
8) "08-Feb-94 14:15:29 GMT" -- rfc850 format (no weekday)
9) "08-Feb-1994 14:15:29 GMT" -- broken rfc850 format (no weekday)
10) "1994-02-03 14:15:29 -0100" -- ISO 8601 format
11) "1994-02-03 14:15:29" -- zone is optional
12) "1994-02-03" -- only date

Unrestricted 10
CSV2TCXML Converter Guide

13) "1994-02-03T14:15:29" -- Use T as separator


14) "19940203T141529Z" -- ISO 8601 compact format
15) "19940203" -- only date
16) "08-Feb-94" -- old rfc850 HTTP format (no weekday, no time)
17) "08-Feb-1994" -- broken rfc850 HTTP format (no weekday, no time)
18) "09 Feb 1994" -- proposed new HTTP format (no weekday, no time)
19) "03/Feb/1994" -- common logfile format (no time, no offset)
20) "Feb 3 1994" -- Unix 'ls -l' format
21) "Feb 3 17:03" -- Unix 'ls -l' format
22) "11-15-96 03:52PM" -- Windows 'dir' format

If a string cannot be parsed as a date, an error will be logged, and the value will be reset to empty.

The local to GMT time conversion can only handle date between 1901-12-17 00:00:00 GMT and
2038-01-16 23:59:59 GMT. If a date is beyond the scope and local_time_zone is set, the date needs to
be given in GMT time to avoid the local to GMT conversion, such as 9999-12-30Z. The suffix ‘Z’ indicate it
is a GMT time and the final date string will be ‘9999-12-30T00:00:00Z’.

6.3.5 Logical
Valid logical values are true, false, y[es], n[o] – case-insensitive. For example, True, False, Y and n are all
valid values. But, ‘not’ is invalid.

If an invalid value is given, an error will be logged, and the value will be reset to empty.

6.3.6 Reference
How can you give a value for a reference attribute? Normally, you can give a PUID directly, or a GSID
string of the object. Regarding PUID and GSID, refer to Object GSID and PUID.

Or you can give an ID for the object you want to reference in the same file and reference that object
using its ID later. Regarding object ID, refer to Object ID.

For an attribute referring to an admin object, you need to give the candidate key value. Refer to Admin
object and candidate key.

6.3.7 LOV
If an attribute has list of values attached, then those are the valid values you should give. The tool
fetches this LOV attachment information from the data model and will do a value check automatically.

If the value is not in the list, an error will be logged, and the value will be set as it is.

Limitation – for cascading LOVs, the relationship between parent property value and child property
value is not checked. For a level 2 property, all its possible values are valid without checking its parent’s
property value.

Use parameter lov_validate to skip LOV checking. Setting lov_validate to 0 will bypass the LOV
validation.

Unrestricted 11
CSV2TCXML Converter Guide

6.4 Admin object and candidate key


In TCXML, there are two types of data – admin data and transfer data. Admin data will not be
transferred and the TCXML import will always search the admin objects in the target system. Admin data
will be in island 0 in the XML before transfer data begins.

Every admin object class will have a candidate key defined. For example, user_id is the key for User and
project_id is the key for TC_Project.

Refer to appendix C for a list of admin objects and their candidate attributes.

You can extend or define your own admin class if needed. See how to extend the framework.

You do not need to create an admin object in csv file, when an admin object is needed, just give its
candidate key value.

For example:
Item:item_id,ItemRevision:item_revision_id,Item:owning_user,ItemRevisio
n:owning_user,ItemRevision:owning_group
Item00001,A,tcadmin,chenji,Engineering
Item00002,A,chenji,tcadmin,dba

In the above example, you just give the user id and group id in the corresponding column. The tool will
handle the real reference for you.

Before you give a value, make sure that you know it is an admin reference attribute and what the
candidate key is.

You can find the candidate key for a type/class by opening the datamodel.html file in the ‘model’
folder. Search and select the type/class first, on the right panel, the candidate key will be shown if it has
one:

The tool will check the data model to see if a reference attribute is pointing to some admin type. That’s
why for owning_user you just give a string value, and the tool knows it should be a user_id and a User
element should be referenced.

There is one special case that some attribute can reference different type of admin objects. For
example, ScheduleMember.resource_tag is a typed reference pointing to POM_object. In application, it
can point to a Group or to a User. Then the tool has no way to know which admin class it is pointing to.

Unrestricted 12
CSV2TCXML Converter Guide

To give a value for this attribute, the value should be like ‘dba@Group’ or migration@User’. The part
before the ‘@’ char is the candidate key value, the string after ‘@’ is the admin class name.

6.5 Principal object and its helper


Before converting the data, the tool will first parse the header to find what the principal objects are.
Principal object are objects that have MFK defined or key attributes defined.

For example, in the following header:


Item[A]:item_id,ItemRevision[A]:item_revision_id,Item[B],ItemRevision[B
]:item_revision_id

Item[A] and Item[B] are principal objects, because Item has MFK defined – Item{item_id}.
ItemRevisions are not principal objects. The tool even doesn’t know if those two columns –
ItemRevision[A] and ItemRevision[B] - will be used before processing each row.
Then, for each row, the tool will create those principal objects one by one. After object creation,
following steps will happen:

1) Go through all the columns to see if some value should apply. If any of the following two
conditions match, the value will be assigned to the object:
1. current object has the same name as the column’s object name
2. the column’s object name is a class name and this object is of the same class or its
subclass
2) Create helper objects defined for this class
3) Call object extension – onCreate
4) Apply initial values got from data model for current object

Some other steps will also occur.

For the above example, when Item is created, since Item has onCreate extension registered, some
extension function will be called. In that extension, ItemRevision will be created and that new object will
go through the same steps as Item. Then the extension will link Item and ItemRevision together.

Helper object may have its own helper object defined, like master form for ItemRevision, storage class
for forms, etc. Principal object creation may trigger a bunch of objects to be created like a chain.

After principal objects are created, the object creation for this row is done.

If in one csv file, you just give:


Mdl0DefaultGeometry:mdl0ext_transform_rot00,Mdl0DefaultGeometry:mdl0ext
_transform_rot10

No object will be created, because there is no principal object at all. It is like creating object in the RAC,
you cannot create Default Geometry alone; you must create its principal object – Design Element. That
doesn’t mean Mdl0DefaultGeometry cannot be created.

Besides objects with MFK, in the csv2tcxml_data_model.xml file, we also define keyAttributes for some
classes to make it principal. One example:

Unrestricted 13
CSV2TCXML Converter Guide

<TcClass className="Mdl0ApplicationModel"
keyAttributes="mdl0model_id"/>

To check if a type/class is principal, you can open the model/datamodel.html page generated during
the install step. Search the type/class in the left tree panel, on the right panel, you can see what the key
definition is:

Whenever an object is created, the tool will check if there is a helper object defined for it. In
csv2tcxml_datamodel.xml, we have defined the following:
<TcClass className="Mdl0ConditionalElement"
helper="Mdl0ElementThread(&lt;-$.mdl0element_thread;&lt;-
$.wso_thread)"/>

For each Mdl0ConditionalElement (including subclasses) object, the tool will create an
Mdl0ElementThread for it and link it to the main object - Mdl0ConditionalElement – automatically. Refer
to Linking rule in class’s helper.

Generally, there are three ways to create helper objects:

1) Define helper for a class in csv2tcxml_data_model.xml


2) Define linking rule for an object in the header – refer to Linking rule in header
3) Create extra helper by coding in onCreate or postCreate extensions

Regarding item 2, if you want to create an extra Form object and attach it to an ItemRevision:
Item:item_id,ItemRevision:item_revision_id,Form[CostData]:object_type(<
-IMAN_Reference<-ItemRevision)
CSV_00002,A,CostDataForm

In the last column, it has a linking rule – refer to linking rule in header. With the linking rule in the
header, the tool knows you want to create that object and link it to some other object. If you remove
the linking rule from last column, the extra Form will not be created since Form is not a principal object.

Siemens recommends you do not attempt to create objects through extensions.

6.6 Object linking


The tool will not only create the objects, but also try to link them. Linking rules specify how the objects
will be connected. In general, objects can be linked through reference attributes or GRM (ImanRelation).

For GRM, it is one-to-one link. To write a rule to link two objects by GRM, there are two formats:

1. PrimaryObjectName->RelationType->SecondaryObjectName

Unrestricted 14
CSV2TCXML Converter Guide

2. SecondaryObjectName<-RelationType<-PrimaryObjectName

For reference attribute, it is one-to-one or one-to-N relationship. There are two formats to represent
this kind of link:

3. MainObjectName.attribute_name->ReferencedObjectName

4. ReferencedObjectName<-MainObjectName.attribute_name

You just need to write part of these linking rules. Currently, linking rules can appear in 3 places:

6.6.1 Linking rule in the header


In the csv header, you can append linking to an object:

Header column Linking rule generated Comment


P:a(->R->S) P->R->S GRM forward linking
S:a(<-R<-P) S<-R<-P GRM backward linking
P:a(b->S) P.b->S Attribute forward linking
S:a(<-P.b) S<-P.b Attribute backward linking

The tool will use the object name as the left most part of the linking rule. You must write the remaining
part of the rule in parentheses. There can be multiple rules for one name as shown in the following:
Pdm0ExternalModel:pdm0ModelId(pdm0TargetModel->Cpd0CollaborativeDesign;
<-Pdm0RelatedModel<-
Prg0ProgramPlan),Cpd0CollaborativeDesign:mdl0model_id,Prg0ProgramPlan:p
rg0PlanId;Prg0ProgramPlan:object_name
0x0001,CD00001,PRG0001
Multiple rules are separated by semicolons. The above header will generate two rules:
Pdm0ExternalModel.pdm0TargetModel->Cpd0CollaborativeDesign
Pdm0ExternalModel<-Pdm0RelatedModel<-Prg0ProgramPlan

This kind of linking rule will be executed after all objects are created for a row.

6.6.2 Linking rule in class’s helper


In the csv data model file, you can define helpers for a class. When you write a concrete class as a helper
object, normally you want to link that helper object to the main object. In the helper rule, $ represents
the main object which triggers this helper creation. For example:
<TcClass className="Mdl0ConditionalElement"
helper="Mdl0ElementThread(&lt;-$.mdl0element_thread;&lt;-
$.wso_thread)"/>

This rule is defined in XML, so you must write ‘&lt’ for ‘<’.

The linking rule is also enclosed in parentheses and delimited by semicolons. Two linking rules will be
generated for the above example:
Mdl0ElementThread<-Mdl0ConditionalElement.mdl0element_thread
Mdl0ElementThread<-Mdl0ConditionalElement.wso_thread

Unrestricted 15
CSV2TCXML Converter Guide

These linking rules will be executed just after the helper’s creation.

One main object may have multiple helpers and they can be linked together.
A(a->$),B(<-$.b;->R->A)

The above rule will generate two helper objects A and B, and following link rules are formed too:
A.a->$
B<-$.b
B->R->A

Both A and B are linked to the main object and there is a GRM which links A and B, too.

Multiple helper objects are separated by commas.

6.6.3 Linking rule in initial value


The linking rule may also be used in the initial value for a specific attribute.

One example below:


<TcClass className="Mdl0ModelElement">
<TcAttribute attributeName="mdl0model_object"
initialValue="(->Mdl0ApplicationModel)"/>
</TcClass>

The rule generated is Mdl0ModelElement.mdl0model_object->Mdl0ApplicationModel. Note that the


rule is enclosed in parentheses too.

Since the left part is already known - Mdl0ModelElement.mdl0model_object, you only need to write the
remaining part. Only one kind of link rule is supported here – forward attribute linking.

This kind of rule will be executed together with header linking rules after object creation.

6.6.4 Link without linking rule


Linking rules are not the only way to link objects. You can directly give a value to a reference attribute.
Unlike an admin object reference which you give a candidate key value, you can give a GSID or PUID, or
Object ID.

6.7 Object GSID and PUID


Every object in Teamcenter needs a unique PUID. The tool needs to generate the PUID for each object.
Every object generated by the tool will have a GSID string. This string will then be hashed to get the
PUID.

What is the input for the hash?

a. GSID
b. Source site id

When both factors are the same, the same PUID will be generated. Request new source site id from
PLMS customer support so that the PUID will be unique between different migrations. Otherwise those
sites cannot do data exchange later due to PUID clash.

Unrestricted 16
CSV2TCXML Converter Guide

Within one migration project, the site id will not change most of the time. Then, the same GSID will give
you the same PUID. That’s why you can use GSID string in a reference attribute and the tool will do the
hashing automatically.

In legacy csv2tcxml script, user needs to put a special sign – ‘$’ – in header to trigger PUID hash. The
new tool will automatically check data model and the value to see if a hash is needed. Special symbols
like “$” or “#” are not supported in the header anymore.

The GSID string is composed of some key attribute values + object type name. Object type will always be
part of the GSID string.

Key attributes for an object can be the MFK or keyAttributes defined for the class. For example, Item has
mfk defined – Item{item_id}. For Item 000100, its GSID string would be 000100!Item. For Design
000100, the GSID will be 000100!Design.

For helper objects, the GSID would be main object’s GSID [+ some extra attribute values] + object type
name. The main object’s GSID is included to avoid PUID clash.

You can find every object’s GSID by setting one parameter – save_gsid_out. Set this parameter to 1, and
after converting, a gsid.out file will be generated. This file contains the PUID/GSID pairs for all objects.

You can also query the PUID for an existing object in the database. If found, the tool will not do a GSID
hash for it and the PUID found will be used directly. Refer to Query database for existing objects.

6.7.1 Avoid GSID clash


For objects have MFK defined, the GSID should never clash. But for other objects, the GSID may
duplicate. Let’s say, you want to create two objects of the same type and every attribute has the same
value except PUID. In RAC, it is possible. For this tool, no matter what attribute you choose, you will get
the same GSID for them – then GSID clash.

To conquer this problem, an artificial attribute is introduced – gsid_suffix.

The column name should be object-name:gsid_suffix. If object-name is just a class name, its value will
not apply to any subclasses. The composition of object GSID will still follow the existing rules; after that,
if an object has gsid_suffix supplied, that suffix will be appended to the GSID string. User is responsible
to give a unique value and guarantee the composed GSID is unique with gsid_suffix appended.

gsid_suffix is only useful when there is no good way to distinguish two objects through their attribute
values. It is valid for any object, but you should never use it for the object with MFK defined.

For example, to create two datasets of the same type attached to the same ItemRevision:
Item:item_id,ItemRevision:item_revision_id,Dataset:dataset_type,Dataset
:object_name(<-IMAN_reference<-ItemRevision),Dataset:gsid_suffix
CSV_00001,A,Text,CSV_00001/A,Unique_id1
CSV_00001,A,Text,CSV_00001/A,Unique_id2
Since the key attribute for Dataset is “$parent,object_name”, and those two datasets have the same
parent object (ItemRevision) and object_name (CSV_00001/A), then those two objects will have the
same GSID if gsid_suffix is not given.
As shown in the example, the clash can be avoided with the suffix.

Unrestricted 17
CSV2TCXML Converter Guide

Let’s say two instances for a class can have the same values for all their attributes except PUID, then
how you can define the key attribute to make it principal. You can just put gsid_suffix as its key attribute
to make that class a principal one. The final GSID string for the object would be
“!TypeName!gsid_suffix_value”. You are responsible to make sure the GSID is unique.

6.8 Object ID
The tool will process the data line by line. Once a line is done, it will forget about it and move to next
line. If in one line, you want to reference some object generated in previous line, there are few options.

If the referenced object is a principal object, you can repeat that object by giving key values. This needs
file header change and sometimes may be overwhelm.

If the referenced object is some helper object, it is nearly impossible to reference it. For example, to
reference some PSOccurrence object generated in a BOM csv file.

To solve this problem, the tool introduces a new artificial attribute – ‘_id_’. You can set it like a normal
attribute for any object. The value can be any string that is unique within one conversion.

During conversion, the tool will bind the object ID to its PUID after processing the line. Then later lines
can reference that object using {ID}.
Item:item_id,ItemRevision:item_revision_id,ItemRevision:_id_,ImanRelati
on:relation_type(pimary_object->ItemRevision),ImanRelation:secondary_ob
ject
000023,A,000023/A
000023,B,000023/B,IMAN_based_on,{000023/A}

The first line will create ItemRevision A for 000023 and bound an ID – 000023/A - to it. In a later line,
another revision B is created and linked with revision A by a GRM.
With object ID, we can easily achieve this kind of cross line reference.

6.9 Cross file reference and multiple input files


Object ID is not limited to one file. The tool now can support multiple input files and you can setup
references cross files.

This is for complex data model like service planning and BOP which has multiple windows. It is nearly
impossible to describe all windows in one file. To split the data into multiple csv file, we found cross file
reference is needed.

To allow cross file reference, all the input files must be converted together in one command line:
csv2tcxml input1.csv input2.csv [-o output.xml]

Let’s use a similar example as previous section. First input to create Item and ItemRevisions.
Item:item_id,ItemRevision:item_revision_id,ItemRevision:_id_
000023,A,000023/A
000023,B,000023/B

Second input to link ItemRevisions:

Unrestricted 18
CSV2TCXML Converter Guide

ImanRelation:relation_type,ImanRelation:primary_object,ImanRelation:sec
ondary_object
IMAN_based_on,{000023/A},{000023/B}

Input csv files must be given in the correct order. If the tool processes the ImanRelation csv file first, it
will report error since the object ID reference cannot be resolved.

If -o option is not given, only one output file will be generated. Otherwise each input will have its own
output XML file.

6.10 Aggregation class


If a class is defined as an aggregation class, you can give multiple values for one column to create
multiple objects.

Currently, three classes are defined as aggregation classes: ImanFile, Fnd0TableRow, and ReleaseStatus.

Let’s take ImanFile as an example:


Dataset:dataset_type,Dataset:object_name,ImanFile:original_file_name
UGMaster,000111,”000111.prt,000111_images_preview.qaf”
UGMaster,000112,000112.prt

ImanFile.original_file_name is a single value attribute. However, you can give multiple values like the
first data line. Multiple values will cause multiple objects to be created. For example, one ImanFile has
“000111.prt” in original_file_name, the other has “000111_images_preview.qaf” as a value.

The tool don’t know how many objects will be created for each line from header – that depends on the
value.
ImanFile:original_file_name,ImanFile:volume_tag
”000111.prt,000111_images_preview.qaf”,volume

In the above example, original_file_name has two values and sd_path_name has only one value. Finally,
two ImanFile objects will be created, and both have the same volume_tag - “volume”.

6.11 Attribute Propagation


After an attribute is set, you may want to assign the same value to some other objects. For example,
when you set Item:owning_user, you may also want its ItemRevision and master forms to have the same
owning_user. This can be achieved by attribute propagation.

6.11.1 Propagation Rule


In the data model, there are some propagation rules defined. These rules are organized into groups like
Security Group I, Security Group II, and so on. These rule groups are attached to properties through
PropertyConstantAttach.

This tool extracts this kind of information. During conversion, if an attribute is set and it has some
propagation rule group attached, the tool will execute the corresponding propagation rules to
propagate the value to traversed objects and finally create a ProjectObjectRelation.

Unrestricted 19
CSV2TCXML Converter Guide

Currently, there are five properties that have propagation rule groups attached: ip_classification,
gov_classfication, license_list, project_list, and owning_project. All of these are defined on
WorkspaceObject.

For example:
Item:item_id,ItemRevision:item_revision_id,Item:project_list
001,A,Athena
The Item.project_list is set to “Athena”. Since project_list has a propagation rule attached, the tool will
propagate the project_list from Item to ItemRevision. Finally, you will see both Item and ItemRevision
have the project assigned.
Item:item_id,ItemRevision:item_revision_id,Item:project_list,ItemRevision:
project_list,Dataset:object_name(<-IMAN_specification<-
ItemRevision),Dataset:dataset_type
001,A,PRJ1,“PRJ2,PRJ3”,001-UGMaster,UGMASTER

The example above is a bit complex. It assigns Item to project PRJ1 and ItemRevision to some other
projects – PRJ2 and PRJ3. After both attributes are set, the tool will run the propagation – PRJ1 will be
propagated to ItemRevision and Dataset, PRJ2 and PRJ3 will be propagated to Dataset.

Finally, Item will belong to PRJ1. ItemRevision and Dataset will belong to PRJ1, PRJ2 and PRJ3.

If the propagation rule in data model changes later, the example discussed here may be
inaccurate.
In the previous example, the final value of project_list is merged. A propagation rule may be in one of
the following four styles:

1) Merge – merge the values together, for VLAs only


2) Fill – if the propagated object doesn’t have a value for the attribute, fill it. Otherwise, no value
set.
3) Override – set the value blindly
4) Ordered – if the propagated value has higher or equal order, set the value, otherwise propagate
without setting the value. To define the value order, a new parameter section is introduced –
PropagationRule.
This tool will honor the rule style and implement the same behavior as above.

6.11.2 Customized attribute propagation


Let’s say you want to propagate owning_user from Item to ItemRevision, Master Forms and even
datasets attached to ItemRevision.

We cannot rely on the predefined propagation rule in the data model. The tool has its own way to do
attribute propagation.

In csv2tcxml_data_model, some classes has propagateAttributes defined.


<TcClass className="Item" propagateAttributes="owning_user,owning_group" … />

The value is the attributes you want to propagate from this object. The targets are its child objects.

Unrestricted 20
CSV2TCXML Converter Guide

As discussed in Principal object and its helper, when a principal object is created, its helper objects will
also be created. A helper object may have its own helper object. Finally, an object tree is created – the
principal object is the root.

Since it is a tree, the tool knows who the parent is and who the child is. Customized attribute
propagation is based on this parent-child relationship.

6.12 Object island


Objects in TCXML are grouped in islands. During import, tcxml_import will process one island at a time.
If any error happens for an island, the whole island will be rolled back.

The tool has one parameter to control the granularity of an island – island_batch_size.

The smallest island is “objects for a row”. You cannot split the objects for one row into multiple islands.
If you want to keep each line as an island, set island_batch_size to -1. If you want to group more objects
in an island for better performance, set island_batch_size to some bigger value (such as 1000 or 2000).
The default value is 6000 for best performance. Bigger islands may make diagnosing difficult if
something goes wrong during import. For development phase, we suggest setting it to -1.

The count of objects in an island may not be the exact number you set, it will be greater than or equal to
your setting, because objects generated for one line will be always in the same island.

6.13 Object grouping


All objects for one row will be grouped together. Sometimes, you may have the requirement to group
different lines together due to some application logic.

In the following example:


Item:item_id,ItemRevision:item_revision_id
000110,A
….
000110,B

Let’s say revision A for 000110 is generated at line 1, and revision B for the same Item is generated at
line 1001. There is no guarantee that those two ItemRevisions will be in the same island. However, if you
want to group these two ItemRevisions together no matter where they are generated, there is one
parameter that can help you - grouping. If you set grouping=Item for the above example, objects for line
1 and line 1001 will be grouped together.

Those two lines will be grouped together because they generate the same Item and the tool is trying to
group objects by Item.

Note that even though the same Items will be generated for these two, only one Item is written out
along with revision A.

The value of this parameter can have an optional tag like ‘[Parent]’.

In BOM structure csv file, each line has two items – parent and child. If you just give Item, the grouping
result may be unstable. You have to give Item[Parent] or Item[Child] to specify which Item to be
grouped.

Unrestricted 21
CSV2TCXML Converter Guide

This parameter only supports one value.

6.14 Combined column


Multiple attributes can be given the same value. Instead of copying the value multiple times, the
headers can be combined.
Item:item_id,ItemRevision:item_revision_id,Item:object_desc;ItemRevisio
n:object_desc
CSV_00003,A,Test

The header appears to have four columns. Actually, it has only 3.


‘Item:object_desc;ItemRevision:object_desc’ is a combined column, it combines two attributes in one
column and you only need to give one value for both attributes.

Multiple ones can be combined together using semicolons.

6.15 Column Alias


If you look at the csv2tcxml.ini, you will find a section called ColumnAlias:
lsd=POM_object:lsd
owning_site=POM_object:owning_site
creation_date=POM_application_object:creation_date
last_mod_date=POM_application_object:last_mod_date

These settings instruct the tool to do name replacements.

The main purpose for this feature is to support backward compatibility. In the old tool, many names are
hard-coded. In this new tool, those names are defined with aliases.

You can also define your own alias, but it is not recommended. Full names are more self-explanatory
and clearer.

6.16 Query database for existing objects


If an object is already created in Teamcenter and is not generated by this tool, you can’t directly
reference it because its PUID is not derived from the GSID. However, this tool can query the database to
see if an object already exists. If an object is found, its PUID will be used in the converted TCXML file.
This functionality is available for update mode too.

Three options are introduced in configuration section QueryDB - query_db, tc_admin_user and
tc_admin_password.

query_db specifies the class names that will be queried. When query_db is set, user and password are
mandatory to do the query. If an object cannot be found, the tool will still generate the PUID from GSID.
There are some limitations:

1) Only principal objects are supported - classes with MFK or keyAttributes defined.
2) The class should be the subclass of WorkspaceObject.
3) The key attributes cannot contain any reference attributes.

This feature was supported in the old tool, but it only supported Item/ItemRevision. Now more objects
are also supported like Cpd0DesignElement.

Unrestricted 22
CSV2TCXML Converter Guide

To query the database, it will call a standalone Teamcenter utility. You must run this tool in a TC console
so that the Teamcenter utility can be properly called.

Objects created by the old cvs2tcxml script cannot be queried by this tool. Hybrid usage is not
supported.

7. Templates/Objects supported
While the tool can support a broad range of objects/templates, there still be many templates we have
not touched on. To check which templates and objects are supported, beside this chapter, look at the
examples folder under the root directory of this tool. If you are working on some templates or classes
that are not officially supported yet, contact PLMS customer support to get support. For a full list of
supported classes/objects, refer to appendix D.

This chapter doesn’t cover all the cases. The examples folder has more samples.

7.1 Item & ItemRevision


The first thing to support for this tool is Item & ItemRevision. Mandatory columns are item_id and
item_revision_id.

Sample CSV:
Item:item_id,ItemRevision:item_revision_id
CSV_00001,A

Or you use dynamic type:


Item:item_id,ItemRevision:item_revision_id,Item:object_type
CSV_00001,A,Design
CSV_00002,A,Part

During converting, proper Item/ItemRevision objects will be created. For Design, its ItemRevision class
would be Design_0_Revision_alt; the form types would be “Design Master” and “Design Revision
Master”. Information for creating the objects is derived from the data model.
7.2 Custom forms
Form doesn’t have key attribute defined. It is treated as helper object. To create a custom form, you
must attach it to some other object like ItemRevision. The attached object is its parent. In the following
example:
Item:item_id,ItemRevision:item_revision_id,Form[Mfg0ArcOverrideForm]:ob
ject_type,Form[Mfg0ArcOverrideForm]:object_name(<-IMAN_reference<-
ItemRevision)
Test,A,Mfg0ArcOverrideForm,CustomForm_Name

As you can see, the Form has some tag - Mfg0ArcOverrideForm. This tag is mandatory here to
differentiate custom form from Item/ItemRevision master forms.
The GSID of the form is its parent’s gsid + some attribute value. This information is designated in the
header.
Form[Mfg0ArcOverrideForm]:object_name(<-IMAN_reference<-ItemRevision)

Unrestricted 23
CSV2TCXML Converter Guide

The form is attached to the ItemRevision. Then ItemRevision will be its parent object and the value of
object_name will also be used to compose the gsid.
Form[Mfg0ArcOverrideForm]:object_desc(<-IMAN_reference<-Item)
In the above sample, form’s gsid will be Item’s gsid + object_desc value.
7.3 Dataset
Dataset is a little bit complex. It has three related reference attributes: ref_list, ref_names and
ref_types. It is difficult for the user to populate all these attributes in the CSV file. The tool will try to set
these attributes for you.

In the header, if there are both Dataset and ImanFile, they will be linked automatically. Like the
following:
Dataset:object_name,Dataset:dataset_type,ImanFile:original_file_name
DS_CSV_000001,UGMASTER,C:\Temp\ug.prt
The reference name for the ImanFile will be automatically deduced from the file extension. Sometimes,
one file type can be referenced using different names. If the deduced reference name is not what you
want, you can override the value by adding an additional column – Dataset:ref_names.

Dataset can contain objects other than ImanFile, such as Forms can be added to a Dataset too. To add
additional attachments to a specific type of dataset, you need to define parameters in the configuration
section – DatasetAttachments – like below:
UGPART=UGPartAttr:UGPART-ATTR,UGPartAttributesForm:UGPART-ATTRIBUTES

The key – UGPART – is the dataset type. The value is a list of object type and reference name pair. In the
above example, UGPartAttr is a Form type name; UGPART-ATTR is the reference name. Multiple
attachments can be defined for one dataset, separate multiple value pairs by comma. The attachment
doesn’t need to be Form. It can be any type.

Once additional attachments are defined for a dataset, whenever an object of that dataset type is
created, additional objects will be constructed and linked to the dataset object.

Please try to avoid populating ref_list and its related attributes in the csv input file. Let the tool do it.

If you need to override ref_names or ref_types, please note that the forms defined in
DatasetAttachments are set to ref_list attribute before any ImanFile.

7.3.1 Link Dataset to ItemRevision


Normally, Dataset belongs to some ItemRevision. In csv2tcxml, you can achieve this by using the Linking
rule in the header. One example below:
Item:item_id,ItemRevision:item_revision_id,Dataset:dataset_type,Dataset
:object_name(<-IMAN_specification<-ItemRevision),
Part_010,A,UGMASTER,Part_010_DS

This is the recommended way.

There is also another way – using a separate ImanRelation column:

Unrestricted 24
CSV2TCXML Converter Guide

Item:item_id,ItemRevision:item_revision_id,Dataset:dataset_type,Dataset
:object_name,ImanRelation:relation_type
Item_010,A,UGMASTER,DS_010,IMAN_specification
To use this format, the object names must be ItemRevision, Dataset and ImanRelation.

7.4 Work with ImanFiles


For tcxml_import, there are two ways to import a physical file:

1) Import the physical file along with its metadata – ImanFile object
2) Copy physical file manually to a TC volume and import ImanFile without physical file

The second approach would be much faster than the first approach for large amounts of data. The first
approach is suitable for small data amounts.

If you choose the first approach to import a physical file along with the ImanFile object, the preparation
of the csv file would be simple. One attribute is needed:
ImanFile:original_file_name
C:\tmp\000113.prt

When tcxml_import runs, the physical file will be fetched from the path you give and put in the volume.
If the physical file cannot be found, the import will fail.

Do not supply the file_name column. file_name will be set automatically during import.

For ImanFile object, it has two more mandatory attributes – volume_tag and sd_path_name.

volume_tag is telling which volume this file should reside. sd_path_name is a subdirectory inside the
volume root. The physical file is located in the sd path folder.

It is recommended to let the tool to set these two attributes if the physical files are loaded by TCXML
import. During install step of this tool, you can give Teamcenter admin credential to instruct the tool to
fetch volume information from the system. Once volume information is in hand, the tool can find proper
volume and sd_path_name for an ImanFile by its owning user and owning group.

If you prefer the second approach, first you must find the proper volume and sd_path_name by
yourself, then copy all physical files to the sd_path_name subfolder under volume root. Also, you need
to set these two attributes in your csv file or in the InitialValues section in a .ini file – refer to appendix
B.2.

File name needs to be unique within sd_path folder. In the csv file, give two columns:
ImanFile:original_file_name,ImanFile:file_name
000113.prt,000113.prt

file_name does not need to be a readable name; it can be something like


efbe000_unk_r4l0oc27obxlz.prt. This is the real file name on the disk. For original_file_name, this is the
readable name. No path is needed.

Unrestricted 25
CSV2TCXML Converter Guide

7.5 BOM Structure


Since the tool support absolute occurrence now, the BOM structure represented in the csv file may have
two styles – PSOccurence structure and AbsOccurrence structure.

To create a structure, you can do it in two steps – first convert and import the items; later construct
another CSV for the BOM structure. Or you can let the tool to generate both items and BOM structure
together in one covert.

7.5.1 PSOccurrence structure


One example of PSOccurrence structure:
parent_item,parent_rev,child_item,child_rev
Top,A,Comp,A
Comp,A,Part,A
Top,A,Comp,A
Comp,A,Part,A

By default, precise assemblies will be created. However, you can change to imprecise using the
parameter bvr_precise. A value of 1 means precise, 0 is for imprecise. There are two extra parameters
for defining which type of BOM view and BOM view revision should be created – bv_type and bvr_type.
Set those parameters if needed and make sure the types are matching. By default, the tool will use
BOMView and BOMView Revision.

For PSOccurrence structure, each line will generate one PSOccurrence object to link the parent and
child. In the above example, totally four lines are given, so four PSOccurrence will be created - two
PSOccurrence for Top/A and Comp/A and two for Comp/A and Part/A. If the structure is opened in
Structure Manager, you will see following structure:
Top/A
Comp/A
Part/A
Part/A
Comp/A
Part/A
Part/A

Under top, there are totally 6 BOM lines instead of 4. Comp/A repeats twice and each Comp/A has
Part/A repeats twice. This is quite different from AbsOccurrence structure.

If column PSOccurrence.qty_value is given, you can set the quantity value of the PSOccurrence. Still only
one PSOccurrence is created and you cannot unpack them. But you can change the behavior with
another parameter unpacked_psocc. By setting unpack_psocc to 1, multiple PSOccurrence objects will
be created instead of 1 and each PSOccurrence has qty_value set to -1.

Another important parameter is exist. Since you already create the Item through another CSV file, you
should set exist=Item. In the output XML file, you will still see Item and ItemRevision, as they need to be
updated anyway. Some other objects like Master Forms and Anchor will not appear.

Although importing a BOM in two steps is easier and clearer, you can do it in a single step. After
converting the same BOM csv as above without exist=Item and importing the TCXML, you will just get a
full BOM structure.

Unrestricted 26
CSV2TCXML Converter Guide

All those column names in the example above are aliases. You can give real names which are clearer:
Item[Parent],ItemRevision[Parent],Item[Child],ItemRevision[Child]

All the names are fixed. Do not change the column names, as following functions will break.
Design[Parent],
Design_0_Revision_alt[Parent],Item[Child],ItemRevision[Child]

You can give an extra object_type column to use dynamic type.


Item[Parent]:item_id,ItemRevision[Parent]:item_revision_id,Item[Parent]
:object_type,Item[Child]:item_id,ItemRevision[Child]:item_revision_id,I
tem[Child]:object_type

object_type is mandatory if your item type is not Item.


If your item has MFK defined, make sure all the MFK attributes are given in the BOM csv file. For
example, there is a MFK defined for Item as {item_id,object_name}. Your BOM csv header should be
like:
Item[Parent]:item_id,Item[Parent]:object_name,ItemRevision[Parent]:item
_revision_id,Item[Child]:item_id,Item[Child]:object_name,ItemRevision[C
hild]:item_revision_id

7.5.2 AbsOccurrence Structure


Let’s take the same input as in PSOccurrence structure,
parent_item,parent_rev,child_item,child_rev,apr_item
Top,A,Comp,A
Comp,A,Part,A
Top,A,Comp,A
Comp,A,Part,A

One extra column is given to indicate that it is an AbsOccurrence structure. After loading this structure,
in structure manager, you will get following BOM structure:
Top/A
Comp/A
Part/A
Comp/A
Part/A
There are four lines under Top, and only 3 PSOccurrence is created instead of 4.

In the csv file, each line represents the appearance of one BOM line instead of PSOccurrence.

apr_item is used to designate the MEAppearancePathRoot for the specific line. If a valid ancestor item is
given, APR, APN and AbsOccurrence will be created along the path.

When describing BOM structure in AbsOccurrence structure csv, you must complete one assembly
before moving to its sibling assembly.
parent_item,parent_rev,child_item,child_rev,apr_item
Top,A,Comp,A
Top,A,Comp,A
Comp,A,Part,A

Unrestricted 27
CSV2TCXML Converter Guide

The above input is invalid. Since you already mentioned Comp/A in first data line, you must describe
Comp/A structure first. It is like in a tree traverse, go with Depth-First Traverse.

Lines can be omitted if the assembly has already been described.


Top/A
Comp1/A
Part1/A
Part2/A
Comp1/A
Part1/A
Part2/A
Comp2/A

For the above structure, you can author a csv input as following:
parent_item,parent_rev,child_item,child_rev,apr_item
Top,A,Comp1,A
Comp1,A,Part1,A
Comp1,A,Part2,A
Top,A,Comp1,A
Comp1,A,Part1,A (optional)
Comp1,A,Part2,A (optional)
Top,A,Comp2,A

Since Comp1/A is completed in the first appearance under Top, you can remove the two optional lines
and the result will be the same. If you need to create APN for a line, you cannot omit it and its siblings.

7.6 GDE lines in BOM structure


To create a structure with GDE lines, the header needs to be like the following:
Item[Parent]:item_id,Item[Parent]:object_type,ItemRevision[Parent]:item
_revision_id,Item[Child]:item_id,Item[Child]:object_type,ItemRevision[C
hild]:item_revision_id,GeneralDesignElement[Child]:object_type,GeneralD
esignElement[Child]:object_name

GeneralDesignElement is a kind of Form. You need to use a dynamic type through object_type for both
Item and GeneralDesignElement.

In the header, you can see both parent and child items are given like normal BOM structure csv input.
Besides that, GeneralDesignElement[Child] is added for GDE line under BOM line. It should use
Item[Parent] to designate its parent line instead of Item[Child]. If there is no child item BOM line,
Item[Child] columns can be removed.

If GDE line has its own child GDE lines, you have to give GeneralDesignElement[Parent] and use it
together with GeneralDesignElement[Child] to present parent-child relation.

Refer to the example – examples\foundation\GDEStructure.csv.

To create a GDE structure with connection like following:

Unrestricted 28
CSV2TCXML Converter Guide

Refer to example - examples\foundation\GDEStructureWithConnection.csv.

7.7 Table property


Each table property contains one or more table rows which are subclasses of Fnd0TableRow. Before
creating the table property, you need to know which object contains which type of table row and what
the property name is.

In the following example, the property owner is omitted:


Mfg0MEConnectorTableRow:fnd0OwningPropName(fnd0OwningObject->PropertyOw
ner),Mfg0MEConnectorTableRow:fnd0RowIndex,Mfg0MEConnectorTableRow:mfg0C
onnectorID,Mfg0MEConnectorTableRow:mfg0ConnectorName
mfg0ConnectorTable,"0,1,2","ID001,ID002,ID003","Con1,Con2,Con3"
mfg0ConnectorTable,"0,1","ID004,ID005","Con4,Con5"

The first column is the property name – you need to know this value. The second is the row index. It is
always started from 0. The third and fourth columns are some row values. Please note that
Fnd0TableRow is defined as an aggregation class. That’s why you can give multiple values in one column.
And, finally, multiple table rows will be created.

7.8 4GD Support


7.8.1 Cpd0CollaborationDesign
Example:
Cpd0CollaborativeDesign:mdl0model_id
CD00001

Only mdl0model_id is mandatory. By default, object_name will be the same as mdl0model_id. You can
change object_name with an extra column.
Cpd0CollaborativeDesign:mdl0model_id,Cpd0CollaborativeDesign:object_name
CD00001,MyCD

Then the object_name of CD will be ‘MyCD’.

Unrestricted 29
CSV2TCXML Converter Guide

Actually, this column is needed for any 4GD object since every 4GD object belongs to some CD.
7.8.2 Partitions and its hierarchy
To create a partition structure:
Cpd0CollaborativeDesign:mdl0model_id,Ptn0Partition[Parent]:ptn0partition_i
d,Ptn0Partition[Parent]:object_type,Ptn0Partition[Child]:ptn0partition_id,
Ptn0Partition[Child]:object_type

All of the columns are mandatory for Partition structure. First, every partition belongs to a CD, so you
need to give the CD’s mdl0model_id.
‘Ptn0Partition[Parent]:ptn0partition_id,Ptn0Partition[Parent]:object_type’ is to give the parent partition
information, ‘Ptn0Partition[Child]:ptn0partition_id,Ptn0Partition[Child]:object_type’ is for the child
partition. This is similar to a BOM structure. You give tags to identify Parent and Child. You also cannot
change the column names for Ptn0Partition like a BOM structure. They are fixed.
If you set parameter exist=Cpd0CollaborativeDesign,Ptn0Partition, then the output will contain only
Ptn0ChildParentLink. This allows you to first import Partition and CD and then construct the partition
hierarchy later. Or you can import the whole structure in one step.

If the CD is already created by this tool and you want to construct the partition structure for it later
with parameter exist=Cpd0CollaborativeDesign, you need to make sure the proper partition schemas
are already created for the CD. With exist=Cpd0CollaborativeDesign, partition schema will be skipped
too.

After importing the partitions, you need to run the following command to refresh the partition
cache, otherwise you cannot see them:
populate_top_level_partitions_cache -model=<model_id>

7.8.3 Promissory and Shape Design Element


Promissory and Shape Design Elements are simpler compared to reuse and subordinate DE because no
structure is involved.

Promissory DE:
Cpd0CollaborativeDesign:mdl0model_id,Cpd0DesignElement:cpd0design_element_
id

By default – no cpd0category is given, the Design Element category is promissory. For promissory DE,
you only need two columns, one id column for CD and one id column for DE.

Shape DE:
Cpd0CollaborativeDesign:mdl0model_id,Cpd0DesignElement:cpd0design_element_
id,Cpd0DesignElement:cpd0category,Cpd0ShapeDesign:item_id,Cpd0ShapeDesignR
evision:item_revision_id

For shape DE, you need to give cpd0category. Beside that one Shape Design Item is needed for shape
DE. They will be linked automatically.

7.8.4 Reuse and subordinate design element


Reuse DE and subordinate DE are created together in one csv file:

Unrestricted 30
CSV2TCXML Converter Guide

Cpd0CollaborativeDesign:mdl0model_id,Cpd0DesignElement:cpd0design_element_
id,Cpd0DesignElement:cpd0category,Cpd0DesignElement:cpd0is_leaf,Item:item_
id,ItemRevision:item_revision_id,Cpd0DesignElement[Parent]:cpd0design_elem
ent_id,Item[Parent]:item_id,ItemRevision[Parent]:item_revision_id,Cpd0Desi
gnElement[Top]:cpd0design_element_id

The DesignElement without a tag is to describe current DE you want to create. The DesignElement with
a tag – Parent – is to tell the parent information for the current DE. If a parent is empty, then it is a Top
DE or reuse DE.

If a DE has a parent, then it is subordinate DE. If it is subordinate DE, not only is parent DE information
needed, Top is also needed. So that’s why there is a column -
Cpd0DesignElement[Top]:cpd0design_element_id. Besides design elements, Items are also needed.
Every reuse or subordinate DE has a corresponding backend Item.

You must give the DE structure from top to bottom – every parent DE should appear before its
children.

Please follow the sample in example folder.

7.8.5 AttributeGroup and ManagedAttributeGroup


One example:
Cpd0CollaborativeDesign:mdl0model_id,Ptn0Design:ptn0partition_id,Cpd0Desig
nElement:cpd0design_element_id,Cpd0DesignElement:cpd0category,Cpd0InfoInCo
ntext:object_name(<-Mdl0AttachAttrGroup<-
Cpd0DesignElement),Cpd0InfoInContext:cpd0FindNum

Cpd0InfoInContext is an Mdl0AttributeGroup. It doesn’t have MFK or keyAttributes defined. It can be


linked to a DesignElement using a header linker rule and the object will be created and linked.

The ImanRelation type is Mdl0AttachAttrGroup. In the above example, the GSID of Cpd0InfoInContext
will be GSID of DE + Cpd0InfoInContext:object_name + ‘Cpd0InfoInContext’.

7.9 Classification Object


To create classification object, you need to construct an icm0 object in database. Since ICOs of different
classes share the same table, icm0 has a long list of general attributes – sm01 ~ sm200. When you try to
set attribute values, you must know which sm columns to use.

We supply another web page for classification definition – model/classification.html. Refer to 3.


Installation/Step to see how to generate this file.

The page looks like the following:

Unrestricted 31
CSV2TCXML Converter Guide

The class hierarchy is shown as a tree and you can search by class name. Once a class is selected, the
right panel will show a table which has all the attributes for that class.

The last column tells you where to put the attribute value for an ICO object (icm0).

If an attribute is an array (Array Size is not empty), you must put you value in curly braces even
though it has only one specific value.

Every icm0 object should set cid attribute to the class ID which is shown just below the class name on
the right panel.

There are five types of attributes:

1) String - STRING(MAX_LENGTH). Value doesn’t needs to be quoted.


2) Integer – INTEGER(MAX_DIGITS)
3) Float Number – REAL(X.Y). If the format shows REAL(2.4), value should be like 10.0000.
4) Date – DATE(YYMMDD). Then you need to give date value like 20190215.
5) Key LOV – The page will show all the possible key/value pairs. You need to give the key as value.

7.10 Product Configurator


This tool can be used to migrate product configurator structure like the below:

Unrestricted 32
CSV2TCXML Converter Guide

To construct this structure, you must follow some sequence:

1. Create the Product Item – DIC00000001 in the example above.


2. Create Feature
3. Create Feature Family, link Feature and Feature Family through
Cfg0FeatureFamily:cfg0FeatureThreads
4. Create Family Group, link Family Group and Feature Family through
Cfg0FamilyGroup:cfg0FamilyThreads

There are some example csv files in folder - examples/configurator.

If the Feature and Feature Family are Cfg0LiteralOptionValue and Cfg0LiteralValueFamily, you need to
follow different sequence due to data model difference.

1. Create the Product Item


2. Create Cfg0LiteralValueFamily
3. Create Cfg0LiteralOptionValue and give Cfg0LiteralFamilyThread:fnd0ThreadId to link it to
Feature Family
4. Create Family Group, link Family Group and Feature Family through
Cfg0FamilyGroup:cfg0FamilyThreads

7.11 Schedule and ScheduleTask


For Schedule and ScheduleTask, they both have item_id as their key attribute.

To create a Schedule structure like below:

1. Create Schedule object and its associated TCCalender – refer to examples/foundation/Schedule.csv


2. Create ScheduleTasks. Since ScheduleTask has both attributes pointing to parent and children tasks,
you have to give GSID string for the reference - refer to examples/foundation/ScheduleTask.csv

Unrestricted 33
CSV2TCXML Converter Guide

3. Create dependency relation between tasks – refer to


examples/foundation/ScheduleTaskDependency.csv

You can convert all of them in one run – “csv2tcxml.bat Schedule.csv ScheduleTask.csv
ScheduleTaskDependency.csv -o Schedule.xml” – and then load the structure in one shot.

8. Update Mode
Sometime, after data was created in the Teamcenter system, you may want to update some attributes
to amend something. Before update mode was introduced for this tool, another utility –
tc_attribute_bulk_update – was recommended.

Please don’t mess update mode with exist parameter. Parameter exist tell the tool that some objects
are already in the database and skip the object creation for them. Then in the final XML, there is no
element for these existed classes.

Update mode means that the csv input file is for updating some objects. If an attribute is given, then
that attribute value will be updated. Any other attributes that are not given will not be touched except –
lsd and last_mod_date.

User must make sure the objects are already in the database, because the object information in the XML
is not complete. tcxml_import will fail if it tries to create a new object from the XML.

To use update mode, you need to set parameter mode=Update.

8.1 Identify the object


To update an object, you must identify the object first.

There are three ways to identify an object:

1. Key attributes – Only principal objects created by csv2tcxml can use this way
Item:item_id,Item:object_desc,Item:owning_user
CSV_00001,Item created by csv2tcxml,chenji

In the example above, item_id is the key attribute to identify the Item.
2. PUID – Directly give a PUID to identify an object. Note that objects which are not created by this
tool can only be identified by their PUID.
ItemRevision:object_desc,ItemRevision:puid
ItemRevision description for CSV_00001/A,eIWXeGRTuTyVvA

puid is an artificial attribute valid only for update mode.


3. GSID – Give the GSID string for an object, like following:
ItemRevision:gsid,ItemRevision:object_desc
CSV_00001!Item!A!ItemRevision,ItemRevision description for CSV_00001/A

gsid is an artificial attribute valid only for update mode. Using GSID is not recommended now.

The following table depicts all the cases supported:

Unrestricted 34
CSV2TCXML Converter Guide

Object Category Object created by csv2tcxml Object Not created by


Identify object by … Principal Helper csv2tcxml
Key attributes ✓
PUID ✓ ✓ ✓
GSID ✓ ✓

It is dangerous to modify key attribute values and may cause problems that are hard to diagnose.
Instead of modifying key attribute, please try to create a new object.

8.2 Update object attributes


Once an object is identified, you can add extra columns to modify its attributes. Update mode is quite
simple:

1. No helper object will be created


2. No extension method will be called
3. No initial values from data model
4. No linking rule and object linking

Just give the value you want to set for an attribute. If that attribute is a reference, give PUID or GSID; if it
is an admin reference, give candidate key value.
The tool will still do value validation according to the attribute type.
During import, the tcxml_import utility will compare the lsd of the object in the database and lsd of the
element in the TCXML. The update will happen only when the lsd in the TCXML is later. By default, the
tool will set the lsd to the current time. And if the object is a POM_application_object, last_mod_date
will also be set to the same date as lsd. To keep last_mod_date untouched, set parameter
update_lmd_disabled=1.

You cannot update some attributes that have application logic bound to them, such as project_list,
ip_classification and gov_classification.

9. Extend the framework


You can modify the csv data model file to do some extension to the framework:

1) Change initial values for attributes


2) Define keyAttributes for a class
3) Define helper for a class
4) Define propagateAttributes for a class
5) Set isCandidateKey to define admin class

Modifying the csv2tcxml_datamodel.xml file is not recommended. Instead, use the overwrite file in
model/datamodel/local_override.xml. Add your changes to this file and rerun the install step. Then,
your override will be taken.

You can only override TcClass and its TcAttribute.

Unrestricted 35
CSV2TCXML Converter Guide

9.1 Support new type of object


You need to follow the steps to add support for new objects.

1) Determine if the new object is a principal object or a helper. For helper object, you can create it
along with some other object without customization. Please refer to section 7.2 Custom forms
to see how to create a helper object.
2) If the object needs to be created alone – without linking it to some other object, then you need
to make it a principal object. First make sure if it is a principal object already – open
model/datamodel.html to see if the objec has key definition.
3) If the object doesn’t have key defined, try to find a combination of attributes that can uniquely
identify the object. If no such combination can be found, you can give artifical attribute
‘gsid_suffix’ as key. Then you need to give this gsid_suffix in your input file and guarentee its
uniqueness by yourself.
Put your key definition in the csv2tcxml model file under model/datamodel folder. Like
following definition in model/datamodel/foundation.xml
<TcClass className="Fnd0AdminLOVValue"
keyAttributes="object_name,fnd0lov_category">
</TcClass>
If there is no data model file for your template, create a new one under model/datamodel. If
your template file is abc_template.xml, create a data model file as abc.xml.
4) Create your input file and give at least one key attribute, then you should be able to convert the
file. But the convert may fail since the tool will do many checks. If you see some errors like
‘Manatory attributes are missing’ or ‘Required properties are missing’, you need to give some
initial values for those attributes.
To define initial values:
<TcClass className="ClsName" keyAttributes="your key definition">
<TcAttribute attributeName="attrName" initialValue="your
value"/>

</TcClass>
5) Run install step to consolidate your customization to the data model.

If you directly make change to the consolidated csv2tcxml data model file –
model/csv2tcxml_datamodel.xml, your change will be lost after re-runing the install step.

Unrestricted 36
CSV2TCXML Converter Guide

Appendices
A. Encoding List

7bit-jis cp875 MacArabic


AdobeStandardEncoding cp932 MacCentralEurRoman
AdobeSymbol cp936 MacChineseSimp
AdobeZdingbat cp949 MacChineseTrad
ascii cp950 MacCroatian
ascii-ctrl dingbats MacCyrillic
big5-eten euc-cn MacDingbats
big5-hkscs euc-jp MacFarsi
cp1006 euc-kr MacGreek
cp1026 gb12345-raw MacHebrew
cp1047 gb2312-raw MacIcelandic
cp1250 gsm0338 MacJapanese
cp1251 hp-roman8 MacKorean
cp1252 hz MacRoman
cp1253 iso-2022-jp MacRomanian
cp1254 iso-2022-jp-1 MacRumanian
cp1255 iso-2022-kr MacSami
cp1256 iso-8859-1 MacSymbol
cp1257 iso-8859-10 MacThai
cp1258 iso-8859-11 MacTurkish
cp37 iso-8859-13 MacUkrainian
cp424 iso-8859-14 MIME-B
cp437 iso-8859-15 MIME-Header
cp500 iso-8859-16 MIME-Header-ISO_2022_JP
cp737 iso-8859-2 MIME-Q
cp775 iso-8859-3 nextstep
cp850 iso-8859-4 null
cp852 iso-8859-5 posix-bc
cp855 iso-8859-6 shiftjis
cp856 iso-8859-7 symbol
cp857 iso-8859-8 UCS-2BE
cp858 iso-8859-9 UCS-2LE
cp860 iso-ir-165 UTF-16
cp861 jis0201-raw UTF-16BE
cp862 jis0208-raw UTF-16LE
cp863 jis0212-raw UTF-32
cp864 johab UTF-32BE
cp865 koi8-f UTF-32LE
cp866 koi8-r UTF-7
cp869 koi8-u utf-8-strict
cp874 ksc5601-raw utf8
viscii

Unrestricted 37
CSV2TCXML Converter Guide

B. Parameters
Parameters are grouped in sections:

B.1 Config
Name Description Default value:
source_site A site ID represents an external site or system. N/A
You must get this site ID from GTAC and this is a
mandatory parameter to set before using the
tool.
encoding Input file encoding. Valid values in appendix A. ascii
db_encoding Database encoding mapped to the encoding in utf-8
the above encoding list. By default, the tool will
use utf-8 encoding to see if a string value
exceeds max string length limit. If your database
is using some specific encoding, like shiftjis, you
need to set this option so that the tool won’t
truncate your value wrongly.
GMS_tcxml_string_separator Separator used in TCXML to split VLA attribute ,
values.
exist If some objects already exist in the database, N/A
you can set this option to skip the object
creation for them. The value should be the
object name or just class name in header. Please
note that the helper objects will be skipped too.
grouping Group different lines together when they N/A
generate the same object of the class defined in
the grouping option. Only one class name and an
optional tag name should be given, and class
hierarchy is supported.
save_gsid_out Save the puid/gsid mapping to a file 0
puid_lookup_file Specify lookup file path for PUID in case the N/A
objects already exist which are not created by
this tool. The text file stores the list of PUID,GSID
pairs.
Island_batch_size Number of objects to be grouped in an island. 6000
Objects generated for one line will be always in
the same island. If you want each line to be an
island, set this value to -1. If you don't want an
island at all - import everything in one shot, set
this value to 0.
create_form_storage Set this parameter to 1 if you want to create 0
storage object for every Form object. By default,
the tool will not create a storage class if that
storage class is not mentioned in the csv file.
skip_empty_value If this attribute is set to some column name, N/A
empty value in that column will be skipped. The
tool will set an initial value for that attribute if

Unrestricted 38
CSV2TCXML Converter Guide

there is an initial value, otherwise that attribute


will not be written out for the specific object.
skip_line_if_error Set this parameter to 1 will skip the whole line if N/A
any error happens. By default, partial or faulty
data will be written for the line to facilitate error
diagnose. We recommend fixing all the errors
before importing the output XML file.
local_time_zone In TCXML, the time will always be GMT time. If N/A
the local time string is given, set this parameter
to some time zone and the tool will convert local
time to GMT.
For example, -500 mean UTC-05:00 time zone;
GMT means it is GMT time.
If this parameter is not set, the tool can only
recognize time string in the following format:
\d{4}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}
lov_validate By default, the tool will validate LOV values. 1
Disable validation by setting this option to 0.
bvr_precise Precise or imprecise structure to be created. 1
Values: 1-precise, 0-imprecise
bv_type Type of BOM view for BOM creation BOMView
bvr_type Type of BOM view revision for BOM creation BOMView
Revision
unpacked_psocc Create multiple PSOccurrence objects if 0
PSOccurrence.qty_value is more than 1 and this
parameter is set to 1. By default, only one
PSOccurrence will be created and the qty_value
will be directly set.
mode Set convert mode. Two modes are supported: Full
full and update. Full is the normal case, update
mode is described in Update Mode.
update_lmd_disabled Parameter specific for update mode. If this 0
parameter is set to 1, last_mod_date will not be
updated automatically. Otherwise, if no
late_mod_date is given, the tool will
automatically set lmd to the converting date.
B.2 InitialValues
There are no fixed parameters for this section. You can add or update initial values for any class. The
parameter in this section should look like:
ClassName=Attribute1:Value1,Attribute2:Value2

For example, you can give initial value for POM_application_object.owning_user to avoid giving this
value in every csv file with the same value.

POM_application_object=owning_user:migration_user

Unrestricted 39
CSV2TCXML Converter Guide

B.3 CsvReader
Name Description Default value:
sep The chars used to separate fields. Limited to 8 , or | - auto
bytes which means you can give value like ~##. detect
Make sure header and data have the same
separator.
quote The chars used to quote fields. Limited to 8 “
bytes.
escape_char The character to escape certain characters “
inside quoted fields. This is limited to a single-
byte character, usually in the range from 0x20
(space) to 0x7E (tilde).
strict If this parameter is set to 1, any row that 0
parses to a different number of fields than the
header will cause the tool to report an error
and that row will be ignored. Empty row will
also be treated as error.
binary If this parameter is 1, you may use binary 1
characters in quoted fields, including line
feeds, carriage returns and NULL bytes. (The
latter could be escaped as "0.)

B.4 QueryDB
Parameters for querying object’s PUID from database by attributes.

Name Description Default value:


query_db The classes that will be queried from the N/A
database to find its PUID. The value should be
class names shown in the header separated by
comma.
tc_admin_user TC server user name. N/A
tc_admin_password TC server password. N/A

B.5 DatasetAttachments
Parameters in this section are optional. Users should define parameters as their need.

Name Description Default value:


UGPart The parameter name is the Dataset Type name. The value is UGPartAttr:UGP
the additional attachment that will create along with Dataset ART-
creation. The value is in the format of ATTR,UGPartAttri
TypeName1:ReferenceName1,TypeName2:ReferenceName2 butesForm:UGPA
RT-ATTRIBUTES

Unrestricted 40
CSV2TCXML Converter Guide

B.6 PhysicalStructure
Parameters for controlling whether to create as-built structure or as-maintained structure.

Name Description Default value:


isAsBuiltStructure If isAsBuiltStructure is 0, as-maintained 0
structure will be created. To create as-built
structure, set isAsBuiltStructure to 1.

B.7 PropagationRule
Parameters for PropagationRule to define value list ordering:

Name Description Default value:


ITAR_level_list_o This is similar to the preference ITAR_level_list_ordering in secret
rdering Teamcenter. Refer to the following link for its meaning: super-secret,top-
http://docsstage.plm.automation.siemens.com/tdoc/tc/11.5 secret
/help/#uid:c_itar_clear_class_level
IP_level_list_orde This is similar to the preference IP_level_list_ordering in secret
ring Teamcenter. Refer to the following link for its meaning: super-secret,top-
http://docsstage.plm.automation.siemens.com/tdoc/tc/11.5 secret
/help/#uid:c_itar_clear_class_level

B.8 Undocumented sections


In csv2tcxml.ini, you may see more parameter sections and other parameters. Those are internal
parameters and should not be changed.

C. Admin classes and candidate attributes


This is not a complete list, since new candidate keys may be defined for any class later. If a class has a
candidate attribute defined in BMIDE, then it is an admin class. These are some well-known admin
classes and their candidate attributes.

Class Name Candidate Key Attribute


Group full_name – it is a runtime property
ImanVolume Volume_name
TC_Project project_id
Tool object_name
RevisionRule object_name
ADA_License id
POM_imc site_id
Role role_name
DatasetType datasettype_name
UnitOfMeasure symbol
PSViewType name
PSOccurrenceType name
NoteType name
ImanType type_name

Unrestricted 41
CSV2TCXML Converter Guide

Discipline discipline_name
Condition condition_name

Note that candidate key definitions are inherited by child classes.

D. Supported classes
The following list only has the parent classes. Child classes are automatically supported in case they
don’t have special application logic.

D.1 Foundation
Item, ItemRevision, Anchor, PSBOMView, PSBOMViewRevision, PSOccurrence, PSOccurrenceThread,
Dataset, RevisionAnchor, Form, ImanRelation, ImanFile, ProjectObjectRelation, PSOccurrenceNotes,
Effectivity, GDEOccurrence, GDEbvr, GeneralDesignElement, ReleaseStatus, Fnd0TableRow,
MEAppearancePathRoot, MEAppearancePathNode, AbsOccurrence, AbsOccData, Fnd0OARRule,
Fnd0OARFunction, Fnd0AdminLOVValue, Fnd0LogicalBlock, Fnd0LogicConn, Schedule, ScheduleTask,
icm0

D.3 Appmodel
Mdl0DefaultGeometry, Mdl0ElementThread, Mdl0AttachAttrGroup, Mdl0AttributeGroup,
Mdl0ManagedAttrGroup

D.3 Cpd
Cpd0CollaborativeDesign, Cpd0DesignElement, Cpd0ShapeDesign, Cpd0ShapeDesignRevision,
Cpd0DesignItemInstance

D.4 Partition
Ptn0Partition, Ptn0PartitionItem, Ptn0PartitionItemRevision, Ptn0SchemeFunctional, Ptn0Membership,
Ptn0ChildParentLink, Ptn0PartitionTemplateModel

D.5 Realization
Rlz0ItemRealizationMap

D.6 Mdc0mdconnectivity
Mdc0PortArtifact, Mdc0OrderedElementGroup, Mdc0ConnectionElement,
Mdc0ConditionalElementGroup

D.7 Smd0systemmodeling
Smd0Model, Smd0LogicalElement

D.8 Pdm0plantdatamgmt
Pdm0ExternalType, Pdm0ExternalModel, Pdm0RelatedModel, Pdm0ImportRecord

D.9 Cfg0configurator
Cfg0ProductItem, Cfg0FamilyGroup, Cfg0FeatureFamily, Cfg0Feature, Cfg0LiteralValueFamily ,
Cfg0LiteralOptionValue

Unrestricted 42
CSV2TCXML Converter Guide

D.10 Mrocore
PhysicalPart, PhysicalPartRevision, PhysicalLocation, PhysicalLocationRevision, PhysicalLocationUsage,
PhysicalRealization, PhysicalStructureAlignment, AsBuiltStructure, AsMaintainedStructure

D.11 Serviceplanning
SSP0ServicePlan, SSP0ServiceReq, SSP0WorkCard, SSP0ServicePartition

Unrestricted 43

You might also like