Skip to main content
2-Explorer
August 21, 2012
Question

Windchill OIR Rule Algorithm

  • August 21, 2012
  • 4 replies
  • 4683 views

Has anybody used the StringRegExEqualsTest rule algorithm in Windchill? I need to set up a complex set of rules that will create a part in different folders based on the first part of the part number. I was looking to see if I can use something already ootb rather than write my own rule algorithm. I am using Windchill 9.1.

4 replies

1-Visitor
September 10, 2012

Hi Theresa,

i have did something similiar to Number field based on the discrete set value selection in an IBA field.

on Choice of Value 1 and Value 2, system will generate the number with prefix.

following code is used for the same.

<VarDef id="metal" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator" >

<Arg>METAL-PART-</Arg>

<Arg>{GEN:wt.enterprise.SequenceGenerator:GUS_PARTREQUESTMETALID_seq:10:0}</Arg>

</VarDef>

<VarDef id="resin" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator" >

<Arg>RESIN-PART-</Arg>

<Arg>{GEN:wt.enterprise.SequenceGenerator:GUS_PARTREQUESTRESINID_seq:10:0}</Arg>

</VarDef>

<VarDef id="default" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator" >

<Arg>{GEN:wt.enterprise.SequenceGenerator:WTPARTID_seq:10:0}</Arg>

</VarDef>

<AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">

<Value algorithm="wt.rule.algorithm.CaseBranch">

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="IBA|gus_commodityparttype"/>

<Arg>Metal</Arg>

</Value>

<VarRef id="metal"/>

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="IBA|gus_commodityparttype"/>

<Arg>Resin</Arg>

</Value>

<VarRef id="resin"/>

<VarRef id="default"/>

</Value>

</AttrValue>

br

MKR

1-Visitor
March 10, 2015

Hello Ramanathan,

I am trying to use this logic to assign the number for a Creo part based on an IBA. But it is not working. Any tips?

What was the object type on which you applied this OIR?

Any help is greatly appreciated.

Regards

Naveen

tstacy2-ExplorerAuthor
2-Explorer
April 22, 2015

I applied this OIR to a Part.