Search code examples
tomcatwebserverbonita

How to create a new folder in Bonita web server?


I'm new to Bonita BPM.

I created a variable to link to a local directory. But it didn't work because of the web browser security restriction. I changed the logic that once I create a new directory on the web server, I can link the directory and show what is inside. Is this a right logic?

I tried to create a test folder in a physical path under the tomcat server. But file:/// didn't work as well.

I would like to create a folder and upload files from a local directory. Is it possible to create a new directory in Bonita web server?

If possible, I would like to connect with the address like "file:///localhost:8888/bonita/archives/"

Thanks in advance.


Solution

  • I would like to create a folder and upload files from a local directory.

    According to your requirement to read files from a local directory, my recommendation would be the following:

    1. Set up a local FTP server and you can place your folders and/or files under the root.
    2. In the BPMN, create a groovy script to connect to this local FTP server and download the files. Create a byte array from the inputstream of the file downloaded.
    3. You can attach this byte array as a document to the case using attachDocument function in Process API using

      apiAccessor.processAPI.attachDocument(processInstanceId,documentVarName,fileName,fileType,byteArrayFromInputStream);

    4. You can view these case documents in the form