Wednesday, September 10, 2014

FAQ on Workflow

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

  • Navigate > Sysadmin > Request > Run
    • Item Type – Select the appropriate Item Type (say PO Approval)
    • Min and Max thershould – (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

  • SQL> EXEC WF_ENGINE.BACKGROUND

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 forward 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..

7.How to retry multiple errored workflow processes?
It can be done from Oracle Application Manager available in System administrator responsibility.

8.How do you define start and end functions in workflow? How does they differ from normal functions?
Using the standard functions available in WFSTD Item type we define start and end functions. They are standard to which we don't need to link any PL/SQL function and return any value to it.

9.Give me some workflow tables?
WF_ITEM_TYPES, WF_ACTIVITIES, WF_NOTIFICATIONS, WF_MESSAGES, WF_COMMENTS, WF_ROLES, WF_ATTRIBUTES e.t.c

10.What is the difference between a function and notification in workflow?
Function is used perform some PL/SQL operation and finally received input from PL/SQL procedure or function. It can not send emails to users. where are Notification can be used to send email notification to users and also perform PL/SQL operations.

11.I have sent two different notifications to two different users and I want to wait till both they are approved to send 3rd notification. How can you achieve it?
use AND function from WFSTD item type to achieve this requirement.

12.What is item type and item key in workflow?
Item Type is the boss in hierarchy or workflow components. Item type holds all sub components like functions, notifications, lookups, messages, attributes, events e.t.c Item Key is unique key which need to be provided for itemtype while running an instance or workflow. Combination of itemtype,itemkey should be always unique.

13.What are roles in workflow and how they are used?
Roles are similar to email distribution lists. Roles holds group of users to send email.

14.How do you download or upload a workflow from a server?
We can do in two ways

  • From command prompt using WFLOAD
  • Open workflow in standalone builder and then do save as and select database.

15.What does the Account Generator process do?
The Account Generator process builds charge, budget, accrual, and variance accounts for each purchase order, release, and requisition distribution based on the distribution’s destination type. It is a synchronous Workflow process.

16.What are the Pre-requisites to use Account Generator?
Before using the Account Generator you must:
- Define your Accounting flexfield structure for each set of books.
- Define flexfield segment values and validation rules.
- Set up Oracle Workflow.
- Decide whether you want to use the Account Generator processes as seeded in Oracle Purchasing, or you need to customize them to meet your accounting needs

17.How do I save my workflow definition to the database?
There are three options to use when saving your workflow definition to the database:

  • Option #1
    • If you have the file open in workflow builder select File -> SaveAs -> Database. Enter the apps username and password and provide the connection string (from the tnsnames.ora in the %ORACLE_HOME%\network\admin directory).
  • Option #2
    • The WFLOAD utility is used for loading and extracting workflow definition files to and from the database.
    • Command Line Syntax:
      • WFLOAD   <apps/password>  0 Y {UPLOAD | UPGRADE | FORCE} wf_file.wft
  • Option #3
    • Run the concurrent program, Workflow Definitions Loader. The system administrator will need to add this concurrent program to a request security group for the responsibility that you want to run this program from.

18.How do I trace errors in my Workflow processes?

  • If a customized workflow process errors you should check the error stack (using the Workflow Monitor and/or wfstatus.sql script), if the procedure in error does NOT begin with WF_.. OR _… then you need to debug your own pl/sql procedures.
  • If standards in the Workflow Guide for exception handling have not been followed, you can still tell whether the problem is with your code, because Oracle Workflow traps external exceptions and reports these as
    • Activity Status: ERROR
    • Activity Result: #EXCEPTION

This is what would show up in the workflow monitor or any status report or form inquiry for the failing activity.

19.How do I customize the Account Generator Workflow process for my company?
Customers are expected to customize the Account Generator process. You can do this by editing the existing process or creating your own process, but this MUST be within the seeded ‘Item Type’. You should NOT create a NEW ‘Item Type’ as this would NEVER be run by Account Generator.
If you create a new process, you must ensure it is “Runnable.”
You must then assign the appropriate process to the Accounting Flexfield structure in the Account Generator Process window in Oracle Applications (login as System Administrator, Application -> Flexfields -> Key -> Accounts and query up the required Accounting flexfield structure).

20. 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.

21. 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.

22. 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.

23. 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.

24. 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.

25. 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.

26. 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.

27. 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.

28. 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 up to 4000 bytes and not characters. Please note that multibyte character can take more than 1 byte.

No comments:

Post a Comment