-
1. Re: selectManyCheckbox and jBPM variables
kukeltje May 25, 2007 6:01 AM (in response to jcv)- what conversion error
- debug info?
- example process and form?or change the value of the workflow variable without coupling the bean with the workflow code?
What do you mean by this??? -
2. Re: selectManyCheckbox and jBPM variables
javalau May 26, 2007 3:50 AM (in response to jcv)Maybe the selectManyCheckbox value attribute must be a value-binding expression to a property of type List, but the object of list type can not persist in jbpm3.2.
How to solve the problem ? -
3. Re: selectManyCheckbox and jBPM variables
jcv May 28, 2007 11:14 AM (in response to jcv)"javalau" wrote:
Maybe the selectManyCheckbox value attribute must be a value-binding expression to a property of type List, but the object of list type can not persist in jbpm3.2.
How to solve the problem ?
The problem was that the value attribute was actually a list.
To solve the problem i had to do something like this:<h:inputHidden binding="mybean.binding" value="#{var['workflow value']}" /> <h:selectManyCheckbox value="mybean.valuehandler"> ... </h:selectManyCheckbox>
The valuehandler property on "set" also set the value for the input hidden as a csv string.
My knoledge of JSF and JSP isnt too good, but this is the best thing i could do so far. -
5. Re: selectManyCheckbox and jBPM variables
javalau Jun 1, 2007 1:41 AM (in response to jcv)I always get the error:
Conversion Error setting value 'XXX1 XXX2 XXX3 XXX4' for '#{var[XXXX]}'.
public class ArrayStringConverter implements Converter {
private static final long serialVersionUID = 1L;
public boolean supports(Object value) {
if (value == null)
return true;
return (value.getClass() == String[].class);
}
public Object convert(Object o) {
StringBuffer convertedValue = null;
if (o != null) {
// String[] strArray = (String[]) ((Collection) o).toArray();
String[] strArray = (String[]) o;
for (int i = 0; i < strArray.length; i++) {
convertedValue.append(strArray);
if (i != strArray.length - 1) {
convertedValue.append("|");
}
}
}
return convertedValue.toString();
}
public Object revert(Object o) {
// Map revertedValue = null;
String[] strArray = null;
if (o != null) {
strArray = ((String) o).split("\\|");
/*
* revertedValue = new HashMap(); for (int i = 0; i <
* strArray.length; i++) { revertedValue.put(strArray,
* strArray); }
*/
}
return strArray;
}
}
<!-- String[] -->
<jbpm-type>
<variable-instance class="org.jbpm.context.exe.variableinstance.StringInstance" />
</jbpm-type>