I would not use "when" in the example you quote.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
AnonymousI've been told not to use the word "when" when providing examples. Such as in the following sentence.
A C-section is imperative in circumstances in which, for example, it is apparent the life of the mother or baby are at risk, including situations when the mother is bleeding heavily (hermorrhage) or the baby's oxygen supply is blocked.