As noted on Wednesday, Rey Mysterio has signed a 2-year deal with WWE. The deal allows him to give notice after 18 months.
Dave Meltzer of the Wrestling Observer Newsletter reports that the deal was worked out some time ago and that is why he pulled out of the upcoming Northeast Wrestling. Back in August, Mysterio told promoters that he was not going to take independent dates after 9/2 so it was clear by that time that a deal was reached with WWE.
WWE was interested in him since January and there were talks going on for months but things didn't get serious until the last few months. Basically, they had to come to an agreement on a reduced schedule because he doesn't think his body can hold up to a full schedule. Money and the contract time frame were the other things that had to be worked out and have been agreed to.
Mysterio was told not to say anything publicly until WWE announced his signing. I would assume that they would announce something soon because one would think that they would want to include him on the Super Show-Down event in Australia.