Here is my code...
I want to change the link Association type to "contributing content" type ..any ideas?
Folder checkedout = WorkInProgressHelper.service.getCheckoutFolder();
WTPart part = (WTPart) qr.nextElement();
if (!(WorkInProgressHelper.isCheckedOut(part))) {
part = (WTPart) WorkInProgressHelper.service.checkout(part, checkedout, "").getWorkingCopy();
}else{
if(!WorkInProgressHelper.isWorkingCopy(part)){
part = (WTPart) WorkInProgressHelper.service.workingCopyOf(part);
}
}
EPMDocument[] epmDocs = getEPMDocs(part);
if (epmDocs != null) {
for (int i = 0; i < epmDocs.length; i++) {
EPMDocument epmDocument = epmDocs[i];
BinaryLink link = GenericUtilities.findLink(part, epmDocument);
if (!(WorkInProgressHelper.isCheckedOut(epmDocument))) {
epmDocument = (EPMDocument) WorkInProgressHelper.service.checkout(epmDocument, checkedout, "").getWorkingCopy();
}else{
if(!WorkInProgressHelper.isWorkingCopy(part)){
epmDocument = (EPMDocument) WorkInProgressHelper.service.workingCopyOf(epmDocument);
}
}
AssociationType localAssociationType = AssociationType.getAssociationType(link, true);
if (link instanceof EPMBuildRule) {
EPMBuildRule rule = EPMBuildRule.newEPMBuildRule(epmDocument, part);
try {
PersistenceHelper.manager.delete(link);
rule.setBuildType(EPMBuildRule.ALL_BUILD_ROLES);
PersistenceHelper.manager.store(rule);
} catch (WTPropertyVetoException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}