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

We are happy to announce the new Windchill Customization board! Learn more.

How to add resulting item to the change activity by API ?

hiko
1-Newbie

How to add resulting item to the change activity by API ?

Hello all,

I'd like to add revised "Changeables" to resulting item of the activity automatically.

It seems that there is only getChangeablesAfter() method in ChangeHelper2.service. I can use the method to get the Changeables in resulting items, but there's no "addChangeablesAfter()" or something that can add business ojbects to the resulting items of the activity.

Does anyone know how to add Changeables to resulting items of the activity by API?

Your help will be really appreciated.

Thank you in advance.

Best Regards,

Kuo, Yen-ting

3 REPLIES 3
ddemay
1-Newbie
(To:hiko)

Did you try saveAffectedActivityData(Vector changables)
.createSupportingDataForLink.etc. in ChangeHelper2.service.? What you need
to do is look at the database and that'll answer which one you need to use.
The supportingdata and affectedactivity tables might show info in the Role A
and Role B columns. Both are linked objects associated to change objects.
I didn't spend much time looking at this since it is a holiday. This should
clue you in though what to look for.



HTH,

David DeMay



_____
hiko
1-Newbie
(To:hiko)

Thanks David!

I found the APIs to add the resulting objects by the clue you gave.

I post the examples code here for sharing to all as following:

public static void addChangeablesToResultingItem(Vector vector, WTChangeActivity2 ca2)
{
Class class1 = null;
ChangeRecord2 changerecord2 = null;

try
{
class1 = Class.forName("wt.change2.ChangeRecord2");
vector = ChangeHelper2.service.storeAssociations(class1, ca2, vector);
changerecord2 = (ChangeRecord2)vector.firstElement();
vector = ChangeHelper2.service.saveChangeRecord(vector);
}
catch(Exception e)
{ ... }

}

If anyone want this function, you can refer to this example.

jayk
6-Contributor
(To:hiko)

HI Hiko,

 

is it possible to Revise all the objects from affected to resulting, Instead of collecting them from the collector, where it will fetch all the Related CAD,Documents etc.

 

Please let me know if you have found this use case.

 

Thanks

 

 

 

Top Tags