8 Replies Latest reply on Jan 22, 2009 5:55 AM by Shashank Jain

    upload file in a task ?

    secmask secmask Newbie

      hi all !
      i have trouble when try to modify jbpm-console and task form define.
      at first, i want to upload a file at a task and it' will show at the next task, i've searched this forum and many many in the google but not found any solution that can use.

      all of my work as follow:
      1- modify task.xhtml of jbpm-console, add attribute 'enctype="multipart/form-data".
      2- in task form, add a file filed input as :

      <jbpm:datacell>
       <f:facet name="header">
       <h:outputText value="File:"/>
       </f:facet>
       <gd:inputFile target="#{stream}" maxSize="104857600"/>
       </jbpm:datacell>
       <jbpm:datacell>
       <f:facet name="header">
       <h:outputText value="Actions:"/>
       </f:facet>
       <tf:saveButton value="Save">
       </tf:saveButton>
       <h:commandButton value="upload">
       <j4j:doUploadFile archive="#{stream}" target="link" />
       <n:nav outcome="success" redirect="true" storeMessages="true"/>
       <n:nav outcome="error" redirect="true" storeMessages="true"/>
       </h:commandButton>
       </jbpm:datacell>
      


      <j4j:doUploadFile archive="#{stream}" target="link" /> is my custom tag, it's similar to <j4j:deployProcess>

      the problem that when i use "Save" button, it's only save other user input to process variables, upload file action listener is not called. Use "upload" button will only upload the file (it's good) but it does not save process variables. I want it do both of work (save process variables and upload the file) but don't know how to do it. i've try

       <tf:saveButton value="Save">
       <j4j:doUploadFile archive="#{stream}" target="link" />
       <n:nav outcome="success" redirect="true" storeMessages="true"/>
       <n:nav outcome="error" redirect="true" storeMessages="true"/>
       </tf:saveButton>
      


      but is raise an exception (UITaskFormButtonBase:getEnclosingForm() catch NULL).

      please help me ! any suggest.
      thank very much.