Any methods to get the task graph from RuleSource

I have learned the new model api, and I can create model or mutation from RuleSource.

But I have no idea to get the task graph from RuleSource.
The situation is “if some task executes, we will rearrange the source-set”, so we need the task graph.

If it is impossible, I just use the gradle.graph to do it.