-
1. Re: Accessing process variables in task form
brittobics Feb 3, 2010 11:50 AM (in response to raji_126)I do not think it is possible to use process variable to do this process -
2. Re: Accessing process variables in task form
kukeltje Feb 3, 2010 1:20 PM (in response to raji_126)1 of 1 people found this helpfulYou 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?
-
3. Re: Accessing process variables in task form
raji_126 Feb 4, 2010 7:53 AM (in response to kukeltje)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
[CODE]
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="loanapproval">
<start-state name="Start">
<transition to="Document Verification"></transition>
</start-state>
<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>
</process-state>
...................
.................
<end-state name="End"></end-state>
<event type="process-start">
<action class="sample.test.InitializationActionHandler" name="InitializationActionHandler"></action>
</event>
</process-definition>
[/CODE]
Process Defintion - Subprocess
[CODE]
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="document_verification">
<swimlane name="loan-executive">
<assignment actor-id="manager"></assignment>
</swimlane>
<swimlane name="loan-officer">
<assignment actor-id="user"></assignment>
</swimlane>
<start-state name="start">
<transition to="Verify Application"></transition>
</start-state>
<task-node name="Verify Application Details">
<task name="Verify Loan Details" duedate="5 business days" swimlane="loan-executive,loan-officer">
<controller>
<variable access="read,write" name="loanApplication" mapped-name="loanApplication"></variable>
<variable access="read,write,required" name="docVerificationRemarks" mapped-name="docVerificationRemarks"></variable>
</controller>
</task>
<transition name="Approved" to="Perform Risk Analysis & Pricing"></transition>
<transition to="Update Status - Doc Incomplete" name="Documents Incomplete"></transition>
</task-node>
..........
...........
.............
</process-definition>
[/CODE]
Value Objects
[CODE]
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
.........
}[/CODE]
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,
[CODE]
<h:outputText value="#{var['loanApplication.applicationID']}"/>
<h:outputText value="#{var['loanApplication. borrowerList[0].firstName']}"/>
[/CODE]
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_126 Feb 4, 2010 5:03 AM (in response to raji_126)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"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:tf="http://jbpm.org/jsf/tf"
xmlns:jbpm="http://jbpm.org/jsf">
<ui:component>
<jbpm:dataform>
<f:facet name="header">
<h:outputText value="#{taskName}"/>
</f:facet>
<!-- TASKFORM BUTTONS -->
<jbpm:datacell>
<f:facet name="header">
<h:outputText value="Application ID"/>
</f:facet>
<h:outputText value="#{loanAplication.applicationID}"/>
</jbpm:datacell>
<jbpm:datacell>
<tf:transitionButton transition="Approved" value="Approve"/>
<tf:transitionButton transition="Documents Incomplete" value="Documents Incomplete"/>
</jbpm:datacell>
</jbpm:dataform>
</ui:component>
</html>