This discussion is archived
5 Replies Latest reply: May 18, 2012 12:20 PM by sreese RSS

Run Child Concurrent Program from Main Concurrent Program

934835 Newbie
Currently Being Moderated
Hi,

I'm trying to run Child Concurrent Program from the Main Concurrent Program as below, could you suggest me on below.

Database:10g

Main_Concurrent_Program
=================

1) Will update staging table XXID_PO_ITM with Batch_id = 1,2,3,4,5
This staging table has 1000 rows, so every 200 rows will be updated with one of the above batch_id
This logic is working.

Child_Concurrent_Program
================
2) Above Main Concurrent Program should call below Child_Concurrent_Program.
This Child_Concurrent_Program will have parameter batch_id (based on above batch_id)

So, this Child_Concurrent_Program should kick off with batch_id = 1
Simillarly, Child_Concurrent_Program should kick off with batch_id = 2
Child_Concurrent_Program should kick off with batch_id = 3
Child_Concurrent_Program should kick off with batch_id = 4
Child_Concurrent_Program should kick off with batch_id = 5



Could you give me some suggestions on this?

Thanks.
  • 1. Re: Run Child Concurrent Program from Main Concurrent Program
    rp0428 Guru
    Currently Being Moderated
    >
    I'm trying to run Child Concurrent Program from the Main Concurrent Program
    >
    Create a procedure to run the child program and used BATCH_ID as the parameter.

    Create five DBMS_JOBs or use DBMS_SCHEDULER: one for each of the 5 concurrent programs you want to execute. Each job executes the same child procedure but passes a different BATCH_ID.

    After the parent runs, commit the records and then execute the 5 DBMS_JOBS and they will run in parallel; each job doing one batch based on the batch_id that is passed.
  • 2. Re: Run Child Concurrent Program from Main Concurrent Program
    sreese Explorer
    Currently Being Moderated
    If you're talking about a backend API to kick off the master and child for Oracle Apps, you'd need to use FND_REQUEST.SUBMIT_REQUEST. There are also other procedures which allow you to set a master/child relationship withing FND_REQUEST or FND_SUBMIT. Look into both of those packages for configuration options.
  • 3. Re: Run Child Concurrent Program from Main Concurrent Program
    934835 Newbie
    Currently Being Moderated
    Thanks sreese.

    Do you have any sample code.
  • 4. Re: Run Child Concurrent Program from Main Concurrent Program
    Sandeep Gandhi, Consultant Guru
    Currently Being Moderated
    See http://bit.ly/JLCT3t
  • 5. Re: Run Child Concurrent Program from Main Concurrent Program
    sreese Explorer
    Currently Being Moderated
    Check with FND_SUBMIT for submitting a concurrent job using child dependecies. Keep in mind, that once you call the API ... it spawns it's own thread and and becomes an autonomous process. Control is no longer maintained within the calling package.



    procedure submit_interface_data(p_schedule_date in date,p_mm_header_id in number,p_req_id out number)
    is
      v_user_id            number;
      v_application_id     number;
      v_responsibility_id  number;
    begin
                select user_id
                into   v_user_id
                from   fnd_user
                where  user_name = 'USER123';
    
                select application_id,
                       responsibility_id
                into   v_application_id,
                       v_responsibility_id
                from   fnd_responsibility_tl
                where  responsibility_name = 'General Warehouse';
    
      fnd_global.apps_initialize(v_user_id,v_responsibility_id,v_application_id);
      p_req_id := fnd_request.submit_request ( application => 'XYZ',
                           program     => 'MOVE_CONC_SHORT_NAME',
                           description => null,
                           start_time  => p_schedule_date,
                           sub_request => false,
                     argument1   => p_mm_header_id);
    
      commit;
    exception
     when others
       then
         spl_log_pub.write_exception(transaction_id   => null,
                                     transaction_type => null,
                                     error_message    => '<some error message>' ||
                                     'sqlcode: ' || sqlcode ||
                                     'sqlerrm: ' || sqlerrm);
    end submit_interface_data;
    Edited by: sreese on May 18, 2012 3:16 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points