Tuesday, February 3, 2009

XDK

select dbms_xmlgen.getxml('select * from emp') from dual;
above query will give table data as xml.

declare
xml_string varchar2(4000);
flag number(5):=0;
begin
xml_string='';
flag:=dbms_xmlsavexmlgen.insertxml('scott.emp',xml_string);
end;

BPEL(Business Process Execution Language)

Its replacement to workflow.
BPEL Processes(xxtest.bpel) and xxtest.wsdl files can be created using Jdev 10g or Eclipse.
Both xxtest.bpel and xxtest.wsdl files will be bundled in .jar file used for deployment.

Workflow

APIS:wf_directory.createadhocrole
wf_engine.setitemattrtext
wf_engine.launch_process
wf_engine.create_process
wf_engine.start_process
wf_engine.setitemuserkey
wf_engine.setitemowner

Tables:wf_notifications
wf_item_types
wf_local_roles
wf_events

Steps to create and raise business events:
1.create tables you need
2.define business event in wf administrator resp
3.define subscription to above event
4.create plsql function and attach it to event via subscription
5.raise event using wf_event.raise()
http://oracle.anilpassi.com/workflows-business-events-training-lesson-4-2.html

UNSUPPORTED CUSTOMIZATIONS

The following types of customizations are NOT supported:
- Modifying a workflow object that has a protection level less than 100
- Altering a workflow object’s protection level if its original protection level is less than 100
- Changing access level to an unauthorized level of less than 100 for the purpose of modifying workflow objects that are protected at levels less than 100

PRESERVING CUSTOMIZATIONS
To ensure that your customizations are preserved during an upgrade of Oracle Workflow:
Check your access level before you make your modifications to the predefined workflow process.
Oracle E-Business Suite: 100
Standalone Oracle Workflow: 100 or higher
Set the appropriate options in the Access property page for any object that you modify.
Oracle E-Business Suite: Select both the Preserve Customizations and Lock at this Access Level options.
Standalone Oracle Workflow: Select the Preserve Customizations option. Optionally select the Lock at this Access Level option.
During an Oracle Workflow seed data upgrade, the Workflow Definitions Loader is always run in Upgrade mode at an access level less than 100. As a result, the upgrade will not overwrite any object with a customization level of 100 or higher


How to send an email to Oracle EBS Users 

This is 3 step process

l_adhoc_role varchar2(240) := 'XXE_APPR'||TO_CHAR(SYSTIMESTAMP,'YYYYMMDDHH24MISSFF');
l_adhoc_role_name varchar2(240) := 'XXE_APPR'||TO_CHAR(SYSTIMESTAMP,'YYYYMMDDHH24MISSFF');
 
  1. Create Adhoc Role
      This is using wf_directory.CreateAdHocRole(    role_name     => l_adhoc_role,
                                    role_display_name => l_adhoc_role_name);
  2. Add User(s) to Adhoc Role
     This is using wf_directory.AddUsersToAdHocRole( role_name    => l_adhoc_role,
                                            role_users =>'SYSADMIN');

  3.  Create item attribute of 'Role' in Workflow and assign l_adhoc_role to it, which will be    attached to Notification.

If you want to create custom function in workflow, create below sample PLSQL Procedure 
procedure GET_APPR(
    itemtype  in varchar2,
    itemkey   in varchar2,
    actid     in number,
    funcmode  in varchar2,
    resultout    in out nocopy varchar2);


How to Ensure Workflow File Customizations/Changes Are Not OverWritten By Upgrades/Patches (Doc ID 1343956.1)

Thumb rule is 
      - For Modified objects inside workflow CAP level should be 100/100/1000
      - For New objects inside workflow CAP level should be 100/100/100

CAP= Customization level
           Access level
           Protection level

WBP=Workflow background process
Below is recommendation from oracle.

The recommendation is to run three separate background engines at different intervals:

a. Run a background engine to handle only deferred activities every 5 to 60 minutes.
b. Run a background engine to handle only timed out activities every 1 to 24 hours as needed.
c. Run a background engine to handle only stuck processes once a week to once a month, when the load on the system is low.