4 Replies Latest reply on Jan 22, 2009 7:27 AM by Shashank Jain

    FileUpload in JBPM-3.1.4..very urgent

    mr Sathya Newbie

      hi all...

      I am trying to implement fileupload component in my application..i am using jbpm-3.1.4 and jboss-4.0.4..i uploaded the fileusing tomahawk file component.

      my requirement is if i uploaded the file then it is available for next taskinstance..

      task-node 1--->task-node 2

      if i uploaded the file in tasknode-1 then the file can be downloaded in tasknode 2..


      pls it is very urgent...

      i will be thankful if anyone can give me proper guidelines..


      here is my task.jsp page...

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="/WEB-INF/jbpm.tld" prefix="jbpm" %>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
      <%@ page import="org.jbpm.webapp.bean.*" %>
      <%@ page import="org.jbpm.taskmgmt.exe.*" %>
      
      <f:view>
      <jsp:include page="header1.jsp" />
      Task2
      <jsp:include page="header2.jsp" />
      
      <table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top">
      <h:form id="taskform">
      
       <h:inputText id="taskInstanceId" value="#{taskBean.taskInstanceId}" />
      
       <h3 color:red><h:outputText value="#{taskBean.taskInstance.name}" /></h2>
      
       <hr/>
      
      
       <h:dataTable value="#{taskBean.taskFormParameters}" var="formParameter">
       <h:column>
       <h:outputText value="#{formParameter.label}"/>
       </h:column>
       <h:column>
       <h:outputText value="#{formParameter.description}" />
       </h:column>
       <h:column>
       <h:inputTextarea rendered="#{formParameter.displaytype == 'textarea'}" value="#{formParameter.value}" readonly="#{formParameter.readOnly}" cols="33"/>
      
       <h:inputText rendered="#{formParameter.displaytype=='text'}" value="#{formParameter.value}" readonly="#{formParameter.readOnly}" size="43" />
      
       <t:inputCalendar rendered="#{formParameter.displaytype=='date'}" value="#{formParameter.value}" readonly="#{formParameter.readOnly}" renderPopupButtonAsImage="true" renderAsPopup="true"/>
      
       </h:column>
      
       </h:dataTable>
      
       <hr>
      
       <c:choose>
       <c:when test="${!empty taskBean.availableTransitions}">
       Task Actions:
       <c:forEach var="availableTransition" items="${taskBean.availableTransitions}">
       <c:set var="availableTransition" scope="request" value="${availableTransition}"/>
       <h:commandButton id="transitionButton" action="#{taskBean.saveAndClose}" value="#{availableTransition.name}"/>
       </c:forEach>
       </c:when>
       <c:otherwise>
       <h:commandButton id="transitionButton" action="#{taskBean.saveAndClose}" value="Save and Close Task"/>
       </c:otherwise>
       </c:choose>
      
      
       <h:commandButton action="#{taskBean.save}" value="save"/>
      <hr>
      </h:form>
      
      
      <h:form id="uploadForm" enctype="multipart/form-data">
      <h:panelGrid columns="3">
       <h:outputLabel for="file" value="Select File"/>
       <t:inputFileUpload id="file" value="#{taskBean.uploadedFile}" required="true"/>
       <h:message for="file" style="color: red;" />
       <h:panelGroup/>
       <h:commandButton value="Submit" action="#{taskBean.submit}" />
       <h:message for="uploadForm" infoStyle="color: green;" errorStyle="color: red;" />
      </h:panelGrid>
      
      <h:outputLink value="file/#{taskBean.fileName}" rendered="#{taskBean.fileName!=null}">Download</h:outputLink>
      
      </h:form>
      <hr>
      
      </td>
      </tr>
      </table>
      
      
      <jsp:include page="footer.jsp" />
      </f:view>
      



      Thanks in Advance...

      Sathya