cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to set OOTB Part Attributes, Version & Iteration, using java code (Windchill API's) ?

SOLVED
Highlighted
Level 1

How to set OOTB Part Attributes, Version & Iteration, using java code (Windchill API's) ?

Hello,

I have created a WTPart using Java code + Windchill API's. There are setter methods available for setting some attribute like Name, Number, Type, Source etc.

Is there any method / API to set the Version and Iteration of the created part through code ? Can I set the values of Version and Iteration to be say, C and 5 directly ? Or creating a default Part of A.1 and revising / checking out is the only option ?

It would be really helpful if someone could help me with Windchill API's / Code snippets to set Part Version / Iteration OR Revise / Check out a part till the desired Version / Iteration is reached.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to set OOTB Part Attributes, Version & Iteration, using java code (Windchill API's) ?

Yes, it is possible to load objects out of sequence. For setting the version one can use VersionControlSErverHerlper API's as shown below.

VersionIdentifier vid = VersionIdentifier.newVersionIdentifier();

VersionControlServerHelper.setVersionIdentifier(the_versioned, vid, false /* validateIncreasing */);

Similarly for iteration one can use IterationIdentifier API's. As shown below

IterationIdentifier iid = IterationIdentifier.newIterationIdentifier();

VersionControlHelper.setIterationIdentifier(the_iterated, iid);

A detailed code snippet can be found at <WT_HOME>\src\com\wt\doc\LoadDoc.java

-Malavika

3 REPLIES 3

Re: How to set OOTB Part Attributes, Version & Iteration, using java code (Windchill API's) ?

Re: How to set OOTB Part Attributes, Version & Iteration, using java code (Windchill API's) ?

Hi,

I wanted to assign version of EPMDoc object to WTDoc object while creation WTDoc.

Suppose EPMDoc has version A then WTDoc of same version should create in system.

is it possible?if so then plz let me know how i can achieve this through code.

Re: How to set OOTB Part Attributes, Version & Iteration, using java code (Windchill API's) ?

Yes, it is possible to load objects out of sequence. For setting the version one can use VersionControlSErverHerlper API's as shown below.

VersionIdentifier vid = VersionIdentifier.newVersionIdentifier();

VersionControlServerHelper.setVersionIdentifier(the_versioned, vid, false /* validateIncreasing */);

Similarly for iteration one can use IterationIdentifier API's. As shown below

IterationIdentifier iid = IterationIdentifier.newIterationIdentifier();

VersionControlHelper.setIterationIdentifier(the_iterated, iid);

A detailed code snippet can be found at <WT_HOME>\src\com\wt\doc\LoadDoc.java

-Malavika