Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
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?
Solved! Go to Solution.
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;
}
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.
|
The appearance of the propagate check box is controlled by a preference. If you do not see it, an administrator has disabled the preference.
|
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?
Are you looking for REST API or Java API?
Have you looked at wt.change.ChangeHelper2 class?
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
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;
}