Hi,
There are multiple ways to come to a solution. My particular use case was to read an excel file content using BAW V.19 on the Cloud
The way I resolved this was to upload the document some how into the server (which is hard because in the cloud I dont have access to servers nor file paths), then was to access the file using apache poi and finally extract the data. Here the steps:
First, I had to identify how to upload a document in the BPM ECM to handle the document. This is the easieast part but tricky, because depending on the toolkit you can use multiple components, in my case I used a Document Explorer. Once uploaded I catch the documentId from the document uploaded event
Second I had to use a Content Integration Task to access the document, I passed the document Id and then I get the documentObject. Pick From Server "IBM BPM document store" and from Operation Name pick "Get document content". In the Data Mapping property, match to a local variable of type ECMContentStream
Third, I built a java application with POI: For this step you can import the poi jars in your process app and use the api methods to access the content, but in my case I built a java app (its easier to debug and faster to code) once was ready I packed into a jar and imported in the process app. All I had to do is to pass the document content to a method that I created (ECMContentStream.content). From that content you can create an Input Stream which can be used to create a Workbook object under POI, just remember that ECMContentStream.content is a Base64Binary String, so you have to parse it to byteArray. Here the code to do that:
/**
*@param content: This is the ECMContentStream object conent, ie. ECMContentStream.content
*/
public void getBinaryContent(String content){
byte[] contentBytes = DatatypeConverter.parseBase64Binary(content);
InputStream is = new ByteArrayInputStream(contentBytes );
Workbook wb = WorkbookFactory.create(is); //This is POI object for spreadsheets
//From here Work with your excel content...
}
Hope this info helps and if details needed don't hesitate on asking
-Jose