Skip to main content
Oct 27, 2023 1:24 PM UTC
Solved

How to use LoadFromFile utility to load "Options" with custom IBA ??

I am using Windchill PDMLink Release 12.1 and Datecode with CPS 12.1.2.2
I have created additional IBA for Options purpose.
How to use LoadFromFile utility to load "Options" with this additional IBA ??

Nov 2, 2023 11:02 AM UTC

Hi @Gucio 

What have I written?

but if the definition does not exists, it is not possible to set the IBA definition for the option group

PetrH

10 replies

Oct 30, 2023 7:42 AM UTC

Hi @Gucio 

Options and Variants?

Oct 30, 2023 8:56 AM UTC

Hi @Gucio 

In the file csvmapfile you should find begin and end element for the object and between this elements there are added the IBA definitions.

 

Here is example for WTPart object (same way it should be for the Options)

 

<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standardX20.dtd">
<NmLoader>
<csvBeginWTPart handler="wt.part.LoadPart.beginCreateWTPart" >
 <csvuser>Administrator</csvuser>
 <csvpartName>TESTIMPORT.ASM</csvpartName>
 <csvpartNumber>00151065</csvpartNumber>
 <csvtype>separable</csvtype>
 <csvgenericType></csvgenericType>
 <csvcollapsible></csvcollapsible>
 <csvlogicbasePath></csvlogicbasePath>
 <csvsource>make</csvsource>	
 <csvfolder>/Default/WtParts</csvfolder>
 <csvlifecycle>Basic</csvlifecycle>	
 <csvview>INWORK</csvview>
 <csvvariation1></csvvariation1>
 <csvvariation2></csvvariation2>
 <csvteamTemplate></csvteamTemplate>
 <csvlifecyclestate>RELEASED</csvlifecyclestate>
 <csvtypedef>wt.part.WTPart</csvtypedef>
 <csvversion>-</csvversion>
 <csviteration>1</csviteration>
 <csvenditem></csvenditem>
 <csvtraceCode></csvtraceCode>
 <csvorganizationName></csvorganizationName>
 <csvorganizationID></csvorganizationID>
 <csvsecurityLabels></csvsecurityLabels>
 <csvcreateTimestamp></csvcreateTimestamp>
 <csvmodifyTimestamp></csvmodifyTimestamp>
 <csvminRequired></csvminRequired>
 <csvmaxAllowed></csvmaxAllowed>
 <csvdefaultUnit>pcs</csvdefaultUnit>
 <csvserviceable></csvserviceable>
 <csvservicekit></csvservicekit>
</csvBeginWTPart>
<csvCreateOrUpdateIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
 <csvdefinition>MY_CODE</csvdefinition>
 <csvvalue1>0100101012100</csvvalue1>
 <csvvalue2></csvvalue2>
 <csvdependency_id></csvdependency_id>
</csvCreateOrUpdateIBAValue>
<csvEndWTPart handler="wt.part.LoadPart.endCreateWTPart" >
 <csvparentContainerPath>F</csvparentContainerPath>
</csvEndWTPart>
</NmLoader>

 

mapfile

BeginOption~create~com.ptc.windchill.option.load.Loader.beginOption~typedef~name~description~optionDataType~QoMName~OverrideDisplayUnits~optionGroup~requiredOption~singleChoiceSelection~number~autoCreateBooleanChoices
EndOption~create~com.ptc.windchill.option.load.Loader.endOption

 

PetrH

GucioAuthor
Oct 31, 2023 1:59 PM UTC

Hi PetrH,

 

thx for replaing for my next issue - hope this time you will help me again 🙂

I've done some test, and for Options (Options and Variants modul)  sample xml file should looks as follow:

 

<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standard12_1.dtd">
<NmLoader>
 <csvBeginOption handler="com.ptc.windchill.option.load.Loader.beginOption" >
 <csvtypedef>com.ptc.windchill.option.DesignOption</csvtypedef>
 <csvname>test_1</csvname>
 <csvdescription>description_1</csvdescription>
 <csvoptionDataType></csvoptionDataType>
 <csvQoMName></csvQoMName>
 <csvOverrideDisplayUnits></csvOverrideDisplayUnits>
 <csvoptionGroup></csvoptionGroup>
 <csvrequiredOption></csvrequiredOption>
 <csvsingleChoiceSelection></csvsingleChoiceSelection>
 <csvnumber></csvnumber>
 <csvautoCreateBooleanChoices></csvautoCreateBooleanChoices>
</csvBeginOption>

 <csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
 <csvdefinition>DESCRIPTION_PL</csvdefinition>
 <csvvalue1>myDescription</csvvalue1>
 <csvvalue2></csvvalue2>
 <csvdependency_id></csvdependency_id>
 </csvIBAValue>

 <csvEndOption handler="com.ptc.windchill.option.load.Loader.endOption" />

</NmLoader>

 but going deeper, customer wants to load group with custom IBA defined. So my file is

 

<?xml version="1.0" ?><!DOCTYPE NmLoader SYSTEM "standard12_1.dtd">
<NmLoader>
<csvOptionGroup handler="com.ptc.windchill.option.load.Loader.createGroup" >
 <csvname>Groupa 1</csvname>
 <csvoptionTypeDef>com.ptc.windchill.option.DesignOption</csvoptionTypeDef>
</csvOptionGroup>

<csvIBAValue handler="wt.iba.value.service.LoadValue.createIBAValue" >
 <csvdefinition>SP_GROUP_GROUP_DESCR_EN</csvdefinition>
 <csvvalue1>english group description</csvvalue1>
 <csvvalue2></csvvalue2>
 <csvdependency_id></csvdependency_id>
</csvIBAValue>

</NmLoader>

 

as a result 

 

Gucio_0-1698760719686.png

Question: what is wrong? How to debug to get more info?

 

Any idea??

 

Regards,

gucio

Oct 31, 2023 2:10 PM UTC

Hi @Gucio

You need to place the IBA definition between begin and end elements for the optionsgroup so you need to find correct definition in the csvmapfile.txt for the option same as the csvBeginOption and csvEndOption 

 

but if the definition does not exists, it is not possible to set the IBA definition for the option group

 

 PetrH