<?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 Re: Promotion Request by object type in Windchill Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054872#M11100</link>
    <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/692827"&gt;@TDT&lt;/a&gt;&amp;nbsp;, nice work.&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/182930"&gt;@BryanK&lt;/a&gt;&amp;nbsp;, best practice for code in workflows is to externalize this in a custom class. You can have some code like passing in the PromotionNotice. This is important since if you find a bug or it throws can exception, the running workflows cannot be updated. They would have to be terminated and restarted. You might also think about creating a lookup file to map types to routes so that code does not need to change if you decide to change routes or support new types.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Feb 2026 11:55:42 GMT</pubDate>
    <dc:creator>avillanueva</dc:creator>
    <dc:date>2026-02-13T11:55:42Z</dc:date>
    <item>
      <title>Promotion Request by object type</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054786#M11098</link>
      <description>&lt;P&gt;I have a Promotion request that uses a conditional Router to route depending on object type.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have used the one from the KB that works well,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;shown below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wt.fc.QueryResult qr = wt.maturity.MaturityHelper.service.getPromotionTargets((wt.maturity.PromotionNotice)primaryBusinessObject);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(qr.hasMoreElements())&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wt.fc.Persistable pers = (wt.fc.Persistable) qr.nextElement();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pers.getClass().getName().equalsIgnoreCase("wt.doc.WTDocument"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(" ******** It is a WTDocument&amp;nbsp; ******** ");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "route1";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (pers.getClass().getName().equalsIgnoreCase("wt.part.WTPart"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(" ******** It is a WTPart ******** ");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "route2";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(" ******** It is neither WTDocument nor WTPart ******** ");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(" ******** Routing to default Document path&amp;nbsp; ******** ");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = "route1";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;catch (Exception e) {&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem that i have is that i want to route for a specific document subtype. &lt;BR /&gt;Lets say its com.ptc.General&lt;BR /&gt;replacing wt.doc.WTDocument with com.ptc.General or wt.doc.WTDocument|com.ptc.General doesent seem to work. &lt;BR /&gt;Are there any java gurus out there that can help?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 00:22:32 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054786#M11098</guid>
      <dc:creator>BryanK</dc:creator>
      <dc:date>2026-02-13T00:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Promotion Request by object type</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054793#M11099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/182930"&gt;@BryanK&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;After verifying that the object instance is of type WTDocument, you should implement your logic by checking the specific subtype of the WTDocument.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;if (pers.getClass().getName().equalsIgnoreCase("wt.doc.WTDocument"))
					{
						System.out.println(" ******** It is a WTDocument  ******** ");
						if (TypedUtilityServiceHelper.service.getTypeIdentifier(pers).toString()
								.equals("WCTYPE|wt.doc.WTDocument|com.ptc.General")) {
							System.out.println(" ******** It is a General Document  ******** ");
							result = "route1";
						} else {
							result = "route3";
						}
					}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 03:33:04 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054793#M11099</guid>
      <dc:creator>TDT</dc:creator>
      <dc:date>2026-02-13T03:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Promotion Request by object type</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054872#M11100</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/692827"&gt;@TDT&lt;/a&gt;&amp;nbsp;, nice work.&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/182930"&gt;@BryanK&lt;/a&gt;&amp;nbsp;, best practice for code in workflows is to externalize this in a custom class. You can have some code like passing in the PromotionNotice. This is important since if you find a bug or it throws can exception, the running workflows cannot be updated. They would have to be terminated and restarted. You might also think about creating a lookup file to map types to routes so that code does not need to change if you decide to change routes or support new types.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 11:55:42 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054872#M11100</guid>
      <dc:creator>avillanueva</dc:creator>
      <dc:date>2026-02-13T11:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Promotion Request by object type</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054995#M11101</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks very much this is pretty much what i was looking for I had to change some code as a kept getting errors but i have it working now.&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-java"&gt;&lt;CODE&gt;if (TypedUtilityServiceHelper.service.getTypeIdentifier(pers).toString()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Changed to&amp;nbsp;&lt;BR /&gt;wt.type.TypedUtilityServiceHelper.service.getTypeIdentifier&lt;/P&gt;</description>
      <pubDate>Sun, 15 Feb 2026 23:27:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054995#M11101</guid>
      <dc:creator>BryanK</dc:creator>
      <dc:date>2026-02-15T23:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Promotion Request by object type</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054996#M11102</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;This is valuable input, at the moment I'm doing a proof of concept to check that the logic will work, still need to work with the team to see if this will work for them, if it does we will look to create it more "robust and configurable"&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;B&lt;/P&gt;</description>
      <pubDate>Sun, 15 Feb 2026 23:30:04 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Promotion-Request-by-object-type/m-p/1054996#M11102</guid>
      <dc:creator>BryanK</dc:creator>
      <dc:date>2026-02-15T23:30:04Z</dc:date>
    </item>
  </channel>
</rss>

