Skip to main content
1-Visitor
June 25, 2010
Question

PDMLink Version Series

  • June 25, 2010
  • 12 replies
  • 2406 views

Does anyone know of a way to set the versioning series of a Part to do the following.

Start a ProE part in Prototype at 1.1 then when that part gets released it goes to A.1 without using the revise function.

12 replies

10-Marble
June 25, 2010


So what I did at a previous customer was to use the State Based lifecycle, but we put in a state before Released, call it Release to Production or something like that. In this example we used a Promotion process to get it to this Release to Production state, whose versioning series was different Mil Std. I then had an expression robot that had the following code that was provided to me by a person from PTC, non-supported of course. The transition in the lifecycle was such that when you revised from the RTP state it went to their Released or Production state. This was all automated through the Promotion workflow.

I'm sure this could be done through an ECN process as well, the code below would need to be slightly changed to grab the ECN's affected objects instead of the Promotion Notices objects. Then you would probably need to add the newly revised objects to the Resulting data of the ECN.

Steve D.

wt.vc.Versioned versionedObj = null;
wt.fc.WTObject obj = null;
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice) primaryBusinessObject;
wt.util.WTProperties props;

try
{
props = wt.util.WTProperties.getLocalProperties();
VERBOSE = props.getProperty("wt.maturity.verbose", VERBOSE);
}
catch (java.io.IOException e1)
{
e1.printStackTrace();
}
try
{

wt.fc.QueryResult queryresult = wt.maturity.MaturityHelper.service.getPromotionTargets(pn);

wt.fc.collections.WTCollection mycollection = new wt.fc.collections.WTArrayList();

mycollection.addAll(queryresult);

//Multi-revise all objects
wt.fc.collections.WTValuedMap versionMap = wt.vc.VersionControlHelper.service.newVersions(mycollection);

/*NOT COMPLETE: Set user of the new objects
Example:Iterated part = VersionControlHelper.assignIterationCreator( thePart, theNewCreator );
*/

wt.fc.collections.WTCollection versionscollection = versionMap.wtValues();

//NOT COMPLETE: Set folder, by checking the value of the folder for the original object
/*if(versioned instanceof Foldered)
{
Folder folder = ......
FolderHelper.assignLocation((FolderEntry)versioned1, folder);

}

*/

//Save new versions
wt.fc.PersistenceHelper.manager.store(versionscollection);
}
catch (Exception me)
{
if(VERBOSE)
me.printStackTrace();
}


In Reply to Charlie Jones:

Does anyone know of a way to set the versioning series of a Part to do the following.

Start a ProE part in Prototype at 1.1 then when that part gets released it goes to A.1 without using the revise function.

10-Marble
June 28, 2010
Charlie,
we are using a two phased life cycle which changes from NUMERIC to MILSTD
when going from In Work to Released. Windchill can not OOTB handle
changing both life cycle state and revision so we modified the Promote
workflow and added this expression method to automatically change to
MILSTD upon promotion from a NUMERIC to Released.

public void invoke(String targetstate, wt.fc.WTObject obj) throws
Exception
{ // Get the type identifier for the object taken into account
that it can be a subtype
String type =
wt.type.TypedUtilityServiceHelper.service.getExternalTypeIdentifier(obj);
// Cast the object to a Versioned
wt.vc.Versioned verobj = (wt.vc.Versioned) obj;
// Get the current version as a string value
String ver =
wt.vc.VersionControlHelper.getVersionIdentifier(verobj).getValue();
//Test if this promotion needs special
(version Numeric and targetstate RELEASED)
if(java.util.regex.Pattern.matches("\d*", ver)
&& ((targetstate.equals("RELEASED") &&
(type
.equals("WCTYPE|wt.epm.EPMDocument|com.company.DefaultEPMDocument") ||
type
.equals("WCTYPE|wt.doc.WTDocument|com.company.EngineeringDocument")))))
{ // Get the next available version
wt.vc.VersionIdentifier versionidentifier =
wt.vc.VersionControlHelper.nextVersionId(verobj);
// Set the version to the next available version
for all iterations and commit to the database
wt.vc.VersionControlHelper.service.changeRevision(verobj,
versionidentifier.getValue(),true);
}
}

Regards,
Bjarne



Charlie Jones <->
25-06-2010 18:09
Please respond to
Charlie Jones <->


To
-
cc

Subject
[solutions] - PDMLink Version Series






Does anyone know of a way to set the versioning series of a Part to do the
following.

Start a ProE part in Prototype at 1.1 then when that part gets released it
goes to A.1 without using the revise function.

Site Links: View post online View mailing list online Send new post
via email Unsubscribe from this mailling list Manage your subscription
Use of this email content is governed by the terms of service at: