AnsweredAssumed Answered

Bug in org.alfresco.repo.workflow.jbpm.JBPMEngine ?

Question asked by jmliege on Mar 19, 2007
Latest reply on Mar 19, 2007 by jmliege
Hi,

I'm currently prototyping some complexes workflows with pooledactors.

When i try to put a task back in the pool, i get an error (null pointer exception).

This errors occurs in the following code: (starting line 1498)



else if (key.equals(ContentModel.PROP_OWNER))
                {
                    if (value != null && !(value instanceof String))
                    {
                        throw new WorkflowException("Task owner '" + value + "' is invalid");
                    }
                    String actorId = (String)value;
                    String existingActorId = instance.getActorId();
                    if (existingActorId == null || !actorId.equals(existingActorId))
                    {
                        instance.setActorId((String)value);
                    }
                    continue;
                }

As the calling code (ManageTaskDialog.returnOwnerShip) sets the owner to null, i have 'value=null', and so, i have an actorId = null.

Your code is checking if existingActorId variable is not null, not on actorId.
So I would suggest the following correction if it makes senses to you.



if (existingActorId == null || !existingActorId.equals(ActorId))
                    {
                        instance.setActorId((String)value);
                    }

This should avoid the null pointer exception.:wink:

NB: To avoid this problem, I will override the ManageTaskDialog in order to provide an empty String instead of a null value.

Best regards,
JMarc

Outcomes