Hello everyone.I have a serviceTask with a java class which launches a class
<serviceTask id="Initialisation" name="Initialisation" activiti:class="acoss.activiti.DelegateInitialisation"></serviceTask>
The class itself implements JavaDelegate like this
public class DelegateInitialisation implements JavaDelegate
{
@Override
public void execute(DelegateExecution de) throws Exception
{
String processId = de.getProcessInstanceId();
TaskService tkService = de.getEngineServices().getTaskService();
List<Task> ltasks = tkService.createTaskQuery().processInstanceId(processId).list();
for (Task task : ltasks)
{
System.out.println(task.getId());
}
}
}
It gives me an empty task list. It seems that the processId I get is not the "real" processInstanceId.So I cannot get the TaskService, runtimeService, etc.Thank very much you if you see a solution.