DBA Data[Home] [Help]

APPS.HR_TASKFLOW_WORKFLOW SQL Statements

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

Line: 29

  g_root_taskflow_form_sel    varchar2(27) := 'ROOT_TASKFLOW_FORM_SELECTOR';
Line: 51

    select *
    from   wf_process_activities wpa
    where  wpa.instance_id = c_instance_id;
Line: 57

    select wpa.activity_name
    from   wf_process_activities wpa
    where  wpa.process_version =
          (select max(wpa1.process_version)
           from   wf_process_activities wpa1
           where  wpa1.process_name      = wpa.process_name
           and    wpa1.process_item_type = wpa.process_item_type)
    and    wpa.process_item_type  = c_item_type
    and    wpa.activity_name      = nvl(c_process_name, wpa.activity_name)
    and    wpa.process_name       = g_root_activity_name
    order by 1;
Line: 90

    select wat1.display_name     activity_display_name
          ,witt.display_name     item_display_name
          ,wat2.display_name     process_display_name
    from   wf_activities_tl      wat1
          ,wf_activities_tl      wat2
          ,wf_activities         wa1
          ,wf_activities         wa2
          ,wf_item_types_tl      witt
          ,wf_process_activities wpa
    where  wpa.instance_id = p_instance_id
    and    witt.name       = wpa.activity_item_type
    and    witt.language   = g_language
    and    wa1.name        = wpa.activity_name
    and    wa1.item_type   = wpa.activity_item_type
    and    wa1.end_date is null
    and    wat1.item_type   = wa1.item_type
    and    wat1.name        = wa1.name
    and    wat1.version     = wa1.version
    and    wat1.language    = g_language
    and    wa2.name        = wpa.process_name
    and    wa2.item_type   = wpa.process_item_type
    and    wa2.end_date is null
    and    wat2.item_type   = wa2.item_type
    and    wat2.name        = wa2.name
    and    wat2.version     = wa2.version
    and    wat2.language    = g_language;
Line: 192

    select wpa.instance_id
    from   wf_process_activities wpa
    where  wpa.process_version =
         (select max(wpa1.process_version)
          from   wf_process_activities wpa1
          where  wpa1.process_name      = wpa.process_name
          and    wpa1.process_item_type = wpa.process_item_type)
    and    wpa.process_item_type  = p_process_item_type
    and    wpa.activity_name      = p_root_process_name
    and    wpa.process_name       = g_root_activity_name;
Line: 229

    select wpa.instance_id
    from   wf_process_activities wpa
    where  wpa.process_version =
         (select max(wpa1.process_version)
          from   wf_process_activities wpa1
          where  wpa1.process_name      = wpa.process_name
          and    wpa1.process_item_type = wpa.process_item_type)
    and    wpa.process_item_type = p_process_item_type
    and    wpa.process_name      = p_root_process_name
    and    wpa.activity_name     = g_root_taskflow_form_sel;
Line: 242

    select wat.to_process_activity
          ,wat.result_code
    from   wf_activity_transitions wat
    where  wat.result_code <> g_default_transition_value
    and    wat.from_process_activity = c_instance_id;
Line: 394

procedure insert_workflow
  (p_process_name in varchar2) is
--
  cursor l_csr_workflow_id is
    select hw.workflow_id
    from   hr_workflows hw
    where  hw.workflow_name = p_process_name;
Line: 403

    select hnnu.nav_node_usage_id
    from   hr_navigation_node_usages hnnu
    where  hnnu.workflow_id = c_workflow_id;
Line: 407

  l_proc varchar2(72) := g_package||'insert_workflow';
Line: 414

          select nav_path_id
          from hr_navigation_paths hnp
          where hnp.from_nav_node_usage_id = p_nav_id
          or hnp.to_nav_node_usage_id = p_nav_id;
Line: 430

      select hr_workflows_s.nextval
      into   g_workflow_id
      from   sys.dual;
Line: 442

    insert into hr_workflows (workflow_id, workflow_name) values (g_workflow_id, p_process_name);
Line: 443

    g_workflow_process_mode := 'INSERT';
Line: 447

    g_workflow_process_mode := 'UPDATE';
Line: 454

       /*select nav_path_id
      into   l_nav_path_id
      from hr_navigation_paths hnp
      where hnp.from_nav_node_usage_id = csr_csr.nav_node_usage_id
      or    hnp.to_nav_node_usage_id = csr_csr.nav_node_usage_id; */
Line: 463

      delete from hr_navigation_paths_tl hnp
      where       nav_path_id = csr_paths.nav_path_id;
Line: 466

      delete from hr_navigation_paths hnp
      where hnp.from_nav_node_usage_id = csr_csr.nav_node_usage_id
      or    hnp.to_nav_node_usage_id = csr_csr.nav_node_usage_id;
Line: 472

      delete from hr_navigation_paths_tl hnp
      where  nav_path_id = l_nav_path_id;
Line: 475

      delete from hr_navigation_paths hnp
      where hnp.from_nav_node_usage_id = csr_csr.nav_node_usage_id
      or    hnp.to_nav_node_usage_id = csr_csr.nav_node_usage_id;
Line: 479

      delete from hr_navigation_node_usages hnnu
      where hnnu.nav_node_usage_id = csr_csr.nav_node_usage_id;
Line: 486

end insert_workflow;
Line: 490

procedure insert_navigation_paths is
  -- --------------------------------------------------------------------------
  -- |-------------------------< private cursors >----------------------------|
  -- --------------------------------------------------------------------------
  cursor csr_process_start_transitions
    (c_instance_id wf_process_activities.instance_id%type) is
    -- select the START result codes
    select wat.from_process_activity
          ,wat.to_process_activity
          ,wat.result_code
    from   wf_process_activities   wpa1
          ,wf_process_activities   wpa2
          ,wf_activity_transitions wat
    where  wpa1.instance_id       = c_instance_id
    and    wpa2.process_name      = wpa1.activity_name
    and    wpa2.process_item_type = wpa1.activity_item_type
    and    wpa2.start_end         = g_activity_type_start
    and    wpa2.process_version =
           (select max(wpa3.process_version)
            from   wf_process_activities wpa3
            where  wpa3.process_name      = wpa2.process_name
            and    wpa3.process_item_type = wpa2.process_item_type)
    and    wat.from_process_activity = wpa2.instance_id;
Line: 518

    select wat.from_process_activity
          ,wat.to_process_activity
          ,wat.result_code
    from   wf_process_activities   wpa1
          ,wf_process_activities   wpa2
          ,wf_activity_transitions wat
    where  wpa1.instance_id        = c_instance_id
    and    wpa1.start_end          = g_activity_type_end
    and    wpa2.activity_name      = wpa1.process_name
    and    wpa2.activity_item_type = wpa1.process_item_type
    and    wpa2.process_version =
           (select max(wpa3.process_version)
            from   wf_process_activities wpa3
            where  wpa3.process_name      = wpa2.process_name
            and    wpa3.process_item_type = wpa2.process_item_type)
    and    wat.from_process_activity = wpa2.instance_id
    and    wat.result_code           = c_result_code;
Line: 539

    select wat.from_process_activity
          ,wat.to_process_activity
          ,wat.result_code
    from   wf_activity_transitions wat
    where  wat.from_process_activity = c_instance_id;
Line: 548

      select wat.from_process_activity
            ,wat.to_process_activity
            ,wat.result_code
      from   wf_activity_transitions wat
    where  wat.from_process_activity = c_instance_id;
Line: 556

    select wa.type
          ,wpa.start_end
    from   wf_activities wa
          ,wf_process_activities wpa
    where  wpa.instance_id = c_instance_id
    and    wa.item_type = wpa.activity_item_type
    and    wa.name      = wpa.activity_name
    and    wa.end_date is null;
Line: 567

    select L.language_code l_language_code
      from   FND_LANGUAGES L
    where L.INSTALLED_FLAG in ('I', 'B')
    and not exists
    (select NULL
    from HR_NAVIGATION_PATHS_TL T
    where T.NAV_PATH_ID = T_NAV_PATH_ID
    and T.LANGUAGE = L.LANGUAGE_CODE);
Line: 580

  l_proc varchar2(72) := g_package||'insert_navigation_paths';
Line: 596

  type l_insert_path_rec   is record
    (from_nav_node_usage_id hr_navigation_paths.from_nav_node_usage_id%type
    ,to_nav_node_usage_id   hr_navigation_paths.to_nav_node_usage_id%type
    ,nav_button_required    hr_navigation_paths.nav_button_required%type
    ,sequence               hr_navigation_paths.sequence%type
    ,override_label         hr_navigation_paths.override_label%type
    ,result_code            wf_activity_transitions.result_code%type
    ,insert_path            boolean
    );
Line: 615

  type l_insert_path_tab   is table of l_insert_path_rec
                           index by binary_integer;
Line: 622

  l_insert_path_struct     l_insert_path_tab;
Line: 673

      l_result_stack_struct.delete(l_result_stack_struct.last);
Line: 684

    l_result_stack_struct.delete;
Line: 737

    l_visit_list_struct.delete;
Line: 759

    select waav.name
          ,waav.text_value
    from   wf_activity_attr_values waav
    where  waav.process_activity_id = p_from_process_activity
    and    waav.name like 'DISPLAY_BUTTON_'
    and   (waav.text_value = c_form_name
    or     waav.text_value = g_parent_transition);
Line: 825

        for j in l_insert_path_struct.first..l_insert_path_struct.last loop
          if l_insert_path_struct(j).from_nav_node_usage_id =
            l_parent_struct(i).to_nav_node_usage_id and
            l_insert_path_struct(j).to_nav_node_usage_id =
            l_parent_struct(i).from_nav_node_usage_id then
            -- parent does exist
            l_insert_path_struct(l_parent_struct(i).parent_index).sequence
              := l_parent_struct(i).sequence;
Line: 834

              l_insert_path_struct(l_parent_struct(i).parent_index).nav_button_required
                := 'Y';
Line: 838

              l_insert_path_struct(l_parent_struct(i).parent_index).nav_button_required
                := 'N';
Line: 850

  procedure set_insert_path
    (p_from_nav_node_usage_id     in number
    ,p_from_process_activity      in number
    ,p_to_process_activity        in number
    ,p_result_code                in varchar2) is
  --
    l_proc varchar2(72) := g_package||'set_insert_path';
Line: 865

    l_insert_path           boolean;
Line: 873

      l_insert_path := false;
Line: 875

      l_insert_path := true;
Line: 878

    if l_insert_path_struct.count > 0 then
      -- ensure that an entry does not already exist for this form and
      -- result combination. also count the number of navigation paths
      for i in l_insert_path_struct.first..l_insert_path_struct.last loop
        if l_insert_path_struct(i).from_nav_node_usage_id =
          p_from_nav_node_usage_id then
          hr_utility.set_location(l_proc, 15);
Line: 885

          if l_insert_path_struct(i).result_code = p_result_code or
            l_insert_path_struct(i).to_nav_node_usage_id = l_to_nav_node_usage_id then
            -- a serious error has occurred, you cannot have a 'FROM' form activity
            -- have more than one path to the same form.
            -- select the process details that is in error
            get_item_act_display_names
              (p_instance_id            => p_from_process_activity
              ,p_item_type_display_name => g_item_type_display_name
              ,p_activity_display_name  => g_activity_display_name
              ,p_process_display_name   => g_process_display_name);
Line: 913

    l_index := l_insert_path_struct.count + 1;
Line: 927

    l_insert_path_struct(l_index).from_nav_node_usage_id := p_from_nav_node_usage_id;
Line: 928

    l_insert_path_struct(l_index).to_nav_node_usage_id := l_to_nav_node_usage_id;
Line: 929

    l_insert_path_struct(l_index).nav_button_required := l_nav_button_required;
Line: 930

    l_insert_path_struct(l_index).sequence := l_button_sequence;
Line: 931

    l_insert_path_struct(l_index).override_label := l_button_text;
Line: 932

    l_insert_path_struct(l_index).result_code := p_result_code;
Line: 933

    l_insert_path_struct(l_index).insert_path := l_insert_path;
Line: 935

  end set_insert_path;
Line: 1019

  l_parent_struct.delete;
Line: 1052

        set_insert_path
          (p_from_nav_node_usage_id     =>
             g_node_usage_tab(l_usage_index).nav_node_usage_id
          ,p_from_process_activity      =>
             g_node_usage_tab(l_usage_index).instance_id
          ,p_to_process_activity        => l_result_csr.to_process_activity
          ,p_result_code                => l_expected_sqlform);
Line: 1120

            set_insert_path
              (g_node_usage_tab(l_usage_index).nav_node_usage_id
              ,g_node_usage_tab(l_usage_index).instance_id
              ,l_pop_to_process_activity
              ,l_expected_sqlform);
Line: 1221

  if l_insert_path_struct.count > 0 then
    -- insert all the paths
    for i in l_insert_path_struct.first..l_insert_path_struct.last loop
      -- only insert paths where the boolean insert_path is true
      if l_insert_path_struct(i).insert_path then
        insert into hr_navigation_paths
        (nav_path_id
        ,from_nav_node_usage_id
        ,to_nav_node_usage_id
        ,nav_button_required
        ,sequence
        ,override_label)
        values
        (hr_navigation_paths_s.nextval
        ,l_insert_path_struct(i).from_nav_node_usage_id
        ,l_insert_path_struct(i).to_nav_node_usage_id
        ,l_insert_path_struct(i).nav_button_required
        ,l_insert_path_struct(i).sequence
        ,l_insert_path_struct(i).override_label
        );
Line: 1242

  select nav_path_id
  into   l_nav_path_id
  from   hr_navigation_paths
  where  from_nav_node_usage_id = l_insert_path_struct(i).from_nav_node_usage_id
  and    to_nav_node_usage_id = l_insert_path_struct(i).to_nav_node_usage_id;
Line: 1254

    insert into hr_navigation_paths_tl (
        nav_path_id
       ,language
       ,source_lang
       ,override_label)
      select b.nav_path_id
            ,i.l_language_code
            ,userenv('LANG')
            ,b.override_label
      from hr_navigation_paths b
      where not exists
        (select '1'
         from hr_navigation_paths_tl t
         where t.nav_path_id = b.nav_path_id
       and t.language = i.l_language_code);
Line: 1274

    select L.language_code
    into   l_current_language
    from   FND_LANGUAGES L
    where L.INSTALLED_FLAG in ('I', 'B')
    and not exists
    (select NULL
    from HR_NAVIGATION_PATHS_TL T
    where T.NAV_PATH_ID = L_NAV_PATH_ID
    and T.LANGUAGE = L.LANGUAGE_CODE);
Line: 1284

        insert into hr_navigation_paths_tl (
        nav_path_id
       ,language
       ,source_lang
       ,override_label)
      select b.nav_path_id
            ,l_current_language
            ,userenv('LANG')
            ,b.override_label
      from hr_navigation_paths b
      where not exists
        (select '1'
         from hr_navigation_paths_tl t
         where t.nav_path_id = b.nav_path_id
       and t.language = l_current_language);
Line: 1304

end insert_navigation_paths;
Line: 1308

procedure insert_navigation_node_usage
  (p_nav_node_id    in number
  ,p_instance_id    in number
  ,p_sqlform        in varchar2
  ,p_override_label in varchar2) is
--
  l_top_node          varchar2(1) := 'N';
Line: 1316

  l_proc varchar2(72) := g_package||'insert_navigation_node_usage';
Line: 1328

    select hr_navigation_node_usages_s.nextval
    into   l_nav_node_usage_id
    from   sys.dual;
Line: 1340

  insert into hr_navigation_node_usages
    (nav_node_usage_id,
     workflow_id,
     nav_node_id,
     top_node)
  values
    (l_nav_node_usage_id
    ,g_workflow_id
    ,p_nav_node_id
    ,l_top_node);
Line: 1358

end insert_navigation_node_usage;
Line: 1362

procedure insert_navigation_nodes
  (p_process_item_type   in varchar2
  ,p_process_name        in varchar2) is
--
  cursor l_csr_processes(c_instance_id wf_process_activities.instance_id%type) is
    select wpa1.instance_id
    from   wf_activities         wa
          ,wf_process_activities wpa1
          ,wf_process_activities wpa2
    where  wpa2.instance_id       = c_instance_id
    and    wpa1.process_name      = wpa2.activity_name
    and    wpa1.process_item_type = wpa2.activity_item_type
    and    wpa1.process_version   =
          (select max(wpa3.process_version)
           from   wf_process_activities wpa3
           where  wpa3.process_name = wpa1.process_name
           and    wpa3.process_item_type = wpa1.process_item_type)
    and    wa.name                = wpa1.activity_name
    and    wa.item_type           = wpa1.activity_item_type
    and    wa.type                = g_activity_type_process
    and    wa.end_date is null;
Line: 1386

    select wpa1.instance_id
    from   wf_activities           wa
          ,wf_process_activities   wpa1
          ,wf_process_activities   wpa2
          ,wf_activity_attr_values waav
          ,wf_activity_attributes  waa
    where  wpa2.instance_id         = c_instance_id
    and    wpa1.process_name        = wpa2.activity_name
    and    wpa1.process_item_type   = wpa2.activity_item_type
    and    wpa1.process_version   =
          (select max(wpa3.process_version)
           from   wf_process_activities wpa3
           where  wpa3.process_name = wpa1.process_name
           and    wpa3.process_item_type = wpa1.process_item_type)
    and    wa.name                  = wpa1.activity_name
    and    wa.item_type             = wpa1.activity_item_type
    and    wa.type                  = g_activity_type_function
    and    wa.end_date is null
    and    waav.process_activity_id = wpa1.instance_id
    and    waav.name                = waa.name
    and    waav.text_value          = g_hrms_sqlform
    and    waa.activity_item_type   = wa.item_type
    and    waa.activity_name        = wa.name
    and    waa.activity_version     = wa.version
    and    waa.name                 = g_taskflow_activity_type;
Line: 1414

    select waa.name
          ,waav.text_value
    from   wf_activities           wa
          ,wf_process_activities   wpa1
          ,wf_activity_attr_values waav
          ,wf_activity_attributes  waa
    where  wpa1.instance_id         = c_instance_id
    and    wa.name                  = wpa1.activity_name
    and    wa.item_type             = wpa1.activity_item_type
    and    wa.type                  = g_activity_type_function
    and    wa.end_date is null
    and    waav.process_activity_id = wpa1.instance_id
    and    waav.name                = waa.name
    and    waav.name in ('TASKFLOW_ACTIVITY_NAME'
                        ,'CUSTOMIZATION_NAME'
                        ,'BUTTON_TEXT'
                        ,'HRMS_FORM_BLOCK_NAME')
    and    waa.activity_item_type   = wa.item_type
    and    waa.activity_name        = wa.name
    and    waa.activity_version     = wa.version
    and    exists
          (select 1
           from   wf_activity_attr_values waav1
           where  waav1.name       = g_taskflow_activity_type
           and    waav1.text_value = g_hrms_sqlform
           and    waav1.process_activity_id = waav.process_activity_id);
Line: 1442

    select hnu.nav_unit_id
          ,hnul.default_label
    from   hr_navigation_units hnu,
           hr_navigation_units_tl hnul
    where  hnu.form_name = c_form_name
    and    nvl(hnu.block_name, hr_api.g_varchar2) = nvl(c_block_name, hr_api.g_varchar2)
    and    hnu.nav_unit_id = hnul.nav_unit_id
    and    hnul.language=userenv('LANG');
Line: 1452

    select pcr.customized_restriction_id
    from   pay_customized_restrictions pcr
    where  pcr.form_name = c_form_name
    and    pcr.enabled_flag = 'Y'
    and    nvl(pcr.business_group_id, nvl(g_business_group_id, hr_api.g_number)) =
           nvl(g_business_group_id, hr_api.g_number)
    and    nvl(pcr.legislation_code, nvl(g_legislation_code, hr_api.g_varchar2)) =
           nvl(g_legislation_code, hr_api.g_varchar2)
    and    nvl(pcr.legislation_subgroup, nvl(g_legislation_subgroup, hr_api.g_varchar2)) =
           nvl(g_legislation_subgroup, hr_api.g_varchar2)
    and    pcr.application_id between 800 and 899
    and    pcr.name = c_customization_name;
Line: 1466

    select hnn.nav_node_id
          ,hnn.name
    from   hr_navigation_nodes hnn
    where  hnn.nav_unit_id = c_nav_unit_id
    and    nvl(hnn.customized_restriction_id, hr_api.g_number) =
           nvl(c_customized_restriction_id, hr_api.g_number);
Line: 1482

  l_proc                  varchar2(72) := g_package||'insert_navigation_nodes';
Line: 1528

  l_process_stack_struct.delete; -- clear the process stack
Line: 1535

    l_process_stack_struct.delete(l_process_stack_struct.last);
Line: 1641

          select hr_navigation_nodes_s.nextval
          into   l_nextval
          from   sys.dual;
Line: 1654

        insert into hr_navigation_nodes
          (nav_node_id,
           nav_unit_id,
           name,
           customized_restriction_id)
        values
          (l_nextval
          ,l_nav_unit_id
          ,l_navigation_node_name
          ,l_customized_restriction_id);
Line: 1667

      insert_navigation_node_usage
        (p_nav_node_id    => l_nav_node_id
        ,p_instance_id    => l_csr_tf_function_activities.instance_id
        ,p_sqlform        => l_taskflow_actvity_name
        ,p_override_label => nvl(l_override_label, l_default_label));
Line: 1675

end insert_navigation_nodes;
Line: 1700

    select userenv('LANG')
    into   g_language
    from   sys.dual;
Line: 1723

    g_node_usage_tab.delete;
Line: 1735

    insert_workflow
      (p_process_name => l_csr_root.activity_name);
Line: 1739

    insert_navigation_nodes
      (p_process_item_type => l_item_type
      ,p_process_name      => l_csr_root.activity_name);
Line: 1744

    insert_navigation_paths;
Line: 1769

    select 1
    from   wf_process_activities   wpa
          ,wf_activity_attr_values waav
    where  wpa.instance_id          = actid
    and    waav.process_activity_id = wpa.instance_id
    and    waav.name                = g_taskflow_activity_type
    and    waav.text_value          = g_hrms_sqlform;