Home |  Forum |  RSS


Anh Thu Vo - Wed Mar 08 11:37:13 UTC 2017 Wed Mar 08 11:37:13 UTC 2017
How to get the successor?

Hi Dmitry,

I can get the predecessor with the method
...task.getDependenciesAsDependee()... on the class DependencyTableModel.java

but how can I get the successor? Can you please give me some information.

Thanks a lots.
4 answers  
Dmitry Barashev - Wed Mar 08 12:24:00 UTC 2017 Wed Mar 08 12:24:00 UTC 2017
Task t; t.getDependenciesAsDependee() returns a subset of task dependencies where the task t plays the role of predecessor.

Task t; t.getDependenciesAsDependant() returns a subset of task dependencies where the task t plays the role of successor.

DependencyTableModel is a model for a tble in UI dialog. It may or may be useful, depending on whether your goal is to modify the dialog or something else.
Anh Thu Vo - Wed Mar 08 15:22:46 UTC 2017 Wed Mar 08 15:22:46 UTC 2017
Thank you for your quick reply :-)

My goal is to create a new tab next to the predecessor tab, which shows me the successor.

By the way, can you please check:
- task.getDependenciesAsDependant() gives me the predecessors
- task.getDependenciesAsDependee() gives me itself

Thanks & regards.
Dmitry Barashev - Wed Mar 08 20:52:00 UTC 2017 Wed Mar 08 20:52:00 UTC 2017
Both methods return TaskDependencySlice object which can return an array TaskDependency[]. TaskDependency objects have methods getDependant and getDependee. When you request t.getDependenciesAsDependant() then you get t in the result of getDependant() call and its predecessors in getDependee(). When you request t.getDependenciesAsDependee() then you get t in getDependee() and its successors in getDependant().
Anh Thu Vo - Thu Mar 09 10:01:17 UTC 2017 Thu Mar 09 10:01:17 UTC 2017
Big thanks for detailed information.
Have a nice day!