Null values handling for submit form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2012 05:42 AM
I implemented a custom form type for my user task.
During a FormService.submitTaskFormData I want to set this specific property to null, therefore I add the form property id and a null value to the map which is used for the submitTaskFormData call.
My convertFormValueToModelValue method of my AbstractFormType implementation is executed where I return null In case the propertyValue is null but the null value is never set to the variable of my form property.
A look at the FormPropertyHandler.submitFormProperty code shows that the value is only stored to variables or variable expressions when it is not null.
if (modelValue != null) {
if (variableName != null) {
execution.setVariable(variableName, modelValue);
} else if (variableExpression != null) {
variableExpression.setValue(modelValue, execution);
} else {
execution.setVariable(id, modelValue);
}
}
This doesn’t make much sense for me. Why do you prevent null values?
Is there a way to change this behavior without changing the activiti code?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2012 12:26 PM
But maybe If you describe the use case my opinion might change…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2012 04:44 AM
The user may choose to leave the form property empty. After the user task I cannot see whether the value is from the previous run or the user chose the same value once again or even if he chose to leave the value empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2012 05:10 AM
It feels like you're trying to capture at least three meanings with one 'null value'.
You'll have to add some task listener logic there, to check which 'run' of the task it was, and insert a different variable into the process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2012 10:34 AM
If the variable doesn't exist, you know the user didn't fill it in.
It feels like you're trying to capture at least three meanings with one 'null value' …
But this variable already exists from a previous run in the loop.
I don't think I am mixing up something or maybe I don't got you right.
Here are the cases:
With null value:
User type something in -> value is stored in the variable
User leave it empty -> null is stored in the variable
In this case it is pretty clear what the user input was.
Without null value:
User type something in -> value is stored in the variable
User left it empty -> variable stays untouched and still has the value from the previous run
In this case I cannot see if the user chooses to leave the input empty or add the same value once again
I can probably solve somehow the problem with a listener, or write variables directly during a user task instead of using form properties, but it could be so simple with null values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2012 04:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2012 03:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2012 05:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2012 03:15 AM
it looks like it is currently no possible to sign up for an Jira account using the link on the community page. Is there an other way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2012 05:11 AM
