[jboss-user] [JBoss jBPM] - Re: required variables
dleerob
do-not-reply at jboss.com
Thu Sep 13 14:22:41 EDT 2007
If you take a look at the initializeVariables method, it actually does copy across the variables locally, but with a null value. Basically, the validation won't ever work because it doesn't take null values into account, and a null value is always copied acrossed to the local task instance, even if the variable is not readable.
if (variableAccesses!=null) {
| Iterator iter = variableAccesses.iterator();
| while (iter.hasNext()) {
| VariableAccess variableAccess = (VariableAccess) iter.next();
| String mappedName = variableAccess.getMappedName();
| if (variableAccess.isReadable()) {
| String variableName = variableAccess.getVariableName();
| Object value = contextInstance.getVariable(variableName, token);
| log.debug("creating task instance variable '"+mappedName+"' from process variable '"+variableName+"', value '"+value+"'");
| taskInstance.setVariableLocally(mappedName, value);
| } else {
| log.debug("creating task instance local variable '"+mappedName+"'. initializing with null value.");
| taskInstance.setVariableLocally(mappedName, null);
| }
| }
| }
Note the "else" block:
else {
| log.debug("creating task instance local variable '"+mappedName+"'. initializing with null value.");
| taskInstance.setVariableLocally(mappedName, null);
| }
|
Please correct me if I'm mistaken, as I just took a quick look.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084136#4084136
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084136
More information about the jboss-user
mailing list