Custom OIR to autonumber by folder
Version: Windchill 12.1
Use Case: I'm trying to create a rule on OIR to number CAD files based on the folder.
Every folder holds files from a different project and my company wants to number then with a specif prefix and have a new sequence for each folder.
Description:
The rule I've written is the following:
In this code the product context is Treinamento, the folder is PJ123 and the number sequence is PJTESTE that I've created for this folder.
This code is to test in which folder it is been created. Further conditions I will create after the folder condition is working.
<!-- set the number to a generated number -->
<AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">
<Value algorithm="wt.rule.algorithm.CaseBranch">
<Value algorithm="wt.rule.algorithm.StringInListTest">
<Attr id="folder.id"/>
<Arg>PJ123</Arg>
<Arg>/PJ123</Arg>
<Arg>./PJ123</Arg>
<Arg>Treinamento/PJ123</Arg>
<Arg>/Treinamento/PJ123</Arg>
<Arg>./Treinamento/PJ123</Arg>
<Arg>TreinamentoPJ123</Arg>
<Arg>*/PJ123</Arg>
<Arg>/Default/PJ123</Arg>
<Arg>/Default</Arg>
<Arg>/Default/PJ123*</Arg>
<Arg></Arg>
</Value>
<Arg>0123-</Arg>
<Arg>not123-</Arg>
</Value>
<Arg>{GEN:wt.enterprise.SequenceGenerator:PJTESTE:4:0}</Arg>
</AttrValue>
I've used StringInListTest validation just for track what names for folder I've tried.
The rule is not validating the folder. When I'm creating a CAD file in the folder PJ123, in any other folder and in the root the file is named not123-XXXX.
Does anyone know why it's not working?
Also, as far as I tested the validation to prefix selects either the first value or second, if I need to add the custom sequence how would I do it? I understand that I can't just add the number sequence with the prefix, as the following example:
<Arg>not123-{GEN:wt.enterprise.SequenceGenerator:PJTESTE:4:0}</Arg>

