AnsweredAssumed Answered

submitTaskFormData issue with Boolean Types

Question asked by scolyer on Apr 14, 2011
Latest reply on Apr 26, 2011 by frederikheremans1
I'm working on making a separate front end for activiti using Struts2 with the java api. I seem to be running into an issue when submitting forms.

Basically the flow is to render and display a form and then transform the parameters into an appropriate map and use submitTaskFormData or submitStartFormData to submit the form as needed.  This is working for the String cases that I've seen but seems to not work properly for other types (I'm focusing here on Booleans which have struck me with this issue).

For example, when trying to run the Vacation Request process that comes with activiti: on the Vacation Approval screen with the drop down. If I submit the form I get the following error:
org.activiti.engine.ActivitiException: condition expression returns non-Boolean: true (java.lang.String)

vacationApproved_type and vacationApproved are both getting passed into the submit methods. It's also interesting because on the initial request screen there is a boolean type (checkbox) that seems to work, and it is declared in a slightly different way:

broken: <input type="hidden" name="vacationApproved_type" value="Boolean" />

work: <input type="hidden" name="vacationPay_boolean" value="true"/>

The submit methods need Map<String, String> objects. One of my thoughts was to transform the booleans to their types as needed, but that appears to go against the intended design because the submit methods needs Strings rather than Objects.

The processes seem to work properly in Explorer but running my front end they seem to have an issue. I did note that in the Activiti documentation https://jira.codehaus.org/browse/ACT-294 that explorer does not seem to use these methods.

How should I proceed with these data types/ form submission?

Outcomes