Skip to main content
1-Visitor
February 6, 2013
Question

Automatically re-assign life cycle

  • February 6, 2013
  • 7 replies
  • 2029 views

Does anyone devised an automated way to re-assign life cycle to specific type of objects in Windchill?



Regards,


Yogesh

7 replies

1-Visitor
February 6, 2013
Hi,

Something like this... Code has not been tested. In this code you will have
to provide lifeCycleName but you may want to read the name from OIR
(depends on your specific requirement)

if(TypedUtilityServiceHelper.service.getExternalTypeIdentifier(doc).toString().equals("WCTYPE|wt.doc.WTDocument|com.xyz.MyDoc")){
WTContainerRef containerRef = ((WTContained) doc).getContainerReference();
LifeCycleHelper.service.reassign((LifeCycleManaged) doc,
LifeCycleHelper.service.getLifeCycleTemplate(lifeCycleName,
containerRef).getLifeCycleTemplateReference());
}

Sudeep Bhattarai
sudeep.bhattarai@najanaja.com
847-220-7008
Solutions Architect
NajaNaja Ltd
1-Visitor
February 6, 2013
If I recall, there is a mass re-assign utility in 10.1

[cid:image001.gif@01CE044D.F26066C0]

Steve Vinyard
Application Engineer
1-Visitor
February 6, 2013
If you are Running 9.1 it Mass re-assign too. It is confined to contents of a folders. File>New>Reassign Lifecycles.


Bob Lohbauer
PDM/ PLM Business Administrator
Jacobs Vehicle Systems

1-Visitor
February 6, 2013
Automated way for assigning a lifecycle is appropriately configuring the
OIR.

Is there a specific reason for reassigning the lifecycle template using
APIs.




2-Explorer
February 6, 2013

Use of the many reassign methods in the StandardLifeCycleService class....


wt.lifecycle.StandardLifeCycleService.reassign(...) ;

Example for a Change Activity in a specific context:

LifeCycleHelper.service.reassign((LifeCycleManaged)changeActivity,
lcTemplateRef, changeActivity.getContainerReference());

Danny N. Poisson
PDM IT Solution Architect
Common PDM Technical Director

Corporate Information Technology
Raytheon Company
(Cell) +1.978.888.3696
-

50 Apple Hill Drive
Tewksbury, MA 01876 USA

This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.


1-Visitor
February 6, 2013

We have Windchill 9.1 M40. 10.1 upgrade would be sometime next year. Here is how I currently re-assign life cycle (please correct if there are better ways).

- Run a context specific Search for objects of specific type
- Full list - Select All and re-assign life cycle

My Limitations: 1. This process contains manual clicking and waiting in between
2. I have to do it for each container (search all and re-assign all does not work)

With an automated way, this process would be much faster. Re-assigning via APIs seems the way for now. Thank you everyone for your response.



Regards,


Yogesh

1-Visitor
May 24, 2014

Hi,


How do I start the life cycle from a specific state?


wt.lifecycle.LifeCycleManaged lcm = wt.lifecycle.LifeCycleHelper.service.reassign((wt.lifecycle.LifeCycleManaged) user, lctr, user.getContainerReference(), SPECIFIC STATE );