Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get sequence number in windchill through API

How to get sequence number for WT.Part or Wt.Document in Windchill through API?

When I create WT.Part - number automatically generated. But I can not find any method that returns the next number. I'm using Info*Engine.

like image 968
androschuk.a Avatar asked Oct 19 '22 15:10

androschuk.a


1 Answers

At the time of object WTPart creation windchill use OOTB oracle_seqence in order to auto generate the number. The sequence name is mentioned in the OIR of respective object. Like For

WTPart it is : WTPARTID_seq

For

WTDocument it is : WTDOCUMENTID_seq etc .

So, if you want to get next number of WTPart then you can directly call the method wt.fc.PersistenceHelper.manager.getNextSequence("WTPARTID_seq"); from your info*engine task.

For different object the name of the sequence will be different.

In 10.2 PTC introduce another method getCurrentSequence("SEQ_NAME") to get the current sequence value without incrementing the same.

like image 66
Kaushik Das Avatar answered Nov 01 '22 12:11

Kaushik Das