4 Replies Latest reply on Feb 4, 2010 5:03 AM by Raji n

    Accessing process variables in task form

    Raji n Newbie

      Hi All,

      In JBPM 3.2.6, I have a main process invoking a subprocess. The subprocess has a task and an associated form.


      In the start node of the main process, I am attaching an Action Handler to set an employee object in a process variable. I would like to display the contents of the employee object in the form.

      Can you please guide me on how to do this?


      I am passing the variables when invoking the subprocess.


      In the form (xhtml), I am accessing the values like this :


      <h:outputText value="#{employee.firstName}" />


      <h:outputText value="#{employee.address.street}" />


      But this doesn't seem to work. Nothing gets displayed on the screen.


      P.S Both employee and address objects are serializable.


      Appreciate any help on this.




        • 1. Re: Accessing process variables in task form
          john britto Newbie
          I  do not think  it is possible to use process variable to do  this  process
          • 2. Re: Accessing process variables in task form
            Ronald van Kuijk Master

            You provide to little information. Basically it should work.


            Do you see any errors in the logging? Do you see anything specific when the log level is turned to debug?

            1 of 1 people found this helpful
            • 3. Re: Accessing process variables in task form
              Raji n Newbie

              Apologies for not providing the code details. Here is the code snippet...


              I don't see any errors printed in the console or log files..When i view the source of the task form displayed in the console, the table cell comes up as an empty cell.


              Process Defintion - Loan Approval



              <process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="loanapproval">


              <start-state name="Start">

              <transition to="Document Verification"></transition>



              <process-state name="Document Verification">

              <sub-process name="document_verification"  binding="late"/>

              <variable access="read,write" name="loanApplication" mapped-name="loanApplication"></variable>

              <transition to="Underwriting"></transition>




              <end-state name="End"></end-state>


              <event type="process-start">

              <action class="sample.test.InitializationActionHandler" name="InitializationActionHandler"></action>







              Process Defintion - Subprocess


              <process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="document_verification">

              <swimlane name="loan-executive">

              <assignment actor-id="manager"></assignment>



              <swimlane name="loan-officer">

              <assignment actor-id="user"></assignment>



              <start-state name="start">

              <transition to="Verify Application"></transition>



              <task-node name="Verify Application Details">

              <task name="Verify Loan Details" duedate="5 business days" swimlane="loan-executive,loan-officer">


              <variable access="read,write" name="loanApplication" mapped-name="loanApplication"></variable>

              <variable access="read,write,required" name="docVerificationRemarks" mapped-name="docVerificationRemarks"></variable>



              <transition name="Approved" to="Perform Risk Analysis &amp; Pricing"></transition>

              <transition to="Update Status - Doc Incomplete" name="Documents Incomplete"></transition>









              Value Objects


              public class LoanApplication implements Serializable {

                   private String applicationId;

                   private ArrayList<Borrower> borrowerList;   //borrower and co-borrower info


                   // getter and setter methods



              public class Borrower implements Serializable {

                   private String firstName;

                   private String lastName;

                   private ArrayList<Employment>;  //history of present and past employment


                   //getter and setter methods





              When the main process is started, I am calling "InitializationActionHandler" to set the loanApplication object as a process variable.

              The loanApplication object contains borrower information.


              In the task form attached to the "Verify Loan Details" screen, I want to display the application details like borrower name, mortgage value etc.

              I used the following syntax,


                <h:outputText value="#{var['loanApplication.applicationID']}"/>

              <h:outputText value="#{var['loanApplication. borrowerList[0].firstName']}"/>


              but nothing gets printed.  But i can see the data being populated in the process variable through the InitializationHandler.

              So looks like either the variable is not getting passed to the task form or i am using wrong syntax.

              • 4. Re: Accessing process variables in task form
                Raji n Newbie

                I also tried using the syntax #{loanAplication.applicationID}, but that didn't work for me either.


                Here is the task form code (xhtml)


                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >


                <!-- the DOCTYPE means we are required to use html for a root element -->

                <html xmlns="http://www.w3.org/1999/xhtml"











                  <f:facet name="header">

                          <h:outputText value="#{taskName}"/>



                   <!-- TASKFORM BUTTONS -->


                      <f:facet name="header">

                          <h:outputText value="Application ID"/>


                     <h:outputText value="#{loanAplication.applicationID}"/>




                      <tf:transitionButton transition="Approved" value="Approve"/>

                      <tf:transitionButton transition="Documents Incomplete" value="Documents Incomplete"/>