The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Rovo (12) [Avatar] Offline

while playing and testing things with some basic examples, I noticed that there are no decimal datatypes available for formProperty so the following example will produce an error:

<startEvent id="startevent1" name="Start">
<activiti:formProperty id="price" name="Price" type="double" required="true"></activiti:formProperty>

changing the type to float or decimal does not work either. I have found the following statement in the book (p106 (pdf 109)): "The default type is string, other supported types are long, Boolean, enum and date."

So what is considered best practice for defining a currency value as above? long and loose the decimal-part or convert the price to string and convert the string to float/double inside of a java class which might not work for scripts.

A further things that keeps me busy is, are there any labels in forms I can use to print some output to in cases of errors? My current approach is to use a formProperty and set it only to readable:

<activiti:formProperty id="addressValidationErrorProp" name="Error" expression="${execution.getVariable('validationError') != null and validationError != '' ? validationError : ''}" writable="false" />

but this isn't realy beautiful as the property-field is displayed (without content) in case of an empty validationError string which happens on the first call. The form is called again if the validation for the input failed or produced an error. I'd love to know how to output errors like in the case you defined a formProperty to a type long and inserting some decimal values instead of an integer/long-value.

Thanks in advance,
tijs.rademakers (494) [Avatar] Offline
Re: No decimal datatypes for formProperties?

Decimal form types are not supported, you're right.
However, it would be simple to add a new decimal form type.
For Activiti 5.9 I think the best solution would be to use a String form type.

Best regards,