The example code below from BillingReportSpecification uses the root.get function which maps the variables directly from the model and gets the id.
BillingReportSpecification
root.get