AnsweredAssumed Answered

Reading external form values in JavaDelegate

Question asked by atul1 on Oct 9, 2014
Latest reply on Oct 14, 2014 by atul1
Hi
I am working on CDI - JSF example , in this example i have use external JSF form for start event in process, where CreateApplicationTask class is JavaDelegate  and   taskForm_newOrder.jsf is external form which shown below.


<startEvent id="startEvent" name="Start" activiti:formKey="taskForm_newOrder.jsf">
      <extensionElements>
        <activiti:executionListener event="end" class="org.bpmnwithactiviti.cdi.task.CreateApplicationTask"></activiti:executionListener>
      </extensionElements>
    </startEvent>


And below is my JSF file  in which there is field inputText  by id isb , from which i need to read value in Javadelegate CreateApplicationTask.  HOw to read that value in delegate class

<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:h="http://java.sun.com/jsf/html"
   template="/WEB-INF/templates/template.xhtml">
   <ui:define name="content">
      <f:metadata>
         <!– bind the key of the process to be started –>
         <f:viewParam id="processDefinitionKey" name="processDefinitionKey" />
      </f:metadata>

      <h1>New book order #{processDefinitionKey}</h1>
      <h:form>
         <table>
            <tr>
               <td>ISBN:</td>
               <td><h:inputText id="isb" value=""/>
               </td>
            </tr>
            <tr>
               <td></td>
               <td><h:commandButton value="Submit"
                     action="#{businessProcess.startProcessByKey(processDefinitionKey)}"  actionListener="#{bookOrder.attrListener}" >
                        <f:setPropertyActionListener target="#{bookOrder.appPath}" value="#{bookOrder.isbn}" />
                     </h:commandButton>
               </td>
            </tr>
         </table>
      </h:form>
   </ui:define>

</ui:composition>

Outcomes