Necessary and sufficient conditions so that a commutative ring can be embedded into a strongly pi-regular ring