[jboss-user] [JBoss jBPM] - Re: upload file in a task ?

vtysh do-not-reply at jboss.com
Wed Aug 6 07:21:46 EDT 2008

You shouldn't put action command to the tf:saveButton directly because all jbpm form actions described directly in the j4j:taskForm tag in the JBPM console application. 
To upload files in the task variable map you should to have own tag and use it inside standard action components commandButton or commandLink in your task form. For example:

  | <gd:inputFile target="#{stream}"/>
  | <h:commandLink value="upload">
  |     <customnamespace:addFile dataStream="#{stream}" target="#{var['file']}"/>
  | </h:commandLink>
To avoid variable map reload you should to specify some context variable value during upload action and check it on variable map loading action. If variable is set then do not reaload variable map.
Replace the line in the task.xhtml

  | <j4j:getVariableMap target="#{taskVariableMap}" value="#{task}"/>
with the next

  | <j4j:getVariableMap target="#{taskVariableMap}" value="#{task}"  unless="#{yourCustomVariableWhichIndicatesFileUpload}"/>
And of course do not forget to change form enctype to multipart.
Hope it will help to everybody searching the JBPM console file uploading solution for task

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168990#4168990

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168990

More information about the jboss-user mailing list