AnsweredAssumed Answered

Recovery runtime task variables

Question asked by rafaelduqueestrada on Dec 18, 2014
Latest reply on Dec 29, 2014 by rafaelduqueestrada
First, the informations:

1- The table ACT_RU_TASK:


ID_, EXECUTION_ID_, PROC_ISNT_ID_, PROC_DEF_ID_, TASK_DEF_KEY_
35014, 35004, 35004, process:1:35003, checkCreate


2- The table ACT_RU_VARIABLE:


ID_, TYPE_, NAME_, EXECUTION_ID_, PROC_INST_ID_, TEXT_, TEXT2_
35006, string, nome, 35004, 35004, nome, <null>
35008, string, descricao, 35004, 35004, valor, <null>
35011, jpa-entity, param, 35004, 35004, domain.Param, 67


I need to get all variables with NAME_ = "param", but i couldn't do this with a single api call.
I had to call these methods:


…..
        List<Task> tasks = taskService.createTaskQuery().processDefinitionKey("process")
                .taskDefinitionKey("checkCreate")
                .list();

        Map<String, Object> variables = taskService.getVariables(tasks.get(0).getId());
……


I found this entry on stackoverflow: http://stackoverflow.com/questions/13881024/activiti-bpm-get-variables-within-task, but this was back in 2012.

Nowadays, is there a way to do this with one method call?

Outcomes