/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

CREATE OR REPLACE VIEW xxas_roles_v
AS
select b.name,
    -- c.category_lookup_code,
       name role_id,
       b.display_name,
       b.display_name "line1",
       'flexible' "type" ,
       fnd_global.employee_id person_id,
       b.description,
       'view-role/'||name "pageId",
       'modal' "target"
from wf_roles b
where b.NAME like 'UMX%XXAS%' OR b.NAME like 'UMX%'||fnd_profile.value('XXAS_CUSTOM_META_PREFIX') ||'%' and b.owner_tag in ('XXAS','PER')
order by display_name;


BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'XXAS_ROLES_V'
   ,p_description            => 'Applaud Roles');
END;
/
COMMIT;
EXIT;