My Builder is on Windows environment and actual environment is in Solaris. I am having some issue in copying file from workflow attachment to a folder in content server. Below is the description of the issue.
let say we have a file abcd.docx having 10 versions in our wf attachment. we need to move only current version i.e 10th version to the repository.
On Using DAPI.CopyNode with DAPI.COPY_CURRENTV option, we are able to copy the node 10th version to the repository.
But the catch here is that the file which is getting copied in the repository is having version number as 10. Requirement says it should copy it as version 1.
Thus we used DAPI.CopyANode which copies abcd.docx file and then above this we are adding current version using DAPI.CopyVersion. this results perfectly fine in windows environment ie but the same is not working in solaris.
Solaris results in:
We are able to see 0 kb file only but when we render version information of the file ie versions tab it is showing me 2 kb file version(as version no. 1), which is correct. Above that when we open Specific tab for this file it is showing Current Version: 0 (0 available)
Here is the piece of code:
Integer copynover
copynover = DAPI.COPY_NO_VER ;
DAPINODE new = DAPI.AllocNode( dSession )
//source node is an attachment file eg abcd.docx let say having 10 versions
//destNode is repository folder
status1 = DAPI.CopyANode(sourceNode,destNode ,new,copynover)
echo('after move');
if IsError( status1 )
ok = FALSE
errMsg = 'Error moving workflow attachment.'
break
end
//taking the current version of attachment file
DAPIVERSION sourceVersion = DAPI.GetVersion(sourceNode, DAPI.VERSION_GET_CURRENT);
DAPIVERSION docVersion1 = DAPI.AllocVersion(dSession);
DAPINODE newlyaddedfile
//getting the newly added file which is added by copyANode function.
newlyaddedfile = DAPI.GetNode(attachInfo[attachCnt].name , destNode)
Integer copyFlags1
copyFlags1 = DAPI.VCOPY_ADDVER | DAPI.VCOPY_UNLOCK
//adding latest version to it.
status1 = DAPI.CopyVersion(sourceVersion, newlyaddedfile, docVersion1, copyFlags1)
if IsError( status1 )
ok = FALSE
errMsg = 'Error moving workflow attachment.'
break
end
Please let us know if we have any workaround for this.