Monday 25 August 2014

How to run Workflow Background Process concurrent program from Plsql

Below given script you can use to run work flow Background Process from Backend
========================================================================
DECLARE
l_set_interval BOOLEAN := FALSE;
l_init BOOLEAN;
l_ret_status VARCHAR2(30);
l_req_id NUMBER;
l_set_nls BOOLEAN;
l_set_mode BOOLEAN;
l_user_name VARCHAR2(40) := 'SMITH.K';
l_responsibility_key VARCHAR2(240) := 'SYSTEM_ADMINISTRATOR';
l_user_id NUMBER;
l_responsibility_id NUMBER;
l_application_id NUMBER;
--
BEGIN
 l_set_mode := apps.fnd_submit.set_mode (FALSE);
--
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = l_user_name;
--
SELECT application_id, responsibility_id
INTO l_application_id, l_responsibility_id
FROM fnd_responsibility_vl
WHERE responsibility_key = l_responsibility_key;
--
fnd_global.apps_initialize
(user_id => l_user_id,
resp_id=> l_responsibility_id,
resp_appl_id=> l_application_id);
--
DBMS_OUTPUT.put_line ('Initialization successful');
--
BEGIN
l_req_id := fnd_request.submit_request
(application=> 'FND',
 program=> 'FNDWFBG',
start_time=> SYSDATE,
sub_request=> FALSE,
argument1=> NULL,
argument2=> NULL,
argument3=> NULL,
 argument4=> 'Y',
 argument5=> 'Y',
argument6=> NULL );
--
DBMS_OUTPUT.put_line ('Request ID: ' || l_req_id);
--
EXCEPTION

 
WHEN OTHERS THEN
DBMS_OUTPUT.put_line ('Unknown error ' || SQLERRM);
END;
=========================================================================

No comments:

Post a Comment

How to resolve issue for BIP RTF template XML tags showing value as <?ref: 0000xx?>

 How to resolve issue for BIP RTF template XML tags showing value as <?ref: 0000xx?>  Sometime these xml data tags automatically chang...