-
1. Re: Defining a list in a task form, but How?
aguizar May 19, 2010 5:26 AM (in response to gerardons)This is not really a jBPM question as the engine is able to persist and return a list of strings as variable value. Anyhow, if you are using JSF, you could take a look at what the web console does.
In particular, the web console comes has two supporting tag libraries, gravel and jbpm4jsf. These tag libraries provide a number of tags which you might find useful.
<html xmlns:h="http://java.sun.com/jsf/html" xmlns:gd="http://gravel.jboss.org/jsf/1.0/data" xmlns:j4j="http://jbpm.org/jbpm4jsf/core"> ... <j4j:loadProcessInstance id="#{id}" target="#{pi}"/> <j4j:getVariableMap target="#{vars}" value="#{pi}"/> <gd:repeat value="#{vars['applicants']}" var="applicant"> <h:outputText value="#{applicant}"/> </gd:repeat> </html>
Both the jbpm4jsf and gravel jars are available from the jboss maven repository.
-
2. Re: Defining a list in a task form, but How?
gerardons May 26, 2010 6:32 PM (in response to aguizar)Hola Alejandro,
thank you very much for your help. But I've difficulties to install/integrate the 2 jars (gravels and jbpm4jsf) into my jBPM deployment.
So as you noticed I'm also a newbie in this world. So where do I have to copy the 2 jars in order to use the tags in the code snippet? What do I have to do?
I already tried this snippet in my xhtml page, but an error occurred saying "<j4j:loadProcessInstance> Parent component is not an ActionSource". I assume that the problem is caused by the missing integrated jars.
So I did another try and left out the 2 first tags of the snippet and inserted only these tags into the xhtml. You have to know that the process has a process variable "list" which is a StringArray containing the names of the applicants.
<gd:repeat value="#{vars['list']}" var="applicant">
<h:outputText value="#{applicant}"/>
</gd:repeat>
So after all this implementation doesn't cause any problem at all and the page were rendered, but no applicant was listed. Is the usage of the tags and the process variable OK?
I would really appreciate if you or someone could help me again.
Greetings,
Gerardo