Tuesday, March 1, 2016

ADF BC REST Support for List Of Values (LOV) Data

ADF BC REST service out of the box supports LOV list data. You can define LOV for ADF BC View Object attribute and use it straight away in REST service. This is especially useful when LOV list is filtered based on other attributes from current row - no need to collect and send these attributes to the service separately, filtering logic will be handled for you in ADF BC backend. One more benefit - you can reuse existing ADF BC with LOV's implementation and expose it through REST service.

Below you can see employee #108 attributes with values returned by REST service, generated on top of ADF BC View Object. ManagerId attribute in View Object is configured with LOV list. Based on this configuration, each item in REST collection will have a link to REST resource providing LOV data (Employees/280/lov/EmployeesLovView1). For employee #108, it retrieves LOV data from VO EmployeesLovView1:


We can get LOV list entries for employee #108 by executing simple REST request, no need to specify additional parameters (Employees/280/lov/EmployeesLovView1):


LOV VO is set with View Criteria to return a list of possible managers, employees with the same job, excluding employee himself:


LOV View Accessor in the main VO (Employees) is configured to use employee ID and job ID from current row (current REST collection item) - in this way LOV list will be filtered automatically, by View Criteria:


The only thing that needs to be done to enable LOV support - define LOV for manager ID attribute in the base VO:


As you see, it is pretty easy to reuse ADF BC LOV's in REST service. Download sample application - ADFBCRestApp_v6.zip.

1 comment:

Anonymous said...

Andrejus,
I'm building a MAF Application and would like to consume REST Services created with ADF BC Rest. Is it possible to create a MAF Data Control with the Rest Service?
Tks