[jboss-user] [jBPM] New message: "Re: NullPointerException on Assignment-Handler"

Ronald van Kuijk do-not-reply at jboss.com
Mon Jan 18 13:14:21 EST 2010


User development,

A new message was posted in the thread "NullPointerException on Assignment-Handler":

http://community.jboss.org/message/520628#520628

Author  : Ronald van Kuijk
Profile : http://community.jboss.org/people/kukeltje

Message:
--------------------------------------------------------------
Wow... sometimes I even impress myself with what I can achieve....  I got even deeper in the PVM then I did before and even at that level it is clearly written.
 
For one reason I do not know yet, the processDefinition is null in the execution where the task3 is to be created. In this case, the initialization of the assignmenthandler fails.
 
Changing
 
 
    UserCodeReference assignmentHandlerReference = assignableDefinition.getAssignmentHandlerReference();
    if (assignmentHandlerReference!=null) {
      AssignmentHandler assignmentHandler = (AssignmentHandler) assignmentHandlerReference.getObject(processDefinition);
 

 
 
to
 
    UserCodeReference assignmentHandlerReference = assignableDefinition.getAssignmentHandlerReference();
    if (assignmentHandlerReference!=null) {
      // FIXME Find out why processdefinition is null in at this time....
      if (processDefinition == null) {
          processDefinition = getProcessDefinition();
      }
      AssignmentHandler assignmentHandler = (AssignmentHandler) assignmentHandlerReference.getObject(processDefinition);
 

 
 
in ExecutionImpl#initializeAssignments Makes the test work. Still have to find out why the processdefinition is null, but that is maybe for the others to find out (I'll file a jira issue for this)
 
btw, Your the code in your assignment class is probably not scaling very well. Have you noticed that it can be replaced with
 
     String group = ((TaskImpl) assignable).getTaskDefinition()
                         .getCandidateGroupsExpression();
 
     assignable.setAssignee(defaultUsers.get(group));
 

 
This uses cached data so scales linear. I know you are not using API classes/methods then, but this seems a valid usecase to me so the api should be extended I think. (there is the same 'problem' using swimlanes). If you file a jira issue to extend the assignable interface, I'll look into this issue further.
 
Ronald

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/520628#520628




More information about the jboss-user mailing list