7 Replies Latest reply on Nov 30, 2011 11:43 AM by Hiram Jafet Romo Torres

    upload file in ftl ?

    tomcheng76 Newbie

      I follow this step to create some human task.

       

      http://jkrzemie.wordpress.com/2011/03/30/jbpm-5-0-creating-simple-human-tasks-with-variables/

       

      It works pretty well.

       

      but, How to upload a file in the human task form ?

       

      I could only find a example for jbpmv4....

       

      Thanks in advance.

        • 1. Re: upload file in ftl ?
          Tihomir Surdilovic Master

          From your other posts it sounds like you are using Guvnor and the web Designer. In this case please see http://blog.athico.com/2011/07/develop-complex-jbpm-processes-all-in.html and the video there, which may answer your question

           

          Hope this helps.

          • 2. Re: upload file in ftl ?
            tomcheng76 Newbie

            Thanks for your uploaded video.

             

            I still don't know how to map the upload file with a variable, what class should i use?

             

            I know i can easily submit string/integer from the form

             

            The auto form generator / validator is really great.

             

            Previously I can use org.apache.commons.fileupload.DiskFileUpload to get the file if i just use a simple servlet.

             

            But i cannot do this in jbpm, how to map the submitted file from the form to the variable inside the process ?

             

            Please help as i think this is really a "simple" human task, but i am unable to do this.

            • 3. Re: upload file in ftl ?
              Tobias Wittur Newbie

              Did you follow all those rules?:

              • Task forms that should be associated with a specific process definition should have the name "{processDefinitionId}.ftl"
              • Task forms for a specific human task should have the name "{taskName}.ftl"
              • All artefacts should be deployed to the "defaultPackage" on Guvnor (as that  is where the jbpm-console will be looking)
              • A process should define "defaultPackage" as the package name (otherwise you won't be able to build your package on Guvnor)
              • The process diagram for a specific process should have the name "{processDefinitionId}-image.png"

               

              http://blog.athico.com/2011/01/process-repository-using-guvnor.html

              http://docs.jboss.org/jbpm/v5.1/userguide/ch.Human_Tasks.html

               

              Do you have a guvnor repository linked to your eclipse, so you can commit the ftl files to your guvnor designer?

               

              If your ftl file is successfully uploaded, you should be able to find it under documentation and assets.

              • 4. Re: upload file in ftl ?
                tomcheng76 Newbie

                Tobias Wittur wrote:

                 

                Did you follow all those rules?:

                • Task forms that should be associated with a specific process definition should have the name "{processDefinitionId}.ftl"
                • Task forms for a specific human task should have the name "{taskName}.ftl"
                • All artefacts should be deployed to the "defaultPackage" on Guvnor (as that  is where the jbpm-console will be looking)
                • A process should define "defaultPackage" as the package name (otherwise you won't be able to build your package on Guvnor)
                • The process diagram for a specific process should have the name "{processDefinitionId}-image.png"

                 

                http://blog.athico.com/2011/01/process-repository-using-guvnor.html

                http://docs.jboss.org/jbpm/v5.1/userguide/ch.Human_Tasks.html

                 

                Do you have a guvnor repository linked to your eclipse, so you can commit the ftl files to your guvnor designer?

                 

                If your ftl file is successfully uploaded, you should be able to find it under documentation and assets.

                I followed the rules already.

                 

                Created a human task, created ftl, -image.png and uploaded to guvnor from eclipse. This is what i have done already.

                 

                My process is working. The question is...

                 

                The form only allow user to type something, such as your name, your reason etc

                 

                But i cannot figure out how to allow user to upload something in the human task form.

                 

                How to map the upload file to a variable in the process instance...

                • 5. Re: upload file in ftl ?
                  Tobias Wittur Newbie

                  So your form looks somehow like this?:

                   

                  <form action="targetUrl" enctype="multipart/form-data" method="post">


                  <input type="file" name="dataFile" size="40">

                  <input type="submit" value="Send">
                  </form>

                   

                  I guess the file name should be saved in dataFile.

                  • 6. Re: upload file in ftl ?
                    tomcheng76 Newbie

                    Tobias Wittur wrote:

                     

                    So your form looks somehow like this?:

                     

                    <form action="targetUrl" enctype="multipart/form-data" method="post">


                    <input type="file" name="dataFile" size="40">

                    <input type="submit" value="Send">
                    </form>

                     

                    I guess the file name should be saved in dataFile.

                    Yes, my form looks like this one.

                     

                    If i define the variable dataFile, what is the type of it?

                     

                    I guess it should be a Object, but i don't know what should i fill in for the ClassName ...

                    • 7. Re: upload file in ftl ?
                      Hiram Jafet Romo Torres Newbie

                      Could you find the solution? I try to do the same... I need your help...