5 Replies Latest reply on Mar 22, 2018 3:13 PM by RAFAEL PINO

    jBPM document as a variable

    Alex Chen Newbie

      Hi, I have a simple process on jBPM6.2 with 2 user tasks: User1 uploads a file and User2 sees the file.

       

      The input form has a document type field bind to the output (first task). When I run an instance and attempts the complete the upload task, I get the following error

       

      Other processes that don't involve uploading a file seem to persist correctly into h2 database.

       

      If you know how to attach a document into onto a user task and passing the document on as a variable within the process I would love to hear about it.

       

      Help would be appreciated, thanks in advance.

        • 1. Re: jBPM document as a variable
          Maciej Swiderski Master

          you need to use document marshaling strategy to avoid storing actual file in db which might be the issue here. See docs for details on how to configure it.

           

          HTH

          • 2. Re: jBPM document as a variable
            RAFAEL PINO Newbie

            Hi Maciej.

             

            What if I need to upload multiple documents? How can it be accomplished?. Thanks.

            • 3. Re: jBPM document as a variable
              Maciej Swiderski Master

              either use many variables of document type or use recently added (7.6.0) Documents type that has also new marshaling strategy to deal with many documents.

              JBPM-6502 - Support collection of documents. (#1034) · kiegroup/jbpm@10afa92 · GitHub

              HTH

              • 4. Re: jBPM document as a variable
                RAFAEL PINO Newbie

                Hi Maciej. Thank you for your help.

                 

                I've set up the new Documents Strategy in my deployment descriptor.

                 

                 

                Also, I've created a process variable definition documents : org.jbpm.documents.Documents.

                 

                Then, I've set up a human task with an input variable using de documents definition.

                But when I try to create a Form using the input variable, I can't asign a nested form and then the form designer shows an error on this field.

                 

                What I'm doing wrong or what I'm missing?.

                 

                 

                 

                Thank you again.

                • 5. Re: jBPM document as a variable
                  RAFAEL PINO Newbie

                  Also I see the following exception in the server log:

                   

                   

                   

                  Caused by: java.lang.IllegalArgumentException: Unable to create instance (no arg constructor) of type org.jbpm.document.marshalling.DocumentsMarshallingStrategy due to org.jbpm.document.marshalling.DocumentsMarshallingStrategy

                    at org.jbpm.runtime.manager.impl.deploy.ReflectionObjectModelResolver.getInstance(ReflectionObjectModelResolver.java:78)

                    at org.jbpm.kie.services.impl.KModuleDeploymentService.getInstanceFromModel(KModuleDeploymentService.java:345)

                    at org.jbpm.kie.services.impl.KModuleDeploymentService.boostrapRuntimeEnvironmentBuilder(KModuleDeploymentService.java:291)

                    at org.jbpm.kie.services.impl.KModuleDeploymentService.deploy(KModuleDeploymentService.java:193)

                    ... 56 more

                  Caused by: java.lang.InstantiationExce


                   

                  rafael.pino  wrote:

                   

                  Hi Maciej. Thank you for your help.

                   

                  I've set up the new Documents Strategy in my deployment descriptor.

                   

                   

                  Also, I've created a process variable definition documents : org.jbpm.documents.Documents.

                   

                  Then, I've set up a human task with an input variable using de documents definition.

                  But when I try to create a Form using the input variable, I can't asign a nested form and then the form designer shows an error on this field.

                   

                  What I'm doing wrong or what I'm missing?.

                   

                   

                   

                  Thank you again.