Function buildRetrievalPlanFromPolicy