简体   繁体   中英

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 .

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.

Are you familar with using Java with InfoEngine? If so, you can get the sequence by:

wt.fc.PersistenceHelper.manager.getNextSequence("SEQUENCE_NUMBER_OF_YOUR_OBJECT")

The sequence number will be specified inside the "Object Initialization Rule" that is associated with your object type.

作为临时解决方案 - 创建新Part ,读取数字并使用或删除。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM