views:

319

answers:

1

This piece of code moves all current versions of files from one folder to another but leaves all older versions unmoved. (Context is java code of DFC accessing Documentum.)

 String strObjId = versionColl.getString("r_object_id");
        com.documentum.fc.common.IDfId curObjectID = new DfId(strObjId);
        IDfSysObject curObj = (IDfSysObject)sess.getObject(curObjectID);
        versionlabel = curObj.getAllRepeatingStrings("r_version_label", ",");
        System.out.println("Moving document with Name:" + objName + "  and version:" + versionlabel);
        if (runMode.equals("1")) {
         curObj.unlink(oldpath);
         curObj.link(newpath);
         curObj.setString("a_special_app", curObj.getString("r_modifier"));
         curObj.setTime("a_last_review_date", curObj.getTime("r_modify_date"));
         curObj.setString("a_category","MOVED");
         curObj.save();
         System.out.println("Successfully Moved document with Name:" + objName + " and version:" + versionlabel);
        }

The error we were getting while moving older versions was "document immutable". So we added this piece of code that temporarily disables the immutable flag, allows the file to be moved and then resets the immutable flag to true.

curObj.setBoolean("r_immutable_flag", false);

The problem then was that this code ran perfectly on our dev machine (windows) while it crashed on production(windows) (gave link error). Any ideas as to why this is acting as it is and other codes to solve this issue would be great. Thanks.

A: 

Based on the little info given, it could be just about anything but my guess is that it's a permissions issue. Specifically, the user running this code does not have the proper permissions to move one(or more) of the documents you are trying to move OR the user running the code does not have enough permissions to link objects to the target folder.

shsteimer