how to access process variable
pebbels Mar 19, 2008 2:26 PMHi guys,
I have a problem to access the process variable fahrgestellNummer stored in jbpm variableinstance after exending todoList example for testing.
The variabel is stored by the class
@Name("todoList") public class TodoList { private String description; @In(value="#{vert.fahrgestellNr}", scope = ScopeType.BUSINESS_PROCESS) @Out(scope = ScopeType.BUSINESS_PROCESS, required=true) long fahrgestellNummer; @In private Actor actor; @In private JbpmContext jbpmContext; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @CreateProcess(definition="todo") public void createTodo() { +fahrgestellNr); System.out.print("=> => => => fahrgestellNummer: " +fahrgestellNummer); taskStarten(); } @StartTask public void taskStarten() { System.out.print("=> => => => in taskStarten"); System.out.print("=> => => => fahrgestellNummer: " +fahrgestellNummer); } @EndTask public void done() {} }
Within the form fahrgestellNummer seems to be empty because there is no output:
<!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 --> <ui:composition 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" xmlns:s="http://jboss.com/products/seam/taglib" template="layout/template.xhtml"> <ui:define name="body"> <f:view> <h1>Terminvereinbahrungen zur Fahrzeugabholung</h1> <h:form id="terminForm"> <h:outputText value="Es sind keine Termine zu vereinbaren!" rendered="#{empty taskInstanceList}" /> <h:dataTable value="#{taskInstanceList}" var="task" rendered="#{not empty taskInstanceList}"> <h:column> <f:facet name="header"> <h:outputText value="fahrgestellNummer"/> </f:facet> <h:outputText value="#{var['fahrgestellNummer']}" style="width: 400"/> </h:column>
Has somebody an idea what is wrong?
Thanks Tina