cancel
Showing results for 
Search instead for 
Did you mean: 

Persistence of UserTasks

mpriess
Champ in-the-making
Champ in-the-making
Hi,

I have a process with a UserTask and exclusive gateway and I save the values form the form with the following code snippt:

{code}
    public void confirmUserTask(String taskId, Map<String, String> parameterMap)
    {
        synchronized (USER_TASK_ACCESS_SEMAPHOR)
        {
            taskService.setVariables(taskId, parameterMap);
        }
        taskService.complete(taskId);
    }
{code}

After the value is persisted I looked into the database and my value is "serializable".

Now the exlusive gateway use internally an evaluation and return all time false for this expression.

My expression:
{code}
${USER_QA_NECESSARY == 'true'}
{code}

Is this the right way to persist values and use expressions?

Cheers,

Michael
5 REPLIES 5

mpriess
Champ in-the-making
Champ in-the-making
btw. I'm using Activiti 5.12 and JDK 1.7

trademak
Star Contributor
Star Contributor
That depends which variables you provide as part of the parameterMap.
It's a correct way to add variables to the process context. If the values are stored as text, long or serializable depends on the value type.

Best regards,

mpriess
Champ in-the-making
Champ in-the-making
Ok in my case the map contain only Strings which type is used in the database? My problem is that ${USER_QA_NECESSARY == 'true'} is always false. Which class resolve the value of USER_QA_NECESSARY from the database?

trademak
Star Contributor
Star Contributor
So you are not using a boolean for true but a String value? If it's a String value it will be stored as a String as well. Can you include the exact XML definition you have? I would like to see a bit more than just the expression.

mpriess
Champ in-the-making
Champ in-the-making
I found the failure. The value was of type String[] now everything works fine for me Smiley Happy also the use of boolean expressions Smiley Happy