Project and Portfolio Management Practitioners Forum
Showing results for 
Search instead for 
Did you mean: 

Creating and attaching a document in a workflow execution step

Go to solution
Occasional Advisor

Creating and attaching a document in a workflow execution step

We have been running PPM 9.12 and are currently only using the Deployment Management module of PPM.  We've built a workflow execution step that creates a html based Word doc and attaches it to the Deployment Management package.  The document is for SOX purposes and contains the detail of each package line ( filname, object type, source code revision number, etc).  We use a DB package to create the doc and to insert the doc information (doc ID, creation date, filesize, etc) into knta_documents and knta_references so that the document appears on the references tab of the package.  The developer can then download the document to include with change management approvals, etc.


Since upgrading our dev system to 9.20, we've encountered a problem in the process above.  In the above process, when we insert the doc information into knta_documents, we insert a filesize of '100' bytes.  (We don't know how large the document is until our workflow step creates it and the size will be based on how many package lines there are and how many times they've traversed workflow steps, etc.)  However, when downloaded, the entire file is downloaded.  In PPM 9.20, when downloaded, we are only getting 100 bytes of the document. 


If I insert the doc info into knta_documents with '1000' bytes as the filesize, then when I try to download the doc in the workbench or dashboard I get only 1000 bytes of the document.  I've increased the filesize in the insert to 500000 bytes, but this causes the download of the document to hang in the browser.  I've also tried not including a filesize or nulling the filesize and this causes the insert to fail.


Has anyone encountered this and found a way around it?  It seems as though PPM 9.12 didn't care about the value in the filesize column, but PPM 9.20 does.  I suppose I could try to get the filesize from the server's file system as it is created before the insert, but the processing for this is occurring in an Oracle DB package in the db and was hoping not to have to totally re-engineer this.


Any help would be greatly appreciated! 


Jim Esler
Honored Contributor

Re: Creating and attaching a document in a workflow execution step

I saw this behavior when manipulating these tables in 9.14. I used the following command to get the file size:


export FS=`ls -l "<filename>" | awk '{print $5}'`

Occasional Advisor

Re: Creating and attaching a document in a workflow execution step

Thanks. . this did it for us.  I appreciate your help!

//Add this to "OnDomLoad" event