Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: Restore Part Autonumbering

$
0
0

Walter, Attached is the OOTB WTPart OIR with autonumbering enabled. You will want to pay particular attention to these sections:

 

               <!-- set the number to a generated number -->

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

                  <!-- add a V prefix for variant parts -->

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

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

                        <Attr id="genericType"/>

                        <Arg>variant</Arg>

                     </Value>

                     <Arg>V</Arg>

                     <Arg></Arg>

                  </Value>

                  <!-- the sequence -->

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

               </AttrValue>

 

This specifies which Oracle sequence to use to determine the number value (WTPARTID_seq) along with how many characters it should be (10).

 

The below constraints section determines whether or not the number is editable in the wizards:

                   <AttrConstraint id="number" algorithm="wt.rule.algorithm.BooleanBranch">       

                      <Value algorithm="com.ptc.core.rule.server.impl.IfContainerTypeEqualsProjectTest"/>      

                     

                      <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">

                        <!-- <Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/>                              -->

                      </Value>       

                     

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

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

                              <Attr id="endItem"/>

                              <Arg>true</Arg>

                           </Value>

                          

                           <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"/>

                          

                           <Value 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"/>       

                           </Value>       

                       </Value>      

                   </AttrConstraint> 


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>