cancel
Showing results for 
Search instead for 
Did you mean: 

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

jmliege
Champ in-the-making
Champ in-the-making
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
3 REPLIES 3

davidc
Star Contributor
Star Contributor
Thanks.

I will apply the fix to v2.1.

davidc
Star Contributor
Star Contributor

jmliege
Champ in-the-making
Champ in-the-making
Just to inform that overriding the ManageTaskDialog.returnOwnership() is not enough so far.
In fact, the owner must be set to null unless the task is considered as assigned and therefore is not visible in the pooled tasks dashlet.

For now and until i get a hand on the v2.1, i'm working with an ugly overriding of the org.alfresco.repo.workflow.jbpm.JBPMEngine class (but it works fine…) Smiley Surprisedops:

Glad to help.

JM
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.