with( local!pagingInfo: ri!query.pagingInfo, local!queryCondition: index(ri!query, "logicalExpression|filter|search", null), local!requestedId: if( and(index(local!queryCondition, "field", null)="rp!Emp_id", index(local!queryCondition, "operator", null)="="), index(local!queryCondition, "value", null), null ), local!searchTerm: index(local!queryCondition, "searchQuery", null), local!employees: if( not(isnull(local!requestedId)), rule!test_getEmployeeById(local!requestedId,local!pagingInfo), if( not(isnull(local!searchTerm)), rule!test_searchEmployeebyLastname(local!searchTerm,local!pagingInfo), rule!test_getAllEmployees(local!pagingInfo) ) ), local!employees )