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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

OIR - Numbering Logic

Amirtharaj_K
15-Moonstone

OIR - Numbering Logic

Hi Guys,

I want to know if we can merge the attribute values to create a single attribute.

For example, I created a WT part. 

I filled out the attribute number 8989, created and added the customer number attribute in WT, and selected it from the drop-down list. I also manually entered the project number for one more attribute. Everything I get into the Number attribute. Is it possible to do it through OIR?

 

Regards,

Aj

7 REPLIES 7

Take a look at this article, which covers a lot of OIR settings

Article - CS172537 - [Knowledge Hub] Windchill PLM - Object Initialization Rules (OIRs) (ptc.com)

Thanks Rocket,

 

I discovered that. Now I am looking for the same number and name.

 

Regards,

Aj

Find the below OIR

Hi Guys,

How we can get the number and name should be same using OIR.

 

Regards,

Aj

Hi @Amirtharaj_K 

You can use something like this:

<!--  set the name to File Name   --> 
<AttrValue id="name" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">
<Attr id="number"/>
</AttrValue>

<AttrConstraint id="name" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>
</AttrConstraint>

 

Do not forget that the rename operation does not apply the OIR rules.. If someone rename the object where a Number is changed., The name is not automatically changed. 

During the rename operation OIR rule is not applied.

 

PetrH

Could you describe your use case a little more?

 

Are you using a generated Number, and then you want the Name to match, or something else?

Hi,

What is your Business Requirement? 

1. Do you want the number to be Auto-generated with prefix as intended (Project no+ Customer no+Auto Generated No...etc) ?

2. And then the Part Name should match this?

 

For the Req 1, it will be a customization

For Req 2,  its what the OIR can do (hence no code).

 

Cheers

Hari

 

Top Tags