0 votes
486 views
in Integrations by

2 Answers

0 votes
by (14.6k 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 335 views
0 votes
1 answer 441 views
0 votes
0 answers 74 views
0 votes
2 answers 507 views
asked Oct 16, 2017 in Coach Views by qaziMateen (120 points)
0 votes
0 answers 19 views
0 votes
1 answer 109 views
0 votes
1 answer 179 views
0 votes
0 answers 92 views
0 votes
0 answers 190 views
0 votes
0 answers 82 views
0 votes
1 answer 535 views

559 questions

454 answers

85 comments

1.7k users

Dosvak IBM BPM /BAW Products, Download Evaluation
Process & Performance Tools Process & Performance Tools
Code Analyzer Code Analyzer
UI Toolkit UI Toolkit
Integration Monitoring Integration Monitoring
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
...