How to work with multiple document dataslots in Savvion
Savvion Business Manager provides the ability to work with Document Dataslots. If you want to attach multiple documents, you can use something called Document Bundle. While document bundle can help you have a single dataslot that allows multiple documents to be attached, problem comes when you need these documents separated by some logic.
Consider an example. Lets suppose you need a workflow where you can attach the resumes of multiple candidates in a single request along with name, email id and date of interview of each candidate and the actual number of candidates can be known during runtime only. One way could be to have a limit say 10 resumes max per request and you create a dataslot for each one of the rows. However if you do not want to give a limit you are in trouble.
Now, once you have created the multiple rows thing I assume you will have an ID For each row and may be a process instance id for all of them. For handling multiple item, construct a path on the server (if you are using Pramati then you can do in SBM_HOME/webapps/deploy/sbm folder) where you can have a folder for each process instance id and a sub folder for each line item. Now you need to write some custom java code that can allow you to upload a document here. Similary you will need some code to fetch it later in the process.
For document upload, I would create a link in the row and pass the instance name and row id, that launches a popup say fileAttacher.jsp. Create a file field and a Form which allows multipart data to be uploaded. This will give you a browse button to upload file.
Next, on submit of the page, call say fileAttacherLogic.jsp which will take care of fetching the file data, process id and line item id. Using Java libraries like commons-fileupload and java.io you can save the file to the path we determined earlier.
Next, create a page which can browse through the path and find all files there. It will create a download/view link for each of those. Since you chose the path inside the webapps folder, this path is easily available via the http url method. When the user clicks on a document just open it as you would open a normal URL.
Hope this is helpful. Questions are welcome.