[jboss-user] [JBoss jBPM] - Re: required variables

kukeltje do-not-reply at jboss.com
Thu Sep 13 05:25:39 EDT 2007


hmmmm.... yes, afaik, an exception should be thrown. I'll check the code cause now I'm getting worried. I hop it is not some kind of regression.

In org.jbpm.taskmgmt.exe..Taskinstance.submitVariables(), org.jbpm.taskmgmt.def.TaskControler.submitParameters()  is called which has a nice loop:

     if (variableAccesses!=null) {
  |         String missingTaskVariables = null;
  |         Iterator iter = variableAccesses.iterator();
  |         while (iter.hasNext()) {
  |           VariableAccess variableAccess = (VariableAccess) iter.next();
  |           String mappedName = variableAccess.getMappedName();
  |           // first check if the required variableInstances are present
  |           if ( (variableAccess.isRequired())
  |                && (! taskInstance.hasVariableLocally(mappedName))
  |              ) {
  |             if (missingTaskVariables==null) {
  |               missingTaskVariables = mappedName;
  |             } else {
  |               missingTaskVariables += ", "+mappedName;
  |             }
  |           }
  |         }
  | 
  |         // if there are missing, required parameters, throw an IllegalArgumentException
  |         if (missingTaskVariables!=null) {
  |           throw new IllegalArgumentException("missing task variables: "+missingTaskVariables);
  |         }
  | 

Strange thing is that I cannot find a test for this. I'm almost sure I've seen them in the past

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083829#4083829

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083829



More information about the jboss-user mailing list