Start a conversation

How to access document dataslot within external JSPs?

Overview

You have a JSP that is external to Aurea Process (aka CX Process, Savvion or SBM) that needs to access a document stored as a global or instance dataslot within Aurea Process as a byte stream.

Solution

You can access a document stored as a global or instance dataslot from Aurea Process as a byte stream using the BLServer and SDMS API.  The following code example demonstrates how to retrieve a document from a global level document dataslot in a JSP (it is also possible to retrieve from a process instance level document dataslot):

  <%@ page import="java.util.*, java.sql.Timestamp, com.savvion.sbm.bpmportal.bizsite.util.*, com.savvion.sbm.bpmportal.bizsite.api.*, com.savvion.sbm.bizlogic.client.queryservice.*,com.tdiinc.BizLogic.Server.*, com.savvion.sbm.bizlogic.client.BLClientUtil, com.savvion.sbm.bizlogic.server.ejb.BLServer, com.savvion.sbm.bizlogic.server.svo.*, com.savvion.sbm.bizlogic.util.Session, com.savvion.sbm.dms.svo.Document" %> 
    
  <% 
  BLClientUtil blc; 
  BLServer blserver = BLClientUtil.getBizLogicServer(); 
  Session blsession = blserver.connect("ebms","ebms"); 
  out.println("\n"+"Got Connection to BLServer..."+"\n"); 
  
  // get processtemplate bl_sampleProcess object 
  ProcessTemplate pt = blserver.getProcessTemplate(blsession, "bl_sampleProcess");
  
  // ask for the global dataslot name docDS
  DocumentDS docObj = (DocumentDS) pt.getGlobalDataSlot("docDS");
  
  // list of all document in the document bundle, assuming it is document bundle 
  List<Document> listOfDocs = docObj.getDocuments(); 
  
  // Just extracting first document and getting its content below to demonstrate: 
  out.println("\n"+"ByteArrayInputStream to be plugged into external interface >> "+listOfDocs.get(0).getContent(docObj.getDSContext())+"\n"); 
  %>
  
Note: You will need to ensure that the Aurea Process jar files and conf directory are added to your Java classpath.

Testing

Using the sample JSP code above, your external JSP is able to access the document dataslot from Aurea Process.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments