@RequestMapping(value={"","/"},method=RequestMethod.GET) @ResponseBody public RestWrapper list(@RequestParam(value="page",defaultValue="0") int startPage,@RequestParam(value="size",defaultValue="10") int pageSize,Principal principal){
  RestWrapper restWrapper=null;
  try {
    Integer counter=workflowTypeDAO.totalRecordCount();
    List<WorkflowType> workflowTypes=new ArrayList<WorkflowType>();
    List<com.wipro.ats.bdre.md.dao.jpa.WorkflowType> jpaWorkflowTypes=workflowTypeDAO.list(startPage,pageSize);
    for (    com.wipro.ats.bdre.md.dao.jpa.WorkflowType wfType : jpaWorkflowTypes) {
      WorkflowType workflowType=new WorkflowType();
      workflowType.setWorkflowId(wfType.getWorkflowId());
      workflowType.setWorkflowTypeName(wfType.getWorkflowTypeName());
      workflowType.setCounter(counter);
      workflowTypes.add(workflowType);
    }
    restWrapper=new RestWrapper(workflowTypes,RestWrapper.OK);
    LOGGER.info("All records listed from WorkflowType by User:" + principal.getName());
  }
 catch (  Exception e) {
    LOGGER.error(e);
    restWrapper=new RestWrapper(e.getMessage(),RestWrapper.ERROR);
  }
  return restWrapper;
}

@ RequestMapping ( value = { "" , "/" } , method = RequestMethod . GET ) @ ResponseBody public RestWrapper list ( @ RequestParam ( value = "page" , defaultValue = "0" ) int startPage , @ RequestParam ( value = "size" , defaultValue = "10" ) int pageSize , Principal principal ) { RestWrapper restWrapper = null ; try { Integer counter = workflowTypeDAO . totalRecordCount ( ) ; List < WorkflowType > workflowTypes = new ArrayList < WorkflowType > ( ) ; List < com . wipro . ats . bdre . md . dao . jpa . WorkflowType > jpaWorkflowTypes = workflowTypeDAO . list ( startPage , pageSize ) ; for ( com . wipro . ats . bdre . md . dao . jpa . WorkflowType wfType : jpaWorkflowTypes ) { WorkflowType workflowType = new WorkflowType ( ) ; workflowType . setWorkflowId ( wfType . getWorkflowId ( ) ) ; workflowType . setWorkflowTypeName ( wfType . getWorkflowTypeName ( ) ) ; workflowType . setCounter ( counter ) ; workflowTypes . add ( workflowType ) ; } restWrapper = new RestWrapper ( workflowTypes , RestWrapper . OK ) ; LOGGER . info ( "All records listed from WorkflowType by User:" + principal . getName ( ) ) ; } catch ( Exception e ) { LOGGER . error ( e ) ; restWrapper = new RestWrapper ( e . getMessage ( ) , RestWrapper . ERROR ) ; } return restWrapper ; }
this method calls proc getworkflowtypes and fetches the list of instances of workflowtype .
