Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Dear
We like to enforce a more structured naming convention for WTDocuments. For the moment the name is taken from the filename but we will not accept anything anymore in the future.
I like to work with Java code as a validaion list can be used there.
I understand that this must be part of the OIR, so the user will be prompted to give a proper name during the adding.
Can someone point me to the correct startpoint ?
Regards Bernard
Solved! Go to Solution.
Hi @berny2U
Oh first you need to define Windchill document attributes
in type and attribute management create global attribute and then add them to the WTDocument subtype as you need
For crated attributes crate the legal lists as you need or enumerated list
example> INPUT1, INPUT2, INPUT3
Create WTDocument subtype OIR rules with correct definition
<AttrValue id="name" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">
<Attr id="IBA|INPUT1"/>
<Arg>_</Arg>
<Attr id="IBA|INPUT2"/>
<Arg>_</Arg>
<Attr id="IBA|INPUT3"/>
</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>
Hope this can help
PetrH
Bernard,
To be clear, you have a list of acceptable names that the user must use. Correct?
If yes, there are several ways to enforce this, but I would think the best would be a drop-down list that the user selects from. True?
Or do I misunderstand?
David
David
I was thinking in terms of this : "Machine family name" + "_" + "size" + "_" + V + "pcf version". E.g. Phoenix_3015_V12
Whereby the machine name should come from a validation list.
So some degree of freedome should be needed via Java, a rollingbox would be too simple I guess.
Bernard
Bernard,
You can certainly write a custom algorithm to generate the value of any attribute (including Name) and then point your OIR to that custom code.
My questions would be:
Where is machine name coming from? The Product name?
Where is size coming from?
As for pcf Version, Name is stored in the master and is the same across all iterations of the object.
Can you really include version info in the name?
Or is the “name” you’re referring to a String attribute, not the Windchill name?
Or do I simply not understand? 🤷♂️
Hi David
The machine family type, size and version should be entered by the user and be validated against an internal list of valid names/sizes/formats. Historicly we have numbered the pcf versions for quick reference (despite of the revision (A,B,C,...) and the iteration), so I keep this not to confuse anyone. Ones a name has been chosen then it will be fixed like you mention for all the next versions/iterations.
Thanks for the help, I appreciate this.👍
Bernard
Hi @berny2U
I would have a suggestion.
Set the name as autogenerated by server and add three attributes with legal or enumerated list .
User has to specify the attributes and OIR build the name based on the attributes.
Easy
Admin can change the legal/enumerated list anytime and you can set this behavior without coding.
PetrH
Hello
Yes, indeed simple and easy, I like this.😉
Is there a getting started with this customization ?
Hi @berny2U
Oh first you need to define Windchill document attributes
in type and attribute management create global attribute and then add them to the WTDocument subtype as you need
For crated attributes crate the legal lists as you need or enumerated list
example> INPUT1, INPUT2, INPUT3
Create WTDocument subtype OIR rules with correct definition
<AttrValue id="name" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator">
<Attr id="IBA|INPUT1"/>
<Arg>_</Arg>
<Attr id="IBA|INPUT2"/>
<Arg>_</Arg>
<Attr id="IBA|INPUT3"/>
</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>
Hope this can help
PetrH
Thanks PetrH !😊