The imparfait would usually be used for an action that is occurring, or a 'long' action.Example: Robert was sleeping: Robert dormaitHowever, you would use the passé composé in a 'sudden' or 'quick action' that would follow something like 'all of a sudden'Example: Robert was sleeping (long action) when all of a sudden, the phone rang (sudden action).Robert dormait quand tout a coup, le téléphone a sonné.