cancel
Showing results for 
Search instead for 
Did you mean: 

Check if task is first task

cookie-exploit
Champ in-the-making
Champ in-the-making
Hello Guys,

another question from me. Is it possible to check if some task is the first task (the task right after the start task), because if you create a process then you automatically go to the second task and this is the first task you can you can query, so i want to know if this is the "first" or if you prefer to call it the "second" task. But I want an independent way, getting the name of the task or something like that is would be really bad, because then I can only use it for one process definition or have to gave the "first" task always the same id or so.

I hope you understand my problem, if not then you are free to ask me and it would be great if you can help me with this problem. Smiley Happy


Greets cookie-exploit
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
How about using RepositoryServiceImpl (ReadOnlyProcessDefinition getDeployedProcessDefinition(String processDefinitionId)) to fetch full definition and navigate through the definition (start at getInitial()) to find the first UserTask in the definition. If you have the ID, you can compare that with the task definition id of the actual Task you're using…