cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

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

NP_9998831
5-Regular Member

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
NP_9998831
5-Regular Member
(To: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;

}

View solution in original post

6 REPLIES 6

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.

 

NP_9998831
5-Regular Member
(To:avillanueva)

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.

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_9998831
5-Regular Member
(To:avillanueva)

Yeah its related to the link.
I need Java API.
I checked the ChangeHelper but nothing worked.

Update: in Associated Process Object i will be adding CR, PR,.... for a particular CR.

Hi @NP_9998831 

What about this article? CS189830

Is it helpful?

or create a link object to a WTChangeActivity2 as affected object is:

wt.change2.AffectedActivityData reportedAg = wt.change2.AffectedActivityData.newAffectedActivityData(changeable, ChangeActivityObject);
// changable is any object in the sysstem as WTPart, WTDocument, EPMDocument atc... 
// ChangeActivityObject is a object of WTChangeActivity2 in ChangeNotice.

 

Also very helpful is to understand all links in the change processes. CS63595

 

PetrH

NP_9998831
5-Regular Member
(To: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;

}

Top Tags