Home |  Forum |  RSS

Forum

Anh Thu Vo - Mar 8, 2017 11:37:13 AM
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 - Mar 8, 2017 12:24:00 PM
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 - Mar 8, 2017 3:22:46 PM
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 - Mar 8, 2017 8:52:00 PM
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 - Mar 9, 2017 10:01:17 AM
Big thanks for detailed information.
Have a nice day!