AnsweredAssumed Answered

Workflow database query: How do you use If/Then?

Question asked by Shlomo Katz on Apr 2, 2019
Latest reply on Apr 3, 2019 by Mostafa Helmy

Hello

We have a workflow that looks for a new hires manager's OU in to determine the location of the new hire.

The lookup information is in T_MASTER_ENTERPRISE_USERS.

I need to provide "stub" data if the manager cannot be located in the database.

Use Case:

Manager and subordinate are hired on the same day.

Same Joiner rule creates their accounts.

Job(s) fail because the subordinate is looking for the manager, which does not yet exist.

 

I need to find existing information and provide a hard coded location if the manager cannot be located.

This is what I have so far - the biggest challenge right now is providing the hard coded location (assuming this query is working at all)

 

Declare
   m_exst number;
   mgrou varchar2(512);

begin
   select count(*)
   into m_exst
   FROM T_MASTER_ENTERPRISE_USERS
   WHERE USER_ID = ''
   and UNIQUE_ID != '<null>';
   if  m_exst = 0
then
   'CN=AveksaAdmin,OU={subou},DC=Company,DC=org'
else
   SELECT UNIQUE_ID
   into mgrou
FROM T_MASTER_ENTERPRISE_USERS
   WHERE USER_ID = '####'
   and UNIQUE_ID != '<null>';
end if;
end;

Outcomes