Skip to main content
Dec 8, 2023 12:00 PM UTC
Solved

How Reload part number after lifecycle state change?

If Number is E-M030002 them remove E- after it goes to certain lifecycle  state

Dec 11, 2023 2:38 PM UTC

Hi @MP_10719580 

Here is example from WF Activity how to set number activity to a format "CN+/+AtivityNumber" 

HelesicPetr_1-1702305470159.png

 

wt.fc.Identified master = (wt.fc.Identified)thisActivity.getMaster();
wt.change2.WTChangeActivity2MasterIdentity identity = (wt.change2.WTChangeActivity2MasterIdentity) master.getIdentificationObject();
identity.setNumber(setNumber);
wt.fc.IdentityHelper.service.changeIdentity(master,identity);
wt.fc.PersistenceHelper.manager.refresh(thisActivity);

 

PetrH

 

9 replies

Dec 9, 2023 2:31 PM UTC

Hi @MP_10719580 

Set the Lifecycle template to advanced and run own workflow in the state where you need.

Place an expresion robot with code in the workflow.

Write code to change the number  in the WF .

PetrH

Dec 11, 2023 1:21 PM UTC

Can you give some references or examples?

Dec 11, 2023 2:38 PM UTC

Hi @MP_10719580 

Here is example from WF Activity how to set number activity to a format "CN+/+AtivityNumber" 

HelesicPetr_1-1702305470159.png

 

wt.fc.Identified master = (wt.fc.Identified)thisActivity.getMaster();
wt.change2.WTChangeActivity2MasterIdentity identity = (wt.change2.WTChangeActivity2MasterIdentity) master.getIdentificationObject();
identity.setNumber(setNumber);
wt.fc.IdentityHelper.service.changeIdentity(master,identity);
wt.fc.PersistenceHelper.manager.refresh(thisActivity);

 

PetrH