There is a saying, "When you lose, don't lose the lesson," and that is exactly what this experience is--a lesson to be learned. Develop it and turn the negative situation into a positive experience. You did not receive the promotion or assignment you wanted this time, but you are much better off then when you started. You know what your goals are and you are still striving to reach them; and you have a better understanding of how to achieve them the next time around. If these promotional processes were easy, it wouldn't mean as much to you when you achieve your promotion.
Continue taking exams. Many departments have an oral board process for specialty assignments. If at all possible, take advantage of this and enter the process, even if you're not sure you want the assignment. Who knows, you may change your mind once you begin to investigate the position and really want a change in your duty assignment. I believe the more oral boards you are exposed to, the more comfortable you will be when the next promotional process comes around. I don't know who said this, but it fits the occasion: "Winners make things happen; losers let things happen." Remember, you are continuing to improve upon your competitive abilities, which will put you ahead of your peers. Don't wait until there is a notice of a future promotional exam; prepare now because you never know when the next promotional process may be given.
One thing that is very important for every process in which you participate is to thank the loved ones who put up with you during these stressful times. They were with you every step of the way, and they will be supportive, no matter the results.