BPM, Workflow, and Case

 View Only
  • 1.  Extracting documents from VWAttachment

    Posted Thu February 06, 2020 01:15 PM
    I need to introduce java component in workflow which needs to extract content as ​InputStream and write to network path.
    The attachments are available in workflow in form of array.

    I tried connecting to same CE instance from my component using below code:

    vwAttachments[0].getId();

    Connection conn = Factory.Connection.getConnection(ceUrl);

    Subject subject = UserContext.createSubject(conn, username, password, "FileNetP8");

    UserContext uc = UserContext.get();

    uc.pushSubject(subject);

    Domain domain = Factory.Domain.getInstance(conn, myDomain);

     ObjectStore objectStore = Factory.ObjectStore.fetchInstance(domain, vwAttachments[0].getLibraryName(), null);

    VersionSeries vs = Factory.VersionSeries.fetchInstance(objectStore, new Id( vwAttachments[0].getId()), null);

    Document document = (Document) vs.get_CurrentVersion();

    ContentTransfer contentTransfer = (ContentTransfer) document.get_ContentElements().get(0);

    InputStream inputStream = contentTransfer.accessContentStream();


    When I execute this component its giving be below error:
    error=Access to the Content Engine was not allowed because the Content Engine API library or the Web Service Interface (WSI) Listener could not find the required security context information. Expected credentials were not found in the security context.

    I did independent testing  of same user, password and ceurl to check if the informations are correct.
    And using small java class in eclipse, I was able to connect CE server using these parameters.

    Am I missing something here?
    OR
    Is there any other way by which I can extract content from VMAttachment array object in my java component ?

    ------------------------------
    Rajesh Panchal
    ------------------------------


  • 2.  RE: Extracting documents from VWAttachment

    IBM Champion
    Posted Fri February 07, 2020 02:40 AM
    Hi Rajesh
    try the following code snippet to fetch the ObjectStore in a custom component operation:
    String ceURI = filenet.vw.server.Configuration.GetCEURI(null, null);
    Connection conn = Factory.Connection.getConnection(ceURI);
    EntireNetwork entireNetwork = Factory.EntireNetwork.fetchInstance(conn, null);
    Domain localDomain = entireNetwork.get_LocalDomain();
    ObjectStore os = Factory.ObjectStore.fetchInstance(localDomain , vwAttachments[0].getLibraryName(), null);


    ------------------------------
    Christoph Sünderkamp
    Senior Consultant
    ISR Information Products AG
    Münster
    ------------------------------



  • 3.  RE: Extracting documents from VWAttachment

    Posted Fri February 07, 2020 10:36 AM
    ​Hey Crish,

    This one really worked for me.

    Thank you so much

    ------------------------------
    Rajesh Panchal
    ECM & BPM Consultant
    Neuberger Berman
    NY
    ------------------------------



  • 4.  RE: Extracting documents from VWAttachment

    Posted 9 days ago
     
    Could you please explain me where I can find the VWAttachment library? I need it to be able to work on my site, do the development and testing of it.
    Regards,


    ------------------------------
    Alexander Serrano
    ------------------------------



  • 5.  RE: Extracting documents from VWAttachment

    IBM Champion
    Posted 8 days ago

    Hi Alexander,

    for the connection to the P8 you will find the required API classes (Connection, Domain etc.) in the Jace.jar, the Process Engine API (contains VWAttachment etc.) is in the pe.jar
    You can retrieve the jars in ACCE. IBM FileNet Content Manager (Jace.jar) and IBM FileNet Process Engine (pe.jar) are located at domain level under Client API Download.

    Good entry points in the IBM documentation are:

    Regards



    ------------------------------
    Christoph Sünderkamp
    ------------------------------