0 votes
3.2k views
in Integrations by

2 Answers

0 votes
by (16.3k points)
BP-3 has a very good toolkit for working with xls, with advanced formatting capabilities
0 votes
by (340 points)
edited by
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

Related questions

0 votes
1 answer 1.2k views
0 votes
1 answer 2.2k views
0 votes
0 answers 329 views
0 votes
2 answers 1.9k views
asked Oct 16, 2017 in Coach Views by qaziMateen (120 points)
0 votes
0 answers 249 views
0 votes
0 answers 265 views
0 votes
1 answer 997 views
0 votes
1 answer 1.1k views
0 votes
0 answers 800 views
0 votes
0 answers 1.1k views
0 votes
0 answers 339 views
0 votes
1 answer 2.4k views

635 questions

495 answers

98 comments

2.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...