Home » Oracle » Oracle Ebuisness Suite » How to submit workflow background process from the backend

How to submit workflow background process from the backend

Workflow is an important part of Oracle Ebiz Applications In this post, we will check out what is Workflow Background Engine, How to run it from Unix, How to run it using SQLPLUS, how to submit workflow background process from the backend

What is Workflow Background Engine

  • The Background Engine is a PLSQL Procedure that checks for and executes any deferred or timed-out activities in the workflow system. The arguments of the procedure at the time invoking the procedure determine what will be executed by the process.
  • If new activities are deferred or timed out after the current Background Engine is started, the procedure will check again for any new activities to execute before terminating. When all matching activities have been completed, the procedure comes to an end.
  • It can be run as a Concurrent program or as a package command on the SQLPLUS command.
  • Let’s check How to run it using SQLPLUS, and how to submit the workflow background process from the backend in coming headings

How to run Workflow Background Process from Unix

There is one SQL script placed in $APPL_TOP which can be used to run it from Unix

$FND_TOP/Admin/Sql/wfbkg.sql

The script will be like

cat workflow_background.sh
sqlplus apps/<apps pass> << EOF
@$FND_TOP/Admin/Sql/wfbkg.sql
exit
EOF

How to run Workflow Background Process from SQL*Plus

We can connect to the “apps” user and fire the below command

BEGIN
wf_engine.background (itemtype=>NULL ,
process_deferred=>TRUE ,
minthreshold=>NULL ,
maxthreshold=>NULL ,
process_timeout=>FALSE ,
process_stuck=>FALSE);
END;
/
Or
exec wf_engine.background;

How to submit workflow background process from backend

Here is the script that can be used for this purpose for scheduling the workflow concurrent Program on 17 Feb 8:20

DECLARE

l_user_name VARCHAR2(240) := 'SYSADMIN';
l_resp_name VARCHAR2(240) := 'System Administrator';

l_user_id       NUMBER;
l_resp_id       NUMBER;
l_resp_appl_id  NUMBER;

l_request_id NUMBER;
BEGIN
-- Apps Initialization
   SELECT    user_id
    INTO l_user_id
   FROM fnd_user
   WHERE user_name =l_user_name;

   SELECT  b.RESPONSIBILITY_ID,b.APPLICATION_ID 
    FROM fnd_responsibility_tl tl, fnd_responsibility b
    WHERE tl.responsibility_name = 'System Administrator'
      AND LANGUAGE=UserEnv('LANG')
      AND tl.RESPONSIBILITY_ID=b.RESPONSIBILITY_ID;

  fnd_global.apps_initialize
    ( user_id => l_user_id
     ,resp_id => l_resp_id
     ,resp_appl_id => l_resp_appl_id
    );
--
l_request_id := FND_request.submit_request(application => 'FND',
                           program     => 'FNDWFBG',   
                           description =>  NULL,
                        start_time  => '2022/02/17 8:20:00',
                        sub_request =>  FALSE,
                           argument1  =>  null, 
                           argument2  =>   null, 
                           argument3  =>  NULL, 
                           argument4  =>   'Y' , 
                           argument5  =>   'N', 
                           argument6  =>   NULL
                           );

                           IF l_request_id> 0 THEN
                            Dbms_Output.put_line(l_request_id);
                            commit;
                           END IF;

END;
?

How to schedule periodic workflow background process concurrent program from backend

Here is the script which can be used for this purpose for scheduling periodic Workflow background process concurrent Program at 16:40 starting at 20 Feb with daily frequency

DECLARE
v_request_id NUMBER;
v_status BOOLEAN;

BEGIN
--Initialize the session with appropriate values
fnd_global.apps_initialize (user_id=>0
,resp_id=>20420
,resp_appl_id=>1);
--Set the Repeat Options
v_status := fnd_request.set_repeat_options ( repeat_interval => 1
, repeat_unit => 'DAYS'
, repeat_type => 'START');
--Submit the Request
v_request_id := FND_request.submit_request(application => 'FND', 
program => 'FNDWFBG',
description => NULL,
start_time => '2022/02/20 16:40:00',
sub_request => FALSE,
argument1 => 'UMX Login Help', 
argument2 => null, 
argument3 => NULL, 
argument4 => 'N' , 
argument5 => 'N', 
argument6 => 'Y' 
);
COMMIT;
IF v_request_id = 0 THEN
DBMS_OUTPUT.put_line('Request not submitted: '|| fnd_message.get);
ELSE
DBMS_OUTPUT.put_line('Request submitted successfully. Request id: ' || v_request_id);
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('Exception: ' || SQLERRM);
END;
/

I hope this will help on what is Workflow Background Engine, How to run Workflow Background Process from Unix, How to run Workflow Background Process using SQLPLUS, and how to submit workflow background process from the backend

See also  how to find the semaphore for the Database instance

Related Articles 

Oracle Concurrent Manager: How an E-Business Suite Concurrent Manager Process Works, Oracle Concurrent Manager, What is internal monitor, What are the service manager and troubleshooting
Concurrent Request Phase and Status: All information about Concurrent Request Phase and Status. The meaning is derived for each combination.
Core files in Oracle Concurrent Manager: This page contains a description of the core file for Oracle Concurrent Manager. Core files can be used to debug various issues in CM
Priority for concurrent Program: This post has a detailed description of changing Priority for Concurrent Program or user or request to solve user critical report running issues
Concurrent Manager Interview questions: Check out 24 Concurrent Manager Interview questions to help you in the EBS interview. This consists of all sorts of questions on the standard manager, service manager
Parallel Concurrent Processing: What is PCP, How to set it up, how to define an internal monitor
ORA-01427:Check out this for the solution on ORA-01427: single-row subquery returns more than one-row error, How to resolve it when it happens with the Concurrent Manager
How to submit a concurrent program from backend : check out How to submit a concurrent program from backend, How to submit with repeat intervals, how to submit for specific date

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top