Wednesday, April 2, 2008

Getting the audit execution id

One of the things I have always wanted was the Audit Execution ID at runtime. To get this value I only had two ways after the process begin: query the audit log or look at the control center (see figure 1). WTF Oracle!


I finally found a way to get this value. There is a global variable I never knew existed called audit_id. Not only that, there is a public function that will give you the parent audit id as well called WB_RT_GET_PARENT_AUDIT_ID
For an example, I have created a process flow with two output parameters and two assignments activities (see figure2).

For the first I bind the first output parameter to the first activity and give it a value of audit_id and set the literal to false (see figure3).. For the second assignment activity, I bonded it to the second output parameter with a value of WB_RT_GET_PARENT_AUDIT_ID(audit_id) and set the literal to false.

figure 3

I then deployed the process flow and executed. Once the process flow had completed, I open the control center and looked the properties of the execution (see figure5). When reviewing the output parameters, you can see the audit id for the assignment activity and the parent’s audit id, which was the process flow’s .

Out of my brain into the anals of blog land,
hope you can find use for this brain drain,
now where is my beer.

No comments: