How can move pdf-relations to a new cabinet

gcamou
edited February 3, 2009 in Documentum #1

Hello ....

How can move pdf-relations to a new cabinet

I am using the code shown below
Code

       public void TransformationToPDF(string documentumId)
        {
            ObjectIdentity jobId;
            try
            {
                jobTicket = new JobTicket();

                jobTicket.Profile = profileService.GetProfileByName(_repository, "optimizePDF_adts");

                jobTicket.Profile.Parameters[0].name = "doc_token_PrintType";

                jobTicket.Profile.Parameters[0].value = "No";

                jobTicket.Profile.Parameters[1].name = "doc_token_NoteIcons";
                jobTicket.Profile.Parameters[1].value = "No";

                jobTicket.ParamProperties = jobTicket.Profile.Parameters;

                jobTicket.sourceObjectId = documentumId;
                jobTicket.sourceFormat = "msw8";
                jobTicket.targetFormat = "pdf";
                jobTicket.renditionName = "Nombre del Rendition";
                jobTicket.renditionDescription = "Aqui va la descripcion del rendition";
                jobTicket.isStoreResultInRepo = false;
                jobTicket.notifyUser = true;
                jobTicket.priority = 1;

                jobId = transformationService.AddJob(jobTicket);

                bool flag = false;
                while (!flag)
                {
                    flag = sentinel(jobId);
                }
            }
            catch (Exception ex) { throw ex;}
        }

        public bool sentinel(ObjectIdentity jobTicket)
        {
            JobInfo jobInfo = transformationService.GetJobInfo(jobTicket);
           
            if (jobInfo.jobStatus.Equals("Completed"))
            {
                if (jobInfo.RepositoryTargetInfos != null && jobInfo.RepositoryTargetInfos.Length > 0)
                {
                    RepositoryTargetInfo theRepositoryTargetInfo = jobInfo.RepositoryTargetInfos[0];
                    MoveFile(theRepositoryTargetInfo.targetId, "/TestCabinetA", "/TestCabinetB");
                    return true;
                }
            }

            return false;
        }

        public void MoveFile(string documentumId, string sourcePath, string targetPath)
        {

            try
            {
                objectService.CreatePath(new ObjectPath(targetPath), _repository);

              

                ObjectIdentitySet objectIdentitySet = new ObjectIdentitySet(GetDataPackage(documentumId).DataObjects[0].Identity);

                ObjectPath sourceObjectPath = new ObjectPath(sourcePath);
                ObjectIdentity sourcePathObjectIdentity = new ObjectIdentity(sourceObjectPath, _repository);
                ObjectLocation sourceObjectLocation = new ObjectLocation(sourcePathObjectIdentity);

              

                ObjectPath targetObjectPath = new ObjectPath(targetPath);
                ObjectIdentity targetPathObjectIdentity = new ObjectIdentity(targetObjectPath, _repository);
                ObjectLocation targetObjectLocation = new ObjectLocation(targetPathObjectIdentity);

                OperationOptions operationOptions = null;

                objectService.Move(objectIdentitySet, sourceObjectLocation, targetObjectLocation, new DataPackage(), operationOptions); <---- here error
            }
            catch (Exception ex) { throw ex; }
        }


is sent to convert the file to pdf, where the status this "completed", moved pdf-relations to a new cabinet...

but this not happens and gives me the following exception
Exception
InnerException = {"\"Move\" operation failed for object: 06000001800196ce."}
Message        = "Service method \"Move\" invocation failed."
StackTrace     = "at Emc.Documentum.FS.Runtime.Context.Impl.ClientReflectionServiceInvoker.Invoke(Object proxy, MethodInfo method, Object[] args)
                          at Emc.Documentum.FS.Runtime.Context.Impl.SoapClientInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] ...
maybe the error is because the id does not correspond to a ObjectIdentity????
help....