This tutorial shows how to draw connections between two elements using Line Feature-ByFunction, and writes some conditions to it.
Enjoy!