How to Attach a Document to BPMN Process In jBPM 7

Multiple times we have to attach docuemnt to BPMN process which is part of process execution or if its required to perform HumanTask operation. Here are the steps for attaching Document to BPMN process in jBPM 7. 

  • In the kie-workbench, in project settings goto  deployment-descriptor file(kie-deployment-descriptor.xml)  and define the marshalling strategy for document
    • XML
       




      xxxxxxxxxx
      1


      1
      <marshalling-strategies>
      2
        <marshalling-strategy>
      3
        <resolver>mvel</resolver>
      4
        <identifier>new  org.jbpm.document.marshalling.DocumentCollectionImplMarshallingStrategy(new org.jbpm.document.marshalling.DocumentMarshallingStrategy())</identifier>
      5
         <parameters/>
      6
         </marshalling-strategy>
      7
      </marshalling-strategies>


  • Define process variable of type org.jbpm.document.DocumentCollection.

'DocumentCollectionImplMarshallingStrategy' and process variable of type 'org.jbpm.document.DocumentCollection'  support use of multiple documents in BPMN process, i.e at a time you can upload multiple documents while starting process/case execution or while performing task operation. For single document, we can use process variable of type 'org.jbpm.document.Document' with marshalling strategy 'org.jbpm.document.marshalling.DocumentMarshallingStrategy'.