<?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 How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API in Windchill Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836065#M2888</link>
    <description>&lt;P&gt;I was creating a WTChangeRequest2 with the below code mentioned&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WTChangeRequest2 ecr = createChangeRequest();&lt;/P&gt;&lt;P&gt;WTSet links = new WTHashSet();&lt;BR /&gt;int count1 =0;&lt;BR /&gt;createdDocs.stream().forEach(e-&amp;gt;{&lt;BR /&gt;Changeable2 co = e;&lt;BR /&gt;RelevantRequestData2 relevantRequestData;&lt;BR /&gt;try {&lt;BR /&gt;relevantRequestData = RelevantRequestData2.newRelevantRequestData2(co, ecr);&lt;BR /&gt;relevantRequestData.setDescription("some description:"+count1);&lt;BR /&gt;links.add(relevantRequestData);&lt;BR /&gt;} catch (WTException | WTPropertyVetoException e1) {&lt;BR /&gt;e1.printStackTrace();&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;ChangeHelper2.service.storeAssociations(ecr, links);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/241117"&gt;@HelesicPetr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 13:15:23 GMT</pubDate>
    <dc:creator>Manoj_Dokku4</dc:creator>
    <dc:date>2024-03-15T13:15:23Z</dc:date>
    <item>
      <title>How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836065#M2888</link>
      <description>&lt;P&gt;I was creating a WTChangeRequest2 with the below code mentioned&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WTChangeRequest2 ecr = createChangeRequest();&lt;/P&gt;&lt;P&gt;WTSet links = new WTHashSet();&lt;BR /&gt;int count1 =0;&lt;BR /&gt;createdDocs.stream().forEach(e-&amp;gt;{&lt;BR /&gt;Changeable2 co = e;&lt;BR /&gt;RelevantRequestData2 relevantRequestData;&lt;BR /&gt;try {&lt;BR /&gt;relevantRequestData = RelevantRequestData2.newRelevantRequestData2(co, ecr);&lt;BR /&gt;relevantRequestData.setDescription("some description:"+count1);&lt;BR /&gt;links.add(relevantRequestData);&lt;BR /&gt;} catch (WTException | WTPropertyVetoException e1) {&lt;BR /&gt;e1.printStackTrace();&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;ChangeHelper2.service.storeAssociations(ecr, links);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/241117"&gt;@HelesicPetr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 13:15:23 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836065#M2888</guid>
      <dc:creator>Manoj_Dokku4</dc:creator>
      <dc:date>2024-03-15T13:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836190#M2889</link>
      <description>&lt;P&gt;Resolved&lt;/P&gt;</description>
      <pubDate>Sat, 05 Nov 2022 04:48:21 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836190#M2889</guid>
      <dc:creator>Manoj_Dokku4</dc:creator>
      <dc:date>2022-11-05T04:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836411#M2890</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/620967"&gt;@Manoj_Dokku4&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you explain how this was resolved and also mark it as answered?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 14:34:35 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836411#M2890</guid>
      <dc:creator>STEVEG</dc:creator>
      <dc:date>2022-11-07T14:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836652#M2891</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/4118"&gt;@STEVEG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess that the code works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/620967"&gt;@Manoj_Dokku4&lt;/a&gt;&amp;nbsp;just needed to know what the inputs are &lt;STRONG&gt;co&lt;/STRONG&gt; - affected object and &lt;STRONG&gt;ecr &lt;/STRONG&gt;- ChangeRequest&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;// example for one affected object&lt;BR /&gt;RelevantRequestData2 &lt;/SPAN&gt;&lt;SPAN&gt;ecrtochangeable &lt;/SPAN&gt;= &lt;SPAN&gt;RelevantRequestData2&lt;/SPAN&gt;.&lt;SPAN&gt;newRelevantRequestData2&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;affectedPart&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;newCR&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;ecrtochangeable &lt;/SPAN&gt;= &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RelevantRequestData2&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;PersistenceHelper&lt;/SPAN&gt;.&lt;SPAN&gt;manager&lt;/SPAN&gt;.store&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ecrtochangeable&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;PetrH&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 07:57:33 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836652#M2891</guid>
      <dc:creator>HelesicPetr</dc:creator>
      <dc:date>2022-11-08T07:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836653#M2892</link>
      <description>&lt;P&gt;Hi, &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" href="https://community.ptc.com/t5/user/viewprofilepage/user-id/4118" target="_self"&gt;&lt;SPAN class=""&gt;STEVEG&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have used the below code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;Used streams to loop
where e can be WTPart/WTDocument.

Changeable2 co = (Changeable2)e;
WTSet links = new WTHashSet();
RelevantRequestData2 affectedObjectLink = RelevantRequestData2.newRelevantRequestData2(co, ecr);
links.add(affectedObjectLink);
ChangeHelper2.service.storeAssociations(ecr, links);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 08:03:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/How-to-create-a-WTChangeRequest2-with-Affected-Objects-and/m-p/836653#M2892</guid>
      <dc:creator>Manoj_Dokku4</dc:creator>
      <dc:date>2022-11-08T08:03:55Z</dc:date>
    </item>
  </channel>
</rss>

