getting resource by task id and direction implemented