Skip to main content
1-Visitor
June 26, 2012
Question

OIR for object to have year included in the sequence number

  • June 26, 2012
  • 13 replies
  • 2622 views

Hi All,


I am trying to come up with an OIR of object (lets say for wtPart or wtDocument) in windchill, in which I want the sequence number for the object should be of below form:


PRT-YYYY-XXXX (X= 0-9) (Y is year ).


I made the OIR something like:


<attrvalue =" id="number"" =" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"" =" ignore="false"" =" force="false"" =" final="false">


<arg>PRT-2012-</arg> <arg>{GEN:wt.enterprise.SequenceGenerator:WTPARTID_seq:6:0}</arg> </attrvalue>


But this will only solve the temporary problem. I want the YYYY to be updated automatically once the year changes.


Can we build any intelligence like this in OIR?


Please suggest.

13 replies

1-Visitor
June 26, 2012
I do agree that with the PLM system in place, intelligent numbering is no
longer required. It would be challenging to enforce the user for entering
the correct four digits if it is managed as another field.

If at all it is possible to convince the business team for numbers with no
year component, Created On seems to be the best bet.

It is one of the meta data available and that can be referred for the
year/or for any search criteria. Just my two cents...



From: Lockwood,Mike,IRVINE,R&D [
1-Visitor
June 26, 2012
I agree but I usually try to share the technical details to accomplish such a feat.


Sent from my Verizon Wireless BlackBerry
6-Contributor
June 29, 2012

We had a different requirement in WC9.1. The requirement was to append two digit suffix to WTDocument number based on an IBA value when a WTDocument is created. We followed the below approach. You could try this if other options don't work.


-create a custom form processor which extends OOTB CreateDocFormProcessor
-In the custom form processor, write a method 'doOperation(NmCommandBean paramNmCommandBean, List<objectbean> paramList)' which overrides the OOTB method 'doOperation(...)'.
Inside this method, call the super doOperation() method so that the object gets created using OOTB code.
Get the WTDocument object(s) instance from paramList and get the document number. Append the two digit prefix the document number & update the WTDocument master using IdentityHelper.service.changeIdentity API.

For WTPart, there is a similar processor CreatePartFormProcessor.java.To call this custom form processor, the corresponding OOTB actions.xml file (PartManagement-actions.xml) need to be updated. The year can be taken from system date.