DBA Data[Home] [Help]

APPS.HR_WORKFLOW_SERVICE SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 32

    select 1
    from   wf_item_attribute_values wiav
    where  wiav.item_type = p_item_type
    and    wiav.item_key  = p_item_key
    and    wiav.name      = p_name;
Line: 109

    SELECT distinct activity_name,activity_display_name
    FROM
     (
     SELECT a.name activity_name,
            a.display_name activity_display_name
     FROM  wf_activities_vl a
          ,wf_item_activity_statuses ias
          ,wf_process_activities pa
     WHERE ias.item_type = p_item_type
       AND ias.item_key = p_item_key
       AND ias.process_activity = p_actid
       AND ias.process_activity = pa.instance_id
       AND pa.activity_name = a.name
       AND pa.activity_item_type = a.item_type
     UNION ALL
     SELECT a.name activity_name,
            a.display_name activity_display_name
     FROM  wf_activities_vl a
          ,wf_item_activity_statuses_h iash
          ,wf_process_activities pa
     WHERE iash.item_type = p_item_type
       AND iash.item_key = p_item_key
       AND iash.process_activity = p_actid
       AND iash.process_activity = pa.instance_id
       AND pa.activity_name = a.name
       AND pa.activity_item_type = a.item_type
     );
Line: 668

    select wiasv.activity_result_code
    from   wf_item_activity_statuses wiasv
    where  wiasv.process_activity = p_actid
    and    wiasv.item_type   = p_item_type
    and    wiasv.item_key    = p_item_key
    order by wiasv.end_date desc;
Line: 675

    /*select wiasv.activity_result_code
    from   wf_item_activity_statuses_v wiasv
    where  wiasv.activity_id = p_actid
    and    wiasv.item_type   = p_item_type
    and    wiasv.item_key    = p_item_key
    order by wiasv.activity_end_date desc;*/
Line: 757

    select wrpv.display_name
    from   wf_runnable_processes_v wrpv
    where  wrpv.item_type    = p_item_type
    and    wrpv.process_name = p_process_name;
Line: 855

  select hr_workflow_item_key_s.nextval
  into   l_item_key
  from   sys.dual;
Line: 1111

    select 1
    from   wf_item_activity_statuses wias
          ,wf_process_activities     wpa1
    where  wpa1.process_item_type     = p_item_type
    and    wpa1.process_name          = g_wf_root_process
    and    wpa1.process_version =
          (select max(wpa2.process_version)
           from   wf_process_activities     wpa2
           where  wpa2.process_item_type     = p_item_type
           and    wpa2.process_name          = g_wf_root_process)
    and    wias.process_activity = wpa1.instance_id
    and    wias.item_type        = p_item_type
    and    wias.item_key         = p_item_key
    and    wias.activity_status  = g_wf_root_process_active;
Line: 1129

    /*select wiasv.activity_id
    from   wf_item_activity_statuses_v  wiasv
    where  wiasv.item_type            = p_item_type
    and    wiasv.item_key             = p_item_key
    and    wiasv.activity_type_code   = g_wf_function
    and    wiasv.activity_status_code = g_wf_activity_notified
    and    exists
          (select 1
           from   wf_activity_attr_values      waav
           where  waav.process_activity_id   = wiasv.activity_id
           and    waav.name in (g_hr_activity_type, g_hr_activity_type_value));*/
Line: 1140

   SELECT process_activity activity_id
   FROM   WF_ITEM_ACTIVITY_STATUSES IAS
   WHERE  ias.item_type          = p_item_type
   and    ias.item_key           = p_item_key
   and    ias.activity_status    = g_wf_activity_notified
   and    exists
          (select 1
           from   wf_activity_attr_values      waav
           where  waav.process_activity_id   = ias.process_activity
           and    waav.name in (g_hr_activity_type, g_hr_activity_type_value));
Line: 1156

    select waav.name
          ,waav.text_value
    from   wf_activity_attr_values     waav
    where  waav.process_activity_id   = c_process_activity_id
    and    waav.name in (g_hr_activity_type, g_hr_activity_type_value);
Line: 1252

    SELECT   /*+ ordered */
             process.item_key
    FROM     wf_process_activities activity,
             wf_item_activity_statuses process,
             wf_item_activity_statuses result,
             wf_item_attribute_values attribute
    WHERE    activity.activity_name      = p_process_name
    AND      activity.activity_item_type = p_item_type
    AND      activity.process_item_type  = p_item_type
    AND      activity.instance_id        = process.process_activity
    AND      process.activity_status     = 'ACTIVE'
    AND      process.item_type           = p_item_type
    AND      process.item_key            = attribute.item_key
    AND      attribute.item_type         = p_item_type
    AND      attribute.name              = 'CURRENT_PERSON_ID'
    AND      attribute.number_value      = p_current_person_id
    and      result.item_type            = p_item_type
    and      result.item_key             = process.item_key
    and      result.activity_result_code = p_activity_result_code;
Line: 1278

    select process.item_key
    from   wf_item_activity_statuses    process
          ,wf_item_attribute_values     attribute
          ,wf_process_activities        activity
    where  activity.activity_name      = p_process_name
    and    activity.process_item_type  = p_item_type
    and    activity.activity_item_type||'' = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.activity_status||''     = 'ACTIVE'
    and    process.item_type           = p_item_type
    and    process.item_key            = attribute.item_key
    and    attribute.item_type         = p_item_type
    and    attribute.name              = 'CURRENT_PERSON_ID'
    and    attribute.number_value      = p_current_person_id;
Line: 1296

    select process.item_key
    from   wf_item_activity_statuses    process
          ,wf_item_attribute_values     attribute
          ,wf_process_activities        activity
          ,wf_item_activity_statuses    result
    where  activity.activity_name      = p_process_name
    and    activity.process_item_type  = p_item_type
    and    activity.activity_item_type = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.activity_status     = 'ACTIVE'
    and    process.item_type           = p_item_type
    and    process.item_key            = attribute.item_key
    and    attribute.item_type         = process.item_type
    and    attribute.name              = 'CURRENT_PERSON_ID'
    and    attribute.number_value      = p_current_person_id
    and    result.item_type            = p_item_type
    and    result.item_key             = process.item_key
    and    result.activity_result_code = p_activity_result_code;
Line: 1316

    /*select process.item_key
    from   wf_item_activity_statuses_v process
    where  process.activity_name  = p_process_name
    and    process.activity_status_code = 'ACTIVE'
    and    process.item_type      = p_item_type
    and    process.item_key in (select attribute.item_key
           from wf_item_attribute_values attribute
           where attribute.item_type    = p_item_type
           and    attribute.name         = 'CURRENT_PERSON_ID'
           and    attribute.number_value = p_current_person_id);*/
Line: 1328

    select 1
    from   hr_api_transaction_steps
    where  item_type      = p_item_type
    and    item_key       = l_active_item_key;
Line: 1334

  select activity.instance_id activity_id
    from wf_process_activities        activity,
         wf_item_activity_statuses    process
    where activity.activity_name      = p_activity_name
    and    activity.process_item_type  = p_item_type
    and    activity.activity_item_type = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.item_type           = p_item_type
    and    process.item_key = l_active_item_key
    and    process.activity_status = 'COMPLETE';
Line: 1345

  /*  select distinct process.activity_id
    from   wf_item_activity_statuses_v process
    where  process.item_type      = p_item_type
    and    process.item_key       = l_active_item_key
    and    process.activity_name  = p_activity_name; */
Line: 1445

    SELECT   /*+ ordered */
             process.item_key
    FROM     wf_process_activities activity,
             wf_item_activity_statuses process,
             wf_item_attribute_values attribute
    WHERE    activity.activity_name      = p_process_name
    AND      activity.activity_item_type = p_item_type
    AND      activity.instance_id        = process.process_activity
    AND      process.activity_status     = 'ACTIVE'
    AND      process.item_type           = p_item_type
    AND      process.item_key            = attribute.item_key
    AND      attribute.item_type         = p_item_type
    AND      attribute.name              = 'CURRENT_PERSON_ID'
    AND      attribute.number_value      = p_current_person_id;
Line: 1466

    select process.item_key
    from   wf_item_attribute_values     attribute,
           wf_process_activities        activity,
           wf_item_activity_statuses    process
    where  activity.activity_name      = p_process_name
--    and    activity.process_item_type  = p_item_type
--    and    activity.activity_item_type||'' = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.activity_status     = 'ACTIVE'
    and    process.item_type           = p_item_type
    and    process.item_key            = attribute.item_key
    and    attribute.item_type         = p_item_type
    and    attribute.name              = 'CURRENT_PERSON_ID'
    and    attribute.number_value      = p_current_person_id;
Line: 1484

    select process.item_key
    from   wf_item_activity_statuses    process
          ,wf_item_attribute_values     attribute
          ,wf_process_activities        activity
    where  activity.activity_name      = p_process_name
    and    activity.process_item_type  = p_item_type
    and    activity.activity_item_type = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.activity_status     = 'ACTIVE'
    and    process.item_type           = p_item_type
    and    process.item_key            = attribute.item_key
    and    attribute.item_type         = p_item_type
    and    attribute.name              = 'CURRENT_PERSON_ID'
    and    attribute.number_value      = p_current_person_id;
Line: 1500

    /*select process.item_key
    from   wf_item_activity_statuses_v process
    where  process.activity_name  = p_process_name
    and    process.activity_status_code = 'ACTIVE'
    and    process.item_type      = p_item_type
    and    process.item_key in (select attribute.item_key
           from wf_item_attribute_values attribute
           where attribute.item_type    = p_item_type
           and    attribute.name         = 'CURRENT_PERSON_ID'
           and    attribute.number_value = p_current_person_id);*/
Line: 1512

    select 1
    from   hr_api_transaction_steps
    where  item_type      = p_item_type
    and    item_key       = l_active_item_key;
Line: 1518

   select activity.instance_id activity_id
    from wf_process_activities        activity,
         wf_item_activity_statuses    process
    where activity.activity_name      = p_activity_name
    and    activity.process_item_type  = p_item_type
    and    activity.activity_item_type = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.item_type           = p_item_type
    and    process.item_key = l_active_item_key
    and    process.activity_status = 'COMPLETE';
Line: 1529

    /*select distinct process.activity_id
    from   wf_item_activity_statuses_v process
    where  process.item_type      = p_item_type
    and    process.item_key       = l_active_item_key
    and    process.activity_name  = p_activity_name; */
Line: 1628

    select process.item_key
    from   wf_item_activity_statuses    process
          ,wf_item_attribute_values     attribute
          ,wf_process_activities        activity
          ,wf_item_activity_statuses    result
    where  activity.activity_name      = p_process_name
    and    activity.process_item_type  = p_item_type
    and    activity.activity_item_type = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.activity_status     = 'ACTIVE'
    and    process.item_type           = p_item_type
    and    process.item_key            = attribute.item_key
    and    attribute.item_type         = process.item_type
    and    attribute.name              = 'CURRENT_PERSON_ID'
    and    attribute.number_value      = p_current_person_id
    and    result.item_type            = process.item_type
    and    result.item_key             = process.item_key
    and    result.activity_result_code = p_result_code;
Line: 1659

    select process.item_key
    from   wf_item_activity_statuses    process
          ,wf_item_attribute_values     attribute
          ,wf_process_activities        activity
    where  activity.activity_name      = p_process_name
    and    activity.process_item_type  = p_item_type
    and    activity.activity_item_type = p_item_type
    and    activity.instance_id        = process.process_activity
    and    process.activity_status     = 'ACTIVE'
    and    process.item_type           = p_item_type
    and    process.item_key            = attribute.item_key
    and    attribute.item_type         = process.item_type
    and    attribute.name              = 'CURRENT_PERSON_ID'
    and    attribute.number_value      = p_current_person_id;
Line: 1683

    select transaction_step_id, activity_id
    from   hr_api_transaction_steps
    where  item_type        = p_item_type
    and    item_key         = csr_p_item_key
    and    upper(api_name)  = csr_p_api_name;
Line: 1707

    select step.transaction_step_id, step.activity_id
    from   hr_api_transaction_steps       step
          ,hr_api_transaction_values      value
    where  item_type        = p_item_type
    and    item_key         = csr_p_item_key
    and    upper(api_name)  = csr_p_api_name
    and    step.transaction_step_id = value.transaction_step_id
    and    value.name = 'P_PRIMARY_FLAG'
    and    value.varchar2_value = csr_p_primary_flag;
Line: 1963

  l_transaction_status_to_delete varchar2(10);
Line: 1965

  l_delete_transaction boolean default false;
Line: 1977

 select wias.item_key
   from wf_item_activity_statuses wias,
        wf_activity_attr_values waav,
        wf_process_activities wpa,
        wf_item_attribute_values wiav
 where wias.item_type = itemtype
   and wias.activity_status = 'NOTIFIED'
   and wpa.instance_id = wias.process_activity
   and wpa.instance_id = waav.process_activity_id
   and waav.name = 'HR_ACTIVITY_TYPE'
   and wiav.item_key = wias.item_key
   and wiav.item_type = wias.item_type
   and wiav.name = 'SESSION_ID'
   and not exists
        (select 1
           from icx_sessions s
          where s.session_id = wiav.number_value
            and s.disabled_flag = 'N');
Line: 1998

  select * from (select a.transaction_id transaction_id,
                           s.text_value status,
                 	   a.item_type item_type,
                           a.item_key  item_key
                    from (select transaction_id,
 		                         status,
                                 nvl(item_type,hr_workflow_service.getItemType(t.transaction_id)) item_type,
                                 nvl(item_key,hr_workflow_service.getItemKey(t.transaction_id)) item_key
                            from hr_api_transactions t
                           where t.last_update_date <= sysdate - c_transaction_age
                           and t.status not in ('Y', 'YS','W')
                           and t.transaction_ref_table <> 'PER_APPRAISALS'
                              ) a, -- bug 3635925 , bug 5357274, bug 5990955
                         wf_item_attribute_values s
                     where a.item_type = itemtype
                     and a.item_type = s.item_type
                     and a.item_key = s.item_key
                     and s.name = 'TRAN_SUBMIT')
     where status = nvl(c_status,status) ;
Line: 2026

SELECT t.item_type, t.item_key, t.transaction_id
FROM hr_api_transactions t, per_appraisals a
WHERE  t.transaction_ref_table = 'PER_APPRAISALS'
AND t.last_update_date <= sysdate - c_transaction_age
AND t.transaction_ref_id = a.appraisal_id
AND a.appraisal_system_status IN ('DELETED','COMPLETED');
Line: 2038

    select hats.transaction_id
      from hr_api_transaction_steps hats
     where hats.item_type = itemtype
       and hats.item_key  = l_item_key;
Line: 2048

 /*  SELECT distinct hats.transaction_id
     FROM hr_api_transaction_steps hats
    WHERE NOT EXISTS (SELECT 'Y'
                        FROM wf_items wi
                       WHERE wi.item_type = hats.item_type
                         AND wi.item_key = hats.item_key);
Line: 2056

SELECT  hat.transaction_id
   FROM hr_api_transactions  hat
   WHERE NOT EXISTS (SELECT 'Y'
                        FROM wf_items wi
                       WHERE wi.item_type = nvl(hat.item_type,hr_workflow_service.getItemType(hat.transaction_id))
                         AND wi.item_key = nvl(hat.item_key,hr_workflow_service.getItemKey(hat.transaction_id))
                             )
AND Not Exists( select 'Y' from wf_items w   --fix for bug 6121860
                where w.item_type = 'HRSFL'
                and w.user_key = hat.transaction_id)
and hat.item_key is not null;
Line: 2082

	     select wi.item_key
                from  wf_items wi , wf_item_attribute_values av, icx_sessions s
                where wi.item_type= itemtype
                and trunc(wi.begin_date) <= trunc(sysdate)  --fix for bug 6642996
                and wi.end_date is null
                and av.item_type = wi.item_type
                and av.item_key = wi.item_key
                and av.name = 'SESSION_ID'
                and av.number_value =  s.session_id(+)
                and s.disabled_flag(+) = 'Y'
                and (
                      (wi.item_key) not in (
                              select t1.item_key
                               from hr_api_transactions t1
                               where wi.item_type = t1.item_type
                               and wi.item_key = t1.item_key
                               and t1.item_type = itemtype
                              )
                       and (wi.item_key) not in (
                               select ts.item_key
                            from hr_api_transaction_steps ts
                               where ts.item_type = wi.item_type
                               and ts.item_key = wi.item_key
                               and ts.item_type = itemtype
                              )
          );
Line: 2110

    select wi.item_key
    from  wf_items wi
    where wi.item_type = itemtype
    and   wi.begin_date <= trunc(sysdate)
    and   wi.end_date is null
    and not exists (select 'e' from hr_api_transactions t
                      where
                            t.item_type is not null
                        and t.item_key is not null
                        and wi.item_type = t.item_type
                        and wi.item_key = t.item_key
                    )
    and not exists (select 'e' from hr_api_transactions t, hr_api_transaction_steps ts
                      where
                          t.item_type is null
                      and t.item_key is null
                      and t.transaction_id = ts.transaction_id
                      and wi.item_type =  ts.item_type
                      and wi.item_key = ts.item_key
                      and ts.item_type is not null
                      and ts.item_key is not null
                    )
    and exists (select 'e' from wf_item_attribute_values av, icx_sessions s
                   where av.item_type = wi.item_type
                   and av.item_key = wi.item_key
                   and av.name = 'SESSION_ID'
                   and av.number_value =  s.session_id(+)
                   and s.disabled_flag(+) = 'Y');
Line: 2142

     select hat.transaction_ref_id,
            hat.assignment_id,
            iof.offer_status
     from hr_api_transactions hat,
          irc_offers iof
     where hat.transaction_ref_table='IRC_OFFERS' and
           hat.transaction_ref_id = iof.offer_id and
           hat.transaction_id = c_transaction_id and
           iof.offer_status in ('PENDING','CORRECTION');
Line: 2154

select wi.item_key
from wf_items wi
where wi.item_type = 'HRSFL'
and not exists (select transaction_id from hr_api_transactions
                where transaction_id  = wi.user_key);
Line: 2172

  l_transaction_status_to_delete := wf_engine.getitemattrText
          (itemtype  => itemtype
          ,itemkey   => itemkey
          ,aname     => 'HR_TRAN_STAT_FOR_DEL_ATTR');
Line: 2185

    if(l_transaction_status_to_delete='ALL') then
       c_status := null;
Line: 2188

        c_status  := l_transaction_status_to_delete;
Line: 2261

              select TEXT_VALUE
               into l_transaction_status
               from WF_ITEM_ATTRIBUTE_VALUES
               where ITEM_TYPE = itemtype
               and ITEM_KEY = rec.item_key
               and NAME = 'TRAN_SUBMIT';
Line: 2272

        l_delete_transaction:= false;
Line: 2275

          l_delete_transaction := false;
Line: 2277

          l_delete_transaction := true;
Line: 2280

        if(l_delete_transaction) then -- delete transaction which explicitly
          -- identified for delete.
          -- First abort the WF process for this transaction record.
          BEGIN -- Block to 'abort' the WF process
            wf_engine.abortprocess(itemtype => itemtype
                                  ,itemkey  => rec.item_key
                                  ,result   => 'eng_force');
Line: 2321

        l_delete_transaction:= false;
Line: 2324

          l_delete_transaction := false;
Line: 2325

        elsif(l_transaction_status_to_delete='ALL') then
          l_delete_transaction := true;
Line: 2327

        elsif (l_transaction_status_to_delete=l_transaction_status) then
          l_delete_transaction := true;
Line: 2333

        if(l_delete_transaction) then -- delete transaction which explicitly
          -- identified for delete.
          -- First abort the WF process for this transaction record.
          BEGIN -- Block to 'abort' the WF process
            wf_engine.abortprocess(itemtype => itemtype
                                  ,itemkey  => rec.item_key
                                  ,result   => 'eng_force');
Line: 2449

  select hr_workflow_item_key_s.nextval
  into   l_item_key
  from   sys.dual;
Line: 2598

        select ts.item_type
        into getItemType.l_item_type
        from hr_api_transaction_steps ts
        where ts.transaction_id=getItemType.p_transaction_id
        and ts.item_type is not null and rownum <=1;
Line: 2610

        select ts.item_key
        into getItemkey.l_item_key
        from hr_api_transaction_steps ts
        where getItemkey.p_transaction_id = ts.transaction_id
        and ts.item_key is not null and rownum <=1;