FAQ on Oracle Workflow Background Engine

1. What is Workflow Background Engine?

2. How the Background Engine is called?

3. How to Run the Background Engine from Oracle Applications?

4. How to Run the Background Engine from SQL*Plus?

5. Why to run the Background Engine?

6. Is it necessary to schedule the Background Engine?


1. What is Workflow Background Engine?

The Background Engine is a PL/SQL procedure. The Background Engine checks for and executes any deferred or timed out activities that satisfy the arguments of the procedure at the time the procedure is invoked. If new activities are deferred or timed out after the initiation of the current Background Engine, the procedure will check one more time for any new activities to execute prior to ending. The procedure ends once all matching activities are executed.

 2. How the Background Engine is called?

Following is the Background Engine API which takes the mentioned parameters. WF_ENGINE.BACKGROUND( itemtype        in varchar2,

minthreshold    in number default null,

maxthreshold    in number default null,

process_deferred    in boolean default TRUE,

process_timeout    in boolean default TRUE)


3. How to Run the Background Engine from Oracle Applications?

Submit the Workflow Background Process Concurrent Program through

Navigate > Sysadmin > Request > Run

Item Type – Select the appropriate Item Type (say PO Approval)

Min and Max tershould – (specify 0 to 100 or you can leave it blank)

Defered = Yes (so that all defered activities are processed)

Timed out=Yes (so that all timedout activities are processed)


4. How to Run the Background Engine from SQL*Plus?

From SQL Prompt run the following command


or from unix prompt

$ $FND_TOP/Admin/Sql/wfbkg.sql


5. Why run the Background Engine?

WF Engine does not handle all the activities. For the reasons like Timed Out, Defered or sometimes errored activities will be forwared to Workflow Background Engine. If that time the Workflow Background is not running then these process will be stuck in process only. Unless you start the Background these will not be processed. Even if you start the background engine with Defered = No and Timedout = No then also these will not be processed.

 6. Is it necessary to schedule the Background Engine?

In continuation to the above answer to to the Question 5, Workflow Background Engine will process the activities only which are forwarded by the Workflow Engine for reasons like timed out, defered etc. Once these activities are processed, the Workflow Background Engine goes down. You need to start the Workflow Background Engine again for any new activities which are forwarded. Therefore, it is usually recommended to schedule the Workflow Background Engine periodically especially for the Item Types such as PO Approval etc..

Oracle Application Workflows FAQ

1. I do not wish to have “Notification Detail.html” attachment in my email notifications. How can I avoid?

Set the Email preference to HTML mail. It will send notifications as HTML-formatted e-mail only, without any standard attachments. However users must read their e-mail using an HTML e-mail client. If there are custom attachments defined for individual notifications in a process, those attachments will be included.

 2. What is the impact of reducing “Processor Min Loop Sleep” for agent listeners or components for type “Workflow Agent Listener”?

This parameter carries minimum amount of time in seconds the processing thread(s) will sleep when nothing has been read. Thread only sleeps when it does not process anything in last iteration. If there is steady stream of messages, sleep should not matter. If there are bursts of messages with no activity in between, this parameter will only affect how soon agent listener reacts to and process new messages. So, if reaction time needs to be improved, sleep can be reduced but note, it will also cause more polling and in absence of activity it may not be worth it.

 3. How to remove Action History region from notifications in Applications 11.5.10?

Define the special message attribute #HISTORY with a null value to suppress the action history for a notification. Please see Oracle Workflow Developer’s Guide for more information.

 4. Why does the Email notification shows red cross mark in the place of GIF image?

Oracle Workflow Java mailer will attempt to resolve image references in notifications only if the notification contains a framework region. The source URL for the image needs to be accessible from the recipient’s client. When the image is behind a firewall, than the email client may not have access to it. Image can also be attached to an email if the ATTACH_IMAGES mailer configuration parameter is enabled.

 5. When a contact is created for the customer, a role is getting created for the contact with notification preference as ‘QUERY’. Hence the mailer is not sending email notification to this contact. How the notification preference can be defaulted to ‘MAILHTML’ or ‘MAILTEXT’ for these roles?

If the role is being created using the wf_directory.createAdhocUser API, It is possible to set the notification preference in the API call, otherwise the default notification preference would be used. The default notification preference is controlled in the “Workflow Administrator Web Applications” responsibility. There is an “Administration” link. On that page you will find the default notification preference setting.

 6. Why the summary email notifications are not closed automatically even after enabling the Autoclose FYI mailer parameter?

This is expected behavior. Enabling Autoclose FYI is applicable only to notifications that are being emailed individually to the users with Notification Preference MAILHTML, MAILTEXT, MAILATTH or MAILHTM2 but not with SUMMARY or SUMHTML. However, since the summary notifications contain only the subject headers for the individual notifications, they have to be reviewed/actioned before closing the notification.

 7. For some records, WF_NOTIFICATION_OUT table shows the message state 3, which means such messages are expired. Should I rebuild the queue to bring these messages back to normal state?

Some messages could expire and move to exception queue after certain retries.

Following select statement can be executed to check the retry count and message status.

Select corr_id, msg_state, retry_count, count(msg_id) from applsys.aq$wf_notification_out group by corr_id, msg_state, retry_count;

Instead of rebuilding the queue, use the concurrent program “Move messages from Exception to Normal Queue of Workflow Agent” to move messages from exception queue to normal queue for agent WF_NOTIFICATION_OUT.

 8. How to stop sending out the “Cancel” emails when notification time out occurs in standalone workflow 2.6.4?

It is not possible at standalone workflow 2.6.4 code level.

Note: For Embedded workflow, the WF: Mailer Cancellation Email profile option has been obsoleted in 11i.ATG_PF.H Rollup 3 patchset level as this feature has been replaced by the Send E-mails For Canceled Notifications (SEND_CANCELED_EMAIL) mailer parameter.

 9. A message attribute of type ‘Text’ and source ‘Respond’ has been created for a response required approval notification to allow approvers to enter any comments. So, what is the maximum length of text can approver enter as comments?

Maximum length of a Text attribute is 4000 bytes. It is stored within a VARCHAR2 column and thus it can be upto 4000 bytes and not characters. Please note that multibyte character can take more than 1 byte.

Oracle Applications – development, customization, extension

Oracle Supported way to include business needs without creating real customization

When developing with the Oracle eBusiness Suite, there are situations where Developers can use “hooks” in standard Applications code to insert or redirect to custom code. Oracle Applications provide some helpful layers of abstraction to make life easier for customization. Where possible it is nice for this to be done using a supported method. If a true blue customization is required, then its best to try to preserve the existing code so that any future upgrades are more likely to break your custom code by reverting to standard code, plus if you use a “hook” to independent code it is easier to maintain and upgrade the custom code. I regularly use a “copy and modify” approach to Apps Development where I use hooks to call the new code.

Concurrent Program Executable. Where an concurrent program is automagically submitted from a form or another concurrent process, e.g. “Print Pack Slip” in Oracle Shipping actions, as long as parameter requirements are the same, then a quick an easy method to code your own report is: Create a new executable registered under your custom application, e.g. XMODS_WSHRDPAK, Query the called concurrent program and update the executable to your custom executable, e.g. Query WSHRDPAK and replace executable with XMODS_WSHRDPAK

Personalization – Forms and Framework (OAF) plus CUSTOM.pll. Forms PL/SQL Library. Personalization has provided functionality to cover alot of the customizations traditionally coded to CUSTOM.pll, but both Personalization and CUSTOM.pll provide a number of hooks into the front end logic.

Database Triggers. Triggers on tables used carefully can provide hooks where all other methods don’t dare to tread. Of course watch out for the exception and try to avoid putting triggers on fnd_concurrent_requests!

Menu. Provides a prominent method to call new Forms, while potentially hiding behind the same prompt, Reports, Discoverer Workbooks, external links/URLs, etc. Gives the ability to save in the “Favourites” list. If you need to customize a standard form, copy it and create a new menu entry where possible.

Unix Softlink. An alternative to the concurrent program executable hook. Backup an existing standard Oracle file. Remove the existing standard Oracle file. Replace with a softlink to a file under you custom application code “top” directory

Workflow. Workflow customizations are “allowed” and a method I use here is to take a standard function call in workflow, copy and modify the underlying package, then change the function call in workflow to the custom function. E.g. AP Remittance Advice workflow (APPEWF) has “Get Check Info” function calling AP_PAYMENT_EVENT_WF_PKG.get_check_info. Copy AP_PAYMENT_EVENT_WF_PKG to XMODS_AP_PAYMENT_EVENT_WF_PKG and change function in workflow function “Get Check Info”

Printer Driver. Whenever concurrent request file post processing is required, e.g. to FTP or email a file – printer drivers provide an excellent way to perform post processing. Create a new printer driver with the appropriate command. Remember to restart the concurrent manager to pickup updates to print drivers.

Business Events. Not a widely used mechanism, but provides supported hooks into key events such as Payment Confirmations (AP Payment event).

Thanks – Shivmohan Purohit