Skip to main content
16-Pearl
October 27, 2023
Solved

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

  • October 27, 2023
  • 2 replies
  • 3119 views

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 ??

Best answer by HelesicPetr

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

2 replies

17-Peridot
October 30, 2023

Hi @Gucio 

Options and Variants?

HelesicPetr
22-Sapphire II
22-Sapphire II
October 30, 2023

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

Gucio16-PearlAuthor
16-Pearl
October 31, 2023

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

HelesicPetr
22-Sapphire II
22-Sapphire II
October 31, 2023

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