Friday, May 27, 2011

Concurrent Phase and Status Codes

Return codes (OUT parameters) from FND_CONCURRENT.WAIT_FOR_REQUEST

Phase Codes


Value  Meaning
 C  Completed
 I  Inactive
 P  Pending
 R  Running

Status Codes


Value    Meaning
 D      Cancelled
 U  Disabled
 E  Error
 M  No Manager
 R  Normal
 I  Normal
 C  Normal
 H  On Hold
 W  Paused
 B  Resuming
 P  Scheduled
 Q  Standby
 S  Suspended
 X  Terminated
 T  Terminating
 A  Waiting
 Z  Waiting
 G  Warning

Phase Status Description
PENDING Normal Request is waiting for the next available manager.
PENDING Standby Program to run request is incompatible with other program(s) currently running.
PENDING Scheduled Request is scheduled to start at a future time or date.
PENDING Waiting A child request is waiting for its Parent request to mark it ready to run. For example, a request in a request set that runs sequentially must wait for a prior request to complete.
RUNNING Normal Request is running normally.
RUNNING Paused Parent request pauses for all its child requests to finish running. For example, a request set pauses for all requests in the set to complete.
RUNNING Resuming All requests submitted by the same parent request have completed running. The Parent request resumes running.
RUNNING Terminating Request is terminated by choosing the Cancel Request button in Requests window.
COMPLETED Normal Request completed successfully.
COMPLETED Error Request failed to complete successfully.
COMPLETED Warning Request completed with warnings. For example, a request is generated successfully but fails to print.
COMPLETED Cancelled Pending or Inactive request is cancelled by choosing the Cancel Request button in the Requests window.
COMPLETED Terminated Request is terminated by choosing the Cancel Request button in the Requests window.
INACTIVE Disabled Program to run request is not enabled. Contact your system administrator.
INACTIVE On Hold Pending request is placed on hold by choosing the Hold Request button in the Requests window.
INACTIVE No Manager No manager is defined to run the request. Check with your system administrator. A status of No Manager is also given when all managers are locked by run-alone requests.

Thursday, May 26, 2011

Programmatic Request Submission (FND_REQUEST.SUBMIT_REQUEST)



used when you need to issue a request within a PL/SQL block (normally from a parent request; parameters doesn’t include the errbuf and retcode). Oracle Apps will automatically assign a concurrent manager for this request. Once successful the function will return the request ID, otherwise it will return 0.

arguments (from source code)

application    - Short name of application under which the program is registered
program        - concurrent program name for which the request has to be submitted (short name)
description    - (optional) Will be displayed along with user concurrent program name
start_time    - (optional) Time at which the request has to start running
sub_request    - (optional) Set to TRUE if the request is submitted from another running request and has to be treated as a sub request. Default is FALSE
argument1..100    - (optional) Arguments for the concurrent request

After calling FND_REQUEST.SUBMIT_REQUEST, in case you want to wait for the sub request to be completed before proceeding with the rest of the PLSQL codes, you'll need to issue a COMMIT command and call FND_CONCURRENT.WAIT_FOR_REQUEST. Issuing COMMIT is required because during the process of submit request, records related to the request are inserted into relevant tables, which only becomes visible to the concurrent manager after the COMMIT. Otherwise, the concurrent manager will not be able to see the request and will not run it at all - which in effect FND_CONCURRENT.WAIT_FOR_REQUEST will keep on waiting for an nonexistent request and enter an endless loop.

arguments (from source code)

(IN) request_id    - Request ID to wait on
(IN) interval    - time between checks. Number of seconds to sleep (default 60 seconds)
(IN) max_wait    - Max amount of time to wait (in seconds) for request's completion
(OUT) phase         - Request phase (from meaning in fnd_lookups)
(OUT) status        - Request status(for display purposes)
(OUT) dev_phase    - Request phase as a constant string so that it can be used for comparisons
(OUT) dev_status    - Request status as a constatnt string
(OUT) message        - Completion message if request has completed

For instances you want to submit a request from OAF, you can utilize the oracle.apps.fnd.cp.request.ConcurrentRequest class and call its submitRequest method. It completely mirrors FND_REQUEST.SUBMIT_REQUEST arguments, the only thing is that you need to store the parameters inside a Vector (considering the PLSQL defaults the arguments to VARCHAR type, we could safely assume that the parameter Vector should contain String objects)

method signature

public int submitRequest(String ProgramApplication ,
                                      String ProgramName ,
                                      String ProgramDescription ,
                                      String StartTime,
                                      boolean SubRequest,
                                      Vector Parameters) throws RequestSubmissionException

(source)

Friday, May 20, 2011

ERRBUFF and RETCODE

hese are required parameters when you want to call a PLSQL procedure from Oracle Apps.

ERRBUF
varchar that holds error messages (I haven't tested this yet, but theoretically inside the program you must assign the error message string to this variable - being an IN OUT enables you modify this variable)

RETCODE
0 - success
1 - success with warnings
2 - with errors

Tuesday, May 17, 2011

Oracle Apps Concurrent Programs / Executable Table

Use this query (or parts of it) if you want to look for details regarding you concurrent programs. I find it tedious to use Oracle Apps interface =w=;;

Monday, May 16, 2011

Single Bundled Exception

Used when a page has multiple fields that needs to be validated at once. OAF allows Exceptions to be “bundled” inside a List object which will enable you display multiple error messages once you call the OAException.raiseBundledOAException(List) method.


(note: in this example, OAException messages are defined explicitly within the code. However normally you need to define the messages in Oracle Apps and call the message names instead)