Embed
Email

EDU23B1Y

Document Sample

Shared by: Aashish Sharma
Categories
Tags
Stats
views:
12
posted:
8/29/2009
language:
English
pages:
13
Selector/Callback Functions

Overview



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 1 of 13 Rev 1



Selector/Callback Functions

System References

None



Distribution

Job Title*



Ownership

The Job Title [list@YourCompany.com?Subject=EDUxxxxx] is responsible for ensuring that this document is necessary and that it reflects actual practice.



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 2 of 13 Rev 1



Selector/Callback Functions



Schedule:



Timing 30 minutes 40 minutes 70 minutes



Topic Lecture Practice Total



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 3 of 13 Rev 1



Objectives



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 4 of 13 Rev 1



Item Type Selector/Callback Functions



Item Type Selector Functions A selector function is a PL/SQL procedure that automatically identifies the specific process definition to execute when a workflow is initiated for a particular item type, but no process name is provided. If your item type has more than one runnable process activity associated with it, define a PL/SQL selector function that determines which process activity to run in a particular situation. For example, you may have two different requisition approval process activities associated with the same item type. The process that Oracle Workflow executes may vary depending on how and where the requisition originates. Your selector function would determine which process would be appropriate in any given situation. This functionality gives you more flexibility to determine dynamically at runtime which process to execute. You can also extend the selector function to be a general callback function so that item type context information can be reset as needed if the SQL session is interrupted during the execution of a process.



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 5 of 13 Rev 1



Defining a Selector/Callback Function for an Item Type



Defining a Selector/Callback Function for an Item Type For example, the WFDEMO item type has a selector function named WF_REQDEMO.SELECTOR. Instructor Note The WFDEMO item type is described in detail in the Sample Workflow Processes chapter in the Oracle Workflow Developer’s Guide.



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 6 of 13 Rev 1



Standard API for a Selector/Callback Function



Standard API for Selector/Callback Function

procedure ( itemtype in varchar2, itemkey in varchar2, actid in number, command in varchar2, resultout out varchar2) is begin if (command = ‘RUN’) then resultout:=‘‘; return; endif; if (command = ‘SET_CTX’) then resultout:=‘ ‘; return; endif; if (command = ‘TEST_CTX’) then resultout:=‘’; return; endif; if (command = ‘’) then resultout:=‘ ‘; return; endif; exception when others then WF_CORE.CONTEXT (‘’, ‘’, , , to_char(), ); raise; end ;



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 8 of 13 Rev 1



Standard API for a Selector/Callback Function



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 9 of 13 Rev 1



Standard API for a Selector/Callback Function



Standard API for a Selector/Callback Function The different commands for a selector/callback function require different return values. • If the function is called with ‘RUN’, the name of the process to run must be returned through the resultout parameter. • If the function is called with ‘SET_CTX’, then no return value is expected. • If the function is called with ‘TEST_CTX’, then the code must return ‘TRUE’ if the context is correct, ‘FALSE’ if the context is incorrect, or ’NOTSET’ if the context has not been initialized yet. • If any other value is returned, Oracle Workflow assumes the command is not implemented by the callback. Note: Other commands may be added in the future.



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 10 of 13 Rev 1



Calling a Selector/Callback Function



Calling a Selector/Callback Function Use the TEST_CTX mode when you want to check that the user context is correct before permitting processing to start on a workflow process. In Oracle E-Business Suite, use this mode to check that the organization is correctly set in a multi-organization environment. • If the value TRUE is returned in TEST_CTX mode when the workflow is being processed by the Background Engine, this result indicates that the application context is set correctly, and the Workflow Engine keeps the current context. • If the value NOTSET is returned in TEST_CTX mode, the Workflow Engine runs the function in SET_CTX mode to set the context. • If the value FALSE is returned in TEST_CTX mode and the Workflow Engine permits context switching at this point in its processing, it runs the function in ’SET_CTX’ mode to set the correct context. However, if the result is ’FALSE’ but the Workflow Engine requires the current context to be preserved, it defers the activity to be processed by a background engine instead. Use the SET_CTX mode to set up all your PL/SQL variables. In this way you can ensure that PL/SQL variables are always set for asynchronous processes when execution of these processes is restarted. For example, you can use this mode to set a bind variable so that specific

Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 11 of 13 Rev 1



views are correct, or to set global variables. If you are developing a custom process in Oracle E-Business Suite, you should use this mode to set your organization context. Note: In Oracle E-Business Suite, Oracle Workflow also uses the TEST_CTX mode to determine whether a form can be launched with the current item type context information just before the Notification Details Web page launches a reference form. When you view a notification from the Notification Details Web page and attempt to launch a form that is associated with the notification, Oracle Workflow calls the selector/callback function for your item type in TEST_CTX mode to test the Oracle E-Business Suite context before turning the form launch over to the Oracle Application Object Library function security system. In TEST_CTX mode, the selector/callback function can perform whatever logic is necessary to determine whether it is appropriate to launch the form. Note that launching a form from the Notification Details Web page is only available in the version of Oracle Workflow embedded in Oracle E-Business Suite. Refer to Practice – Defining a Selector Function [LAB23D4Y]



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 12 of 13 Rev 1



Summary



Copyright © Oracle Corporation, 2004. All rights reserved.



Selector/Callback Functions Effective mm/dd/yy



75689CB0-2FBC-4390-A6B0-0BA8F3AC6D56.DOC Page 13 of 13 Rev 1




Related docs
Other docs by Aashish Sharma
advance_cloning_option
Views: 15  |  Downloads: 4
.profilejyoti_10g_back
Views: 8  |  Downloads: 3
DB-II
Views: 11  |  Downloads: 2
reset sequence without dropping
Views: 26  |  Downloads: 4
SBNewsletter2002December
Views: 5  |  Downloads: 0
Readme
Views: 5  |  Downloads: 2
AZtuning2_wp_final
Views: 10  |  Downloads: 3
115snwbg
Views: 55  |  Downloads: 4
DeleteArchives_SA.sh
Views: 8  |  Downloads: 3
115gmdrpapiug
Views: 117  |  Downloads: 1
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!