best grammar app

How to work with multiple document dataslots in Savvion

Submitted by Abhishek on Wed, 2011-12-21 19:26
sxc.hu

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 the first part of the problem is that how do you have multiple number of rows in one single request. You can make use of ExtJS or similar library. See my post on handling multiple items in a single request in Savvion post for how to handle multiple items. You can also use some clever javascript/JQuery to achieve the multiple items.

 

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.


Abhishek Mishra
Good experience in working with BPM technologies like Savvion, JBPM. Founder and Chief Editor of BPMGeek.com. Founder of Savvion Business Manager Mobility Framework Savmobify| View my BPMGeek Profile
|
best grammar app

About BPMGeek

BPMGeek is an initiative to collaborate and communicate with the growing Business process management community out there. The goal is to help developers connect with experts, ask questions, post their learning and get understanding of BPM Concepts. Often tool specific knowledge of niche areas end up developers perplexed and confused - especially when there are very less number of resources available. We will be coming up several several new features. Have a look at our Roadmap here

BPMGeek is an independent entity not associated with any Product. All BPM product professionals are invited to contribute. The Logos and Names used across the site belong to their respective owners. The viewpoints mentioned by Individual contributors are their own. BPMgeek cannot be held liable for any issues arising out of it.


BPMgeek is promoting the Nounshoun English Grammar App - developed by Constellation Software.