Wednesday, May 7, 2014

Process Definition File Dependency

 In PeopleSoft process scheduler we have setup some Process Definitions with a File Dependency turned on. What this does is Block a process from running until a file is found. This is setup in the Process Definition on the Process Definition Options tab under the On File Creation section.

Well today we updated the Wait for File path. We rescheduled our processes but in the Parameters it still had the old file path. After some head scratching I looked in PeopleBooks where it says this file path can be set at runtime. So I looked and sure enough this value is stored on each Run Control Id. It will only pull from the Process Definition if it is a new Run Control Id or if the filepath is blank.

Here is some SQL to help with this situation

12345
/* Process Sched Parameters */
SELECT prcsinstance,
prcsfilename
FROM psprcsparms
ORDER BY prcsinstance DESC
 
12345
/* Stored at Process Defn Level */
SELECT prcsname,
prcsfilename
FROM ps_prcsdefn
WHERE prcsname LIKE 'TEST123'
 
12345
/* Stored at Run Control Level */
SELECT a.prcsfilename,
a.*
FROM ps_prcsruncntldtl a
WHERE a.prcsname LIKE 'TEST123'
123456789101112
/* Update Run Control to match current Process Definition */
UPDATE ps_prcsruncntldtl a
SET a.prcsfilename = (SELECT c.prcsfilename
FROM ps_prcsdefn c
WHERE a.prcstype = c.prcstype
AND a.prcsname = c.prcsname)
WHERE a.prcstype = 'Application Engine'
AND a.prcsname = 'TEST123'
AND EXISTS (SELECT 'X'
FROM ps_prcsdefn b
WHERE a.prcstype = b.prcstype
AND a.prcsname = b.prcsname)

No comments:

Post a Comment