Decoupling gravitational sources in general relativity: The extended case