cancel
Showing results for 
Search instead for 
Did you mean: 

Form properties not initialized when null or empty

pfeiffer
Champ in-the-making
Champ in-the-making
Hi,

I have a question regarding form properties. When using form properties and the user did not fill in a value, the process variable related to the form property is not set in the execution. You can see this in the FormPropertyHandler on line103 :

if (modelValue != null) {
…set variable in execution
}

Why have you chosen to do this this way ? Now as a result, when using a javaDelegate, executionlistener or tasklistener and injecting fields using that same process variable  will all fail, as the process variable is not defined. Therefore it is never possible to inject fields using a variable that may not have been filled in. You can only use "Required" form variables to inject. It seems like a limitation that is not necessary ?

Regards
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
We have chosen this approach because, in theory, a null-variable is the same as a variable not being present, from an API-perspective. When calling getVariable() an inexistent and null-value variable will both return null. However, we didn't take into account that expressions throw exceptions when a variable is present, opposed to when it's null.

It indeed makes more sense to say that, when you explicit ally define a form-property, null-values should be stored as well. One wouldn't declare a property and not use it later on…

Create issue for this, see https://jira.codehaus.org/browse/ACT-1499

smirzai
Champ on-the-rise
Champ on-the-rise
Fixed in "fix ACT-1428" pull request

jbarrez
Star Contributor
Star Contributor
Thanks Saeed!