In a custom workflow or rule, if you do not know if the return value from a call is the object name or id, then the getObject method from the Resolver interface can help you.
<T extends SailPointObject> T getObject(java.lang.Class<T> cls, java.lang.String idOrName) throws GeneralException
Retrieve an object by id or name.
e.g.
import sailpoint.object.*;
import sailpoint.api.*;
Identity identity = null;
identity = context.getObject(Identity.class,"2c9089c83e47e6f2013e47e8374a00b1");
System.out.println(identity.getDisplayName());
Prints "The Administrator"
identity = context.getObject(Identity.class,"spadmin");
System.out.println(identity.getDisplayName());
also prints "The Administrator"