<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Matching generated Number on Save As in Windchill Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1048087#M10845</link>
    <description>&lt;P&gt;Version: Windchill 12.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use Case: Matching WTPart and EPMDocument numbers when using Save As&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We currently have WTPart and EPMDocument subtypes which receive auto generated numbers, snips of the OIRs below...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;WTPart:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	&amp;lt;!-- Set the number to M01234567 format --&amp;gt;
	&amp;lt;AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"&amp;gt; 
		&amp;lt;Arg&amp;gt;M&amp;lt;/Arg&amp;gt;
		&amp;lt;Arg&amp;gt;{GEN:wt.enterprise.SequenceGenerator:BOM_GROUP_seq:7:0}&amp;lt;/Arg&amp;gt;
	&amp;lt;/AttrValue&amp;gt;
	&amp;lt;AttrConstraint id="number" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"&amp;gt;     
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/&amp;gt; &amp;lt;!-- Get the server to generate a number --&amp;gt;
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetHiddenConstraint"/&amp;gt;		   &amp;lt;!-- Hide from the user (have to leave it modifiable so that auto associate works correctly) --&amp;gt;
	&amp;lt;/AttrConstraint&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;EPMDocument:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	&amp;lt;!-- Set the number to M01234567 format --&amp;gt;
	&amp;lt;AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"&amp;gt; 
		&amp;lt;Arg&amp;gt;M&amp;lt;/Arg&amp;gt;
		&amp;lt;Arg&amp;gt;{GEN:wt.enterprise.SequenceGenerator:BOM_GROUP_seq:7:0}&amp;lt;/Arg&amp;gt;
	&amp;lt;/AttrValue&amp;gt;
   
	&amp;lt;AttrConstraint id="number" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"&amp;gt;     
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/&amp;gt;        
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/&amp;gt;		
	&amp;lt;/AttrConstraint&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The intention with these is that the WTPart and EPMDocument have the same number, usually a user will achieve this by either:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Creating a WTPart of the above subtype, ticking 'Create CAD Document' to create an EPM Document at the same time, which will inherit the auto generated number from the WTPart&lt;/LI&gt;&lt;LI&gt;Creating a EPMDocument, which will auto generate a number, and then use Auto Associate which creates a WTPart with the same number&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This breaks however when a user tries to duplicate an existing WTPart and associated EPMDocument through Save As, as they each get a unique number (e.g. M0001001 &amp;amp; M0001002), requiring some tedious manual renumbering of objects, and we just have to accept that every alternate number won't be used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It makes sense why OIR gives them different numbers, as it's considering each new object in isolation, and doesn't know there's another object being duplicated at the same time. I've had a look at writing a new RuleAlgorithm to try and capture this, but it seems the only arguments it receives is those that are provided through the OIR XML, and the container, no reference to the other objects that are part of the Save As collection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A few possible options:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Just duplicate the EPMDocuments, then use Auto Associate - this loses WTPart based information like expressions and usage attributes, requiring manual re-entry&lt;/LI&gt;&lt;LI&gt;Just duplicate the WTParts, then manually create and associate EPMDocuments - more work than just renumbering&lt;/LI&gt;&lt;LI&gt;Use an event listener to catch creation events and adjust the numbers - this would work, but we're trying to avoid using event listeners unless absolutely necessary for performance reasons&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 16:44:32 GMT</pubDate>
    <dc:creator>GrahamV</dc:creator>
    <dc:date>2025-12-17T16:44:32Z</dc:date>
    <item>
      <title>Matching generated Number on Save As</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1048087#M10845</link>
      <description>&lt;P&gt;Version: Windchill 12.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use Case: Matching WTPart and EPMDocument numbers when using Save As&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We currently have WTPart and EPMDocument subtypes which receive auto generated numbers, snips of the OIRs below...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;WTPart:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	&amp;lt;!-- Set the number to M01234567 format --&amp;gt;
	&amp;lt;AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"&amp;gt; 
		&amp;lt;Arg&amp;gt;M&amp;lt;/Arg&amp;gt;
		&amp;lt;Arg&amp;gt;{GEN:wt.enterprise.SequenceGenerator:BOM_GROUP_seq:7:0}&amp;lt;/Arg&amp;gt;
	&amp;lt;/AttrValue&amp;gt;
	&amp;lt;AttrConstraint id="number" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"&amp;gt;     
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/&amp;gt; &amp;lt;!-- Get the server to generate a number --&amp;gt;
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetHiddenConstraint"/&amp;gt;		   &amp;lt;!-- Hide from the user (have to leave it modifiable so that auto associate works correctly) --&amp;gt;
	&amp;lt;/AttrConstraint&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;EPMDocument:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	&amp;lt;!-- Set the number to M01234567 format --&amp;gt;
	&amp;lt;AttrValue id="number" algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"&amp;gt; 
		&amp;lt;Arg&amp;gt;M&amp;lt;/Arg&amp;gt;
		&amp;lt;Arg&amp;gt;{GEN:wt.enterprise.SequenceGenerator:BOM_GROUP_seq:7:0}&amp;lt;/Arg&amp;gt;
	&amp;lt;/AttrValue&amp;gt;
   
	&amp;lt;AttrConstraint id="number" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"&amp;gt;     
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/&amp;gt;        
		&amp;lt;Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/&amp;gt;		
	&amp;lt;/AttrConstraint&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The intention with these is that the WTPart and EPMDocument have the same number, usually a user will achieve this by either:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Creating a WTPart of the above subtype, ticking 'Create CAD Document' to create an EPM Document at the same time, which will inherit the auto generated number from the WTPart&lt;/LI&gt;&lt;LI&gt;Creating a EPMDocument, which will auto generate a number, and then use Auto Associate which creates a WTPart with the same number&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This breaks however when a user tries to duplicate an existing WTPart and associated EPMDocument through Save As, as they each get a unique number (e.g. M0001001 &amp;amp; M0001002), requiring some tedious manual renumbering of objects, and we just have to accept that every alternate number won't be used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It makes sense why OIR gives them different numbers, as it's considering each new object in isolation, and doesn't know there's another object being duplicated at the same time. I've had a look at writing a new RuleAlgorithm to try and capture this, but it seems the only arguments it receives is those that are provided through the OIR XML, and the container, no reference to the other objects that are part of the Save As collection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A few possible options:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Just duplicate the EPMDocuments, then use Auto Associate - this loses WTPart based information like expressions and usage attributes, requiring manual re-entry&lt;/LI&gt;&lt;LI&gt;Just duplicate the WTParts, then manually create and associate EPMDocuments - more work than just renumbering&lt;/LI&gt;&lt;LI&gt;Use an event listener to catch creation events and adjust the numbers - this would work, but we're trying to avoid using event listeners unless absolutely necessary for performance reasons&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 16:44:32 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1048087#M10845</guid>
      <dc:creator>GrahamV</dc:creator>
      <dc:date>2025-12-17T16:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Matching generated Number on Save As</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1048186#M10848</link>
      <description>&lt;P&gt;Graham, hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I figure out how to do this using only OIRs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I start with WTPart and Owner associated CAD Doc that have different numbers.&amp;nbsp; The starting numbers are irrelevant.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="d_graham_0-1766047270967.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132588i0527692C33C26136/image-size/medium?v=v2&amp;amp;px=400" role="button" title="d_graham_0-1766047270967.png" alt="d_graham_0-1766047270967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I select Save As from the WTPart's action menu and then I include the CAD Doc.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="d_graham_1-1766047455921.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132589i0E0836EEAD4B0DF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="d_graham_1-1766047455921.png" alt="d_graham_1-1766047455921.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I select Ok and a new WTPart and CAD Doc are created both having the same number. Well, almost the same, the CAD Doc also has the ".PRT" on the end of its number&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="d_graham_2-1766047733541.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132590i8E6C5D43980194B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="d_graham_2-1766047733541.png" alt="d_graham_2-1766047733541.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, this is possible to do using OIRs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;
&lt;P&gt;&lt;A href="mailto:windchill.developer@yahoo.com" target="_blank" rel="noopener"&gt;windchill.developer@yahoo.com&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 08:55:17 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1048186#M10848</guid>
      <dc:creator>d_graham</dc:creator>
      <dc:date>2025-12-18T08:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Matching generated Number on Save As</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1049358#M10874</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/480782"&gt;@GrahamV&lt;/a&gt;&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to see if you got the help you needed.&lt;/P&gt;
&lt;P&gt;If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.&lt;BR /&gt;Of course, if you have more to share on your issue, please pursue the conversation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Anurag&lt;/P&gt;</description>
      <pubDate>Mon, 29 Dec 2025 16:16:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1049358#M10874</guid>
      <dc:creator>anursingh</dc:creator>
      <dc:date>2025-12-29T16:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Matching generated Number on Save As</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1049724#M10884</link>
      <description>&lt;P&gt;what is the configuration to be done in OIR to achieve this functionality&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jan 2026 12:49:42 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Matching-generated-Number-on-Save-As/m-p/1049724#M10884</guid>
      <dc:creator>pradeepks</dc:creator>
      <dc:date>2026-01-05T12:49:42Z</dc:date>
    </item>
  </channel>
</rss>

