1 Reply Latest reply on Aug 23, 2005 12:04 PM by Alejandro Guizar

    Is there any example or doc about FileDefinition?

    Yue Ni Newbie

      Hi, I want to store binary data in jbpm and it seems the FileDefinition class meets my need. But I have the slightest idea about how to use it and I found nothing relevant in the doc. Could you show me some example?

        • 1. Re: Is there any example or doc about FileDefinition?
          Alejandro Guizar Master

          FileDefinition is useful to attach resources to your process definition. Any file other than processdefinition.xml that you include in your process archive can be retrieved using its path within the archive:

          FileDefinition fileDefinition = processDefinition.getFileDefinition();
          InputStream goodiesStream = fileDefinition.getInputStream("path/to/goodies.properties");
          byte[] goodiesRawBytes = fileDefinition.getBytes("path/to/goodies.properties");


          Normally your files are saved in the database. If your database has problems with large binary data, you can tell jBPM to store your files in the filesystem by setting the property "jbpm.files.dir" in your jbpm.properties to an absolute local path.

          For a practical example, see: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=67818