I have encountered the below error in AME Position hierarchy.
I have checked completely the Position Hierarchy was fine and User, Person was valid. Then on searching I came to know that I have changed something.
Change I did previously
Previously for a user the notification was not coming so checking the wf_roles table the position was present however on checking wf_user_roles table the user was not there. So I have inactivated and deleted the role using below code
DECLARE
lc_role_name apps.wf_roles.name%TYPE := ‘POS:2115549’;
BEGIN
wf_directory.setadhocroleexpiration(lc_role_name, sysdate -1 );
COMMIT;
wf_directory.setadhocrolestatus( lc_role_name, ‘INACTIVE’);
COMMIT;
wf_directory.deleterole(lc_role_name , ‘WF_LOCAL_ROLES’ , 0);
COMMIT;
END;
UPDATE wf_local_roles x
SET x.expiration_date = (SYSDATE-1)
,x.status =’INACTIVE’
WHERE x.name = ‘POS:2115549’;
COMMIT;
begin
wf_purge.AdHocDirectory();
end;
Solution:
As I have removed the wf role for the position it gives error in the AME so we have to recreate the position with updated user in wf_role table.
The Concurrent Program Synchronize WF LOCAL tables which will be in System Administrator Responsibility will recreate the position in wf_roles.
After running the concurrent program the position and users will be updated on wf_roles and wf_user_roles table.