I am unable to set the owner application to the EPMDocument
I am doing the save as for the EPMDocument while doing save it is giving some error. iam able to get the owner application but iam not able to set the owner application for newly saveas
[error is"The value of "Owner Application" cannot be set to null, since it is a "required" attribute."]
private EPMDocument saveAsCADAssembly(EPMDocument emptyCADAssembly, String name) throws WTException {
try {
System.out.println("While Save as partName: " + name);
// Get the owner application from the original CAD assembly
EPMApplicationType ownerAppl = emptyCADAssembly.getOwnerApplication();
System.out.println("Owner Application: " + ownerAppl.toString());
RevisionControlled[] originals = new RevisionControlled[1];
CopyObjectInfo[] copyInfoArray = null;
originals[0] = emptyCADAssembly;
copyInfoArray = EnterpriseHelper.service.newMultiObjectCopy(originals);
EPMDocument copy = (EPMDocument) copyInfoArray[0].getCopy();
// Set the owner application for the newly saved copy
copy.getOwnerApplication();
// Set the owner application for the newly saved copy
copy.setNumber(name + ".SLDASM");
copy.setName(name + ".SLDASM");
copy.setContainer(emptyCADAssembly.getContainer());
copyInfoArray = EnterpriseHelper.service.saveMultiObjectCopy(copyInfoArray);
System.out.println("emptyCADAssembly return: " + emptyCADAssembly.getNumber() + "------" + emptyCADAssembly.getName());
} catch (Exception e) {
e.printStackTrace();
}
return emptyCADAssembly;
}

