cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

OIR for object to have year included in the sequence number

sp-2
2-Explorer

OIR for object to have year included in the sequence number

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 13
ddemay
7-Bedrock
(To:sp-2)

>> 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.




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-2
2-Explorer
(To:sp-2)


Thanks for replying. I want the latest objects to have the sequence number changed as PRT-2013-XXXXXX from 2013 and so on.ThanksSitanshu
ddemay
7-Bedrock
(To:sp-2)

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


ddemay
7-Bedrock
(To:sp-2)

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-2
2-Explorer
(To:sp-2)


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
JeffZemsky
17-Peridot
(To:sp-2)

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-2
2-Explorer
(To:sp-2)


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
ssenthil
1-Visitor
(To:sp-2)

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);




MikeLockwood
22-Sapphire I
(To:sp-2)

Seems like another example of "Pre-PLM" thinking...
Not really needed - use another field for the date.
ssenthil
1-Visitor
(To:sp-2)

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 [
ddemay
7-Bedrock
(To:sp-2)

I agree but I usually try to share the technical details to accomplish such a feat.


Sent from my Verizon Wireless BlackBerry
darunachalam
4-Participant
(To:sp-2)

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.

Announcements


Top Tags