[JBoss jBPM] - Re: required variables
by kukeltje
Olivier,
You are right that variables are copied from the processinstance. I would have sworn that was only the case if it existed and if not, none was created. I'm almost positive of this.
I'll look in the code but if the current behaviour is as you describe, boolean-expression: ((the docs have to be updated OR at least have to be more specific OR I have to read them again) AND there should be testcases for this) ....
(I'm sure there were, but that could have been for 3.1.x, I'll check)
but what about this scenario:
I want to have the user enter a value for a variable, but if through any other means this variable was already set (e.g. the esb) I want to display that and the user should be able to change it. With the current behaviour and the way you have to configure that, there always is a variable either with the value null or the value that is already there.
Then only putting a required=true on the input element in the webinterface would enforce this. In that case, I DO think there is a bug in the formgenerator since this is so unintuitive... I'm in favour of adding an additional check in the source then to see that if the current value is null and there is no value posted, an exception is thrown.
Sigh......
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084098#4084098
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084098
18 years, 9 months
[JBoss jBPM] - Re: required variables
by dleerob
Thanks for the help. I think you were referring to "IsReplacement" when you mentioned "IsAssignment".
I have changed the variable delaration in the process definition to:
<variable name='IsReplacement' access='write,required'></variable>
However, the task instance still has an "IsReplacement" variable with a null value. So it seems the all variables are copied across no matter what? Any clarification on this?
I did try deleting the "IsReplacement" variable, just before ending the task instance, as shown below:
| startTaskInstance.deleteVariable("IsReplacement");
| startTaskInstance.end();
|
Now that the variable does not exist at all, the exception is thrown. This indicates that the jbpm validation only checks if the variable exists, but not if it is null. So now the problem is that variables are copied across with null values, and therefore the validation allows them through. I would think that the validation should check if a variable is null, and not allow it through if it is.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084085#4084085
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084085
18 years, 9 months