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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to set state of WTDocument by code?

VasiliyRepecki
1-Newbie

How to set state of WTDocument by code?

Hi.

I cann't use PromotionNotice and StandardMaturityService.promoteTargets() method.

How can i change state of WTDocument by java code?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, Vasiliy

wt.lifecycle.LifeCycleServerHelper.service.setState((wt.lifecycle.LifeCycleManaged )Object, wt.lifecycle.State.toState( "UNDERREVIEW"));

View solution in original post

6 REPLIES 6

Hi, Vasiliy

wt.lifecycle.LifeCycleServerHelper.service.setState((wt.lifecycle.LifeCycleManaged )Object, wt.lifecycle.State.toState( "UNDERREVIEW"));

Another way LifeCycleHelper.service.setLifeCycleState(object,State.toState("CANCELLED"));

Chanhasen
5-Regular Member
(To:kdas)

Hi kaushik,

Is there any way to read the life cycle of any object from OIR.

Example:

On part creation,how the lifecycle value populated from OIR..

Chanhasen
5-Regular Member
(To:AntonBagryanov)

Hi,

Is there any way to read the life cycle of any object from OIR.

Example:

On part creation,how the lifecycle value populated from OIR..

KD
4-Participant
4-Participant
(To:Chanhasen)

Hi Chan,

In OIR you will find below lines.

<!-- set the lifecycle -->

<AttrValue id="lifeCycle.id" algorithm="com.ptc.core.foundation.lifecycle.server.impl.LifeCycleTemplateAttributeAlgorithm">

<Arg>

<!-- Translation of the word "Basic" must be the same as the translation done in commonLifeCycles.xml -->

<?loc-begin key="BASIC_LIFECYCLE_NAME" maxlen="30" match="commonLifeCycles.xml:BASIC_LIFECYCLE_NAME"?>Basic<?loc-end?>

</Arg>

</AttrValue>

If you change the name from Basic to some other name (For example Approval) then that particualr object will follow Approval.

Thanks ,

Kaushik

Chanhasen
5-Regular Member
(To:KD)

Hi Kaushik,

Thanks for the reply.But in my case,i am trying to know the customization part(How the OIR values are been displayed in creation page).Which APi has been used to retrieve values from OIR.

Example: In part creation page,how values are been retrived from OIR.

Top Tags