How to delete Oracle Workflow Roles and Users



One problem Oracle workflow developers faces is to remove role or delete existing roles. There are two methods to do this. There are two methods to
delete workflow roles and users under it.

First is to purge the Expired Roles ->


BEGIN
    apps.wf_directory.RemoveUsersFromAdHocRole(role_name  => ,
                                                   role_users =>);    
    UPDATE wf_local_roles x
    SET x.expiration_date = (SYSDATE-1)
        ,x.status ='INACTIVE'
    WHERE x.name = ;
    COMMIT;
    wf_purge.AdHocDirectory();
    COMMIT;
END;
/


Second one is more effective ->
BEGIN
   WF_DIRECTORY.SetAdHocRoleExpiration(name>, SYSDATE -1 );
   COMMIT;
   WF_DIRECTORY.SETADHOCROLESTATUS('INACTIVE');
   COMMIT;
   WF_DIRECTORY.deleterole(<role_name> , 'WF_LOCAL_ROLES' , 0);
   COMMIT;
END; 
 

No comments :