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 want the YYYY to be updated automatically once the year changes.



On all versions and iterations? Or just latest created during the next year?
If on everything, that might be possible with a method used other than the
OIR.



Setting the initial value would be a custom number generator.




11-Garnet
June 26, 2012
We have the same need, but I would like it to only change the new items created that year.

I am very interested in finding out the solution for this.

Jenn K
sp-21-VisitorAuthor
1-Visitor
June 26, 2012

Thanks for replying. I want the latest objects to have the sequence number changed as PRT-2013-XXXXXX from 2013 and so on.ThanksSitanshu
1-Visitor
June 26, 2012
Jenn,



I recently helped another individual in past 6 months create this
themselves. They knew a little bit of Java. I don't recollect their name
but can look it up if they do not respond themselves soon.



You would have to be a java programmer or hire one to make this work. This
might be something to discuss at a SMUG-WUG event if skills or budget are an
issue.



Regards,

David


1-Visitor
June 26, 2012
You will need to know how to program and customize Windchill. The number
is part of the mastered object and so if changed on one version or
iteration, it is changed on all. There are also other access control
restrictions. So you would need to have a custom number generator as well
as some other monitoring or trigger device to change value to 2013 or 2014
when time is right. A custom action, add-on to a wizard, revise, whatever
makes sense. While I could help with this, Ido not have the bandwidth to
really even mentor someone through this right now.




sp-21-VisitorAuthor
1-Visitor
June 26, 2012

I can do java programming, was Java programmer for4 years. If you can recall the code or the Java class to modify, then I can reuse it and modify it accordingly.ThanksSitanshu
17-Peridot
June 26, 2012
Jenn

Your need can be covered by using OIR and a soft attribute to set the year in the part number eg pn-yyyy-seqnum ( in 10.x it's pretty easy to also hide this in the UI)

I would be interested to hear the use case for using the year in the part number.

Sitanshu,

I really would not recommend reidentifiying your parts - this is a bad practice. Your BOMs will change without change control and you will lose traceability. Remember that the name is on the master so you will be changing all the versions.

Sent from jeff's phone

On Jun 26, 2012, at 7:43 AM, "Knieper, Jennifer" <-<<a style="COLOR:" blue;=" text-decoration:=" underline&quot;=" target="_BLANK" href="mailto:-">>">mailto:->> wrote:

We have the same need, but I would like it to only change the new items created that year.

I am very interested in finding out the solution for this.

Jenn K
sp-21-VisitorAuthor
1-Visitor
June 26, 2012

The name change should be for the newly created parts in the subsequent years. I don't want to change the number/sequence of the old parts or the parts created earlier. If you can suggest, how I can set the year using soft attribute, it will be great help. My use case is exactly similar to Jenn's. I think I need to change the problem statement as:
"I want the YYYY to be updated automatically once the year changes, for the new parts which gets created after year changes"
Sorry my mistake. We are using WC10 and I know how we can hide the attributes in UI. Pls help me, in setting year using soft attribute and OIR.ThanksSitanshu
1-Visitor
June 26, 2012
Hello Prasad

the simplest way is hard coding the year within the OIR or configure the
sequence along with four digits year. We followed this method for change
objects from the earlier releases of PDMLink. We documented this as one of
the yearend activities and reset the year on Dec 31st or Jan 1st.



On R10, there are many rule algorithms which one can use for your
requirement. Windchill help center provides available rules algorithm and
how they can be used/extended. You can go to OIR administration UI and click
on context sensitive help center icon or using the URL ">http://<hostname>
/Windchill-WHC/index.jspx?id=ObjRuleRef&action=show



HTH.



Thank you and have a great time.

Best Regards

Swamy Senthil

Principal Solutions Architect, Swasen Inc

swamy.senthil@swasen.com(Email); 909 800 8423(M); 973 324 2729(W); 866
908 6561(F);




22-Sapphire I
June 26, 2012
Seems like another example of "Pre-PLM" thinking...
Not really needed - use another field for the date.