Dateline: I found myself working early this morning, about 2:30am. I'm designing a software application I want to write, and trying to decide if I want to do certain things one way or another, so I'm making notes as I try to work things out. At some point I realize the notes are changing a little bit after I write them. "Gosh darnit", I think, "I'm asleep", at which point I decide to wake myself up so I can record these thoughts before I forget them.
My working dreams usually either end there, either a) letting myself fall asleep or b) with me dictating them into a voice recorder I keep beside the bed. But this morning I couldn't go back to sleep, so I got up to start writing the code for the problem I was working on in my sleep. By 7am I was pretty happy with where I was, so I went back to sleep until 9am. I don't know how real your dreams are, but that's how mine go.