Hi,
In a workflow I am attempting to create a Change Task for every changeable on a change notice automatically.
So far I can create the individual change tasks with one changeable each, but I can only get it to be associated under "Resulting Objects" not "Affected Objects" - see below.
The code I am using for the creation and association is as follows:
while (qr.hasMoreElements()) {
wt.vc.Versioned obj = (wt.vc.Versioned) qr.nextElement();
vr.addElement((wt.change2.Changeable2)obj);
wt.change2.WTChangeActivity2 ca = wt.change2.WTChangeActivity2.newWTChangeActivity2();
ca.setName("Test " + i);
ca.setOrganization(org);
ca.setContainer(cont);
ca = (wt.change2.WTChangeActivity2) wt.change2.ChangeHelper2.service.saveChangeActivity(cn, ca);
wt.change2.ChangeHelper2.service.storeAssociations(wt.change2.ChangeRecord2.class, ca, vr);
vr.clear();
i = i + 1;
}
Where:
qr - all of the changeables attached to the change notice by the user.
cn - the change notice.
ca - the change activity.
vr - vector containing the changeables.
Can someone please help with this?
I am using PDMLINK 9.1.
Regards,
Toby