-
1. Re: Iterator in tasks-nodes
pedrosacosta Nov 2, 2005 10:43 AM (in response to pedrosacosta)If i do
processInstance.getTaskMgmtInstance().getUnfinishedTasks(processInstance.getRootToken()).size();
i get 1 task instead of 3. -
-
3. Re: Iterator in tasks-nodes
kukeltje Nov 2, 2005 1:14 PM (in response to pedrosacosta)look at a 'token' as something that traverses the process (like petri-nets') So this token is always in just one node. If you exit that node it goes to the next (or splitting itself in case of forks)
Try reading the jBPM docs a little and look at the testcases you can see there what happens -
4. Re: Iterator in tasks-nodes
kukeltje Nov 2, 2005 10:13 PM (in response to pedrosacosta)Try this: does it make a difference?
Iterator myIt = processInstance.getTaskMgmtInstance().getUnfinishedTasks(processInstance.getRootToken()).iterator(); while(myIt.hasNext()) { ... System.out.println("ITERATION --> " + k); try { taskInstance = (TaskInstance) myIt.next(); } catch(NoSuchElementException ex) { System.out.println("NOOOOOOOOOOOOOOOOOOOOOOOOO"); } k++; }
And btw? what is in the ..... A 'signal' or 'endtask' or something? I mean, do you do something somewhere with the tasks? -
5. Re: Iterator in tasks-nodes
pedrosacosta Nov 3, 2005 4:46 AM (in response to pedrosacosta)Yes, i do things with the task, but i didn't put the code here.
-
6. Re: Iterator in tasks-nodes
pedrosacosta Nov 3, 2005 5:10 AM (in response to pedrosacosta)When i do the code like kukeltje says, i only get the first task, and right after that, the code jump off the while.
Where is my processdefinition.xml<?xml version="1.0" encoding="UTF-8"?> <process-definition name='simple'> <start-state name='start'> <transition name='to_registo_ocorrencia' to='registo_ocorrencia'/> </start-state> <!-- Tarefa 1 --> <task-node name='registo_ocorrencia'> <task name='RegistoOcorrenciaTask'> <controller> <variable name='data' access='read,required' mapped-name='data' /> <variable name='hora' access='read,required' mapped-name='hora' /> <variable name='local' access='read,required' mapped-name='local'/> <variable name='data_registo' access='read,required' mapped-name='data_registo'/> </controller> </task> <transition name='to_lista_tarefas' to='lista_tarefas'/> </task-node> <!-- Tarefa 2 --> <task-node name='lista_tarefas'> <task name='ListaTarefasTask'/> <transition name='to_notificacoes' to='notificacoes'></transition> </task-node> <!-- Tarefa 3 --> <task-node name='notificacoes'> <task name='NotificacoesTask'> </task> <transition name='to_end' to='end'> <!-- <action name='action' class='com.samples.action.GravarOcorrenciaHandler'></action> --> </transition> </task-node> <end-state name='end'></end-state> </process-definition>
This xml code has some words in portuguese -
7. Re: Iterator in tasks-nodes
pedrosacosta Nov 3, 2005 5:16 AM (in response to pedrosacosta)Now i do another question, beside the first one. How can i get the total of task-node?
Thanks.