It's easiest to take the rock and the coral out of the tank and glue it, then put it in the water where there is no flow for a bit. The water sets the glue almost instantly. The other way is to take the coral out, slather it up and then put it on the rock which is still in the water. In this case you will have to squish it down to break the skin that has already cured from hitting the water, and hold it in place for a couple minutes. Either way works. The glue is reef safe, so it's not a huge concern, as long as it's staying upright.