Skip to main content
12-Amethyst
November 18, 2022
Solved

Affected objects in Associated Process Objects is not propogating to parent object

  • November 18, 2022
  • 2 replies
  • 2152 views

Hi,

If a CR is having some objects like problem report, Plan Activity, linked in associated process objects then the affected objects present in those linked objects in associated process objects are not propogating to CR.
Any help on this?

Best answer by NP_9998831

i have achieved this using role A and role B as shown below.

 

public static ArrayList<WTChangeRequest2> getRoleBchangeRequest(WTChangeRequest2 roleA) throws WTException
{
System.out.println("get roleB CR");
ArrayList<WTChangeRequest2> changerequests = new ArrayList<WTChangeRequest2>();

QueryResult results = PersistenceHelper.manager.navigate(roleA, ChangeProcessLink.ROLE_BOBJECT_ROLE, ChangeProcessLink.class, true);
boolean found = false;
//System.out.println("get roleB CR results "+results);
while (results.hasMoreElements()) {
Object o = results.nextElement();
//System.out.println(o);
if (o instanceof WTChangeRequest2)
{
found = true;
changerequests.add((WTChangeRequest2) o);
}

}
if (found) return changerequests;
return null;

}

public static ArrayList<WTChangeRequest2> getRoleAchangeRequest(WTChangeRequest2 roleB) throws WTException
{
System.out.println("get roleA CR");
ArrayList<WTChangeRequest2> changerequests = new ArrayList<WTChangeRequest2>();

//public QueryResult navigate( Persistable obj, String role, Class linkClass, boolean onlyOtherSide )
// throws WTException;
QueryResult results = PersistenceHelper.manager.navigate(roleB, ChangeProcessLink.ROLE_AOBJECT_ROLE, ChangeProcessLink.class, true);
boolean found = false;
//System.out.println("get roleA CR results "+results);
while (results.hasMoreElements()) {
Object o = results.nextElement();
System.out.println("o"+o);
if (o instanceof WTChangeRequest2)
{
found = true;
changerequests.add((WTChangeRequest2) o);
}

}
if (found) return changerequests;
return null;

}

2 replies

avillanueva
23-Emerald I
23-Emerald I
November 18, 2022

If you create the CR from the problem report, there should be a propagate checkbox which would copy the items. If you are linking PRs from a CR, the it would not propagate. You would have to copy and paste manually or via code.

 

Propagating Information from the Problem Report
The propagate functionality is available for creating change requests.
When you create a change request from a problem report, the Set Attributes step contains a Propagate information checkbox. When you select the checkbox, the following fields are copied from the problem report to the change request:
• Name
• Description
• Affected end items
• Affected objects
• Attachments
Using the propagation functionality reduces the data entry to create the change request.
 

 

 
The appearance of the propagate check box is controlled by a preference. If you do not see it, an administrator has disabled the preference.

 

12-Amethyst
November 18, 2022

Thanks for the reply.
yeah if we use propogate check box we will have the propogation.
but i need a API/code to fetch the Affected Process Objects of particular CR.

 

Thanks in Advance.

avillanueva
23-Emerald I
23-Emerald I
November 18, 2022

Are you related to this post?

https://community.ptc.com/t5/Windchill/How-to-get-quot-Associated-Process-Objects-quot-of-Change/m-p/709833#M63457

Are you looking for REST API or Java API?

Have you looked at wt.change.ChangeHelper2 class?

NP_999883112-AmethystAuthorAnswer
12-Amethyst
December 21, 2022

i have achieved this using role A and role B as shown below.

 

public static ArrayList<WTChangeRequest2> getRoleBchangeRequest(WTChangeRequest2 roleA) throws WTException
{
System.out.println("get roleB CR");
ArrayList<WTChangeRequest2> changerequests = new ArrayList<WTChangeRequest2>();

QueryResult results = PersistenceHelper.manager.navigate(roleA, ChangeProcessLink.ROLE_BOBJECT_ROLE, ChangeProcessLink.class, true);
boolean found = false;
//System.out.println("get roleB CR results "+results);
while (results.hasMoreElements()) {
Object o = results.nextElement();
//System.out.println(o);
if (o instanceof WTChangeRequest2)
{
found = true;
changerequests.add((WTChangeRequest2) o);
}

}
if (found) return changerequests;
return null;

}

public static ArrayList<WTChangeRequest2> getRoleAchangeRequest(WTChangeRequest2 roleB) throws WTException
{
System.out.println("get roleA CR");
ArrayList<WTChangeRequest2> changerequests = new ArrayList<WTChangeRequest2>();

//public QueryResult navigate( Persistable obj, String role, Class linkClass, boolean onlyOtherSide )
// throws WTException;
QueryResult results = PersistenceHelper.manager.navigate(roleB, ChangeProcessLink.ROLE_AOBJECT_ROLE, ChangeProcessLink.class, true);
boolean found = false;
//System.out.println("get roleA CR results "+results);
while (results.hasMoreElements()) {
Object o = results.nextElement();
System.out.println("o"+o);
if (o instanceof WTChangeRequest2)
{
found = true;
changerequests.add((WTChangeRequest2) o);
}

}
if (found) return changerequests;
return null;

}