You are on page 1of 134

www.hand-china.

com

Oracle_workflow_

20120831

1.0

HAND Enterprise Solutions Company Ltd.


www.hand-china.com

www.hand-china.com

Workflow
Oracle EBS

Oracle
WorkFlow Builder
EBS

Line Flow - Generic, Bill Only ()

www.hand-china.com

Workflow
Line Flow Generic ()

www.hand-china.com

Workflow
Oracle

www.hand-china.com

Workflow
R12

www.hand-china.com

Workflow
Web

www.hand-china.com

Workflow
Web

www.hand-china.com

Workflow
Web

www.hand-china.com

Workflow

www.hand-china.com

Workflow

10

www.hand-china.com

Workflow
Oracle

11

www.hand-china.com

Workflow
OracleWorkFlow Builder

12

www.hand-china.com

Workflow
OracleWorkFlow Builder

13

www.hand-china.com

Oracle

http://www.stanford.edu/dept/itss/docs/oracle/10g/workflow.101/b10283/toc.htm
14

www.hand-china.com

Workflow
OracleNotificationOracle

Oracle Workflow
Demo
sendmail IMAP
DISCARD PROCESS
Workflow Notification Mailer

15

www.hand-china.com

Workflow
SMTP IMAP
Demo RedHat AS 4.4 + EBS 12.1.3
SMTP linuxSendmail IMAPdovecot
linux
http://www.blogjava.net/sealyu/archive/2008/07/23/217022.html
Demo dovecot-0.99.14-1.2.el4.rf.i386.rpm sendmail-cf8.14.3-3.3.el4.i686.rpm linux rpm
http://rpm.pbone.net/
sendmail dovecot

16

www.hand-china.com

Workflow
DISCARD PROCESS

17

www.hand-china.com

Workflow
outlook
DISCARD PROCESS
DISCARD

PROCESS

18

www.hand-china.com

Workflow
Workflow Notification Mailer

19

www.hand-china.com

Workflow

20

www.hand-china.com

Workflow

EDIT

21

www.hand-china.com

Workflow

SMTP Server Name SMTP EBS


Sendmail

22

www.hand-china.com

Workflow

IMAP Inbound Process


Server Name IMAP EBSDovecotIMAP

Username Password
Reply-To Address :

[Advanced] 8
PROCESSED , PROCESS ,
23

www.hand-china.com

Workflow

WFTESTS , sysadmin 3

24

www.hand-china.com

Workflow
sysadmin

Workflow Notification Mailer Test Mailer

Send
Test Message

WFTESTS

25

www.hand-china.com

Workflow
Send Test Message WFTESTS

Nav ->->->


26

www.hand-china.com

Workflow
PLSQL OAF

Sysadmin
27

www.hand-china.com

Workflow
Sysadmin

28

www.hand-china.com

Workflow
Sysadmin

OAF
PLSQL

29

www.hand-china.com

Workflow
OAF

Acknowledge

30

www.hand-china.com

Workflow

1
2outlook

3Acknowledge
31

www.hand-china.com

Workflow
allen@syfdemo.ml.com PROCESS

32

www.hand-china.com

OAF


33

www.hand-china.com

Workflow

34

www.hand-china.com

Workflow
PLSQL

35

www.hand-china.com

Syfdemo_notify_test WFTEST
FormWorkflow

36

www.hand-china.com

Item_type
Attribute
Process
Notification
Function

Events
Messages
Lookup Types

Syf-wf-demo.wft
37

www.hand-china.com


1Item_type syfdemo itemtype test1

38

www.hand-china.com


24 Item_type Attribute

39

www.hand-china.com


21 Lookup Type

Lookup Type

40

www.hand-china.com


33 Message

notify_message ,

oaf_message,

plsql_message

NTF_MSG1
Message

oaf_message,
plsql_message

Result
NTF_MSG1
ITEM

41

notify_message ,

www.hand-china.com


Message

Item

Messag
e
Type= Item Attribute ,Item

42

www.hand-china.com


43 Notification

ntf_notify,

oaf_notify,

plsql_notify

Message; Message
43

www.hand-china.com

44

www.hand-china.com

45

www.hand-china.com


Standard Functions 4

Start :
Noop:
AND

END

46

www.hand-china.com

47

www.hand-china.com

Start -> Noop StartNoop ,


Noop->oaf_notify: Noopoaf_notify ,
90

48

www.hand-china.com

oaf_notify -> AND: oaf_notify AND , , oaf_notify


Any yes no
AND
Plsql_notify-> AND :

49

www.hand-china.com

, Start
Node
Start/End Normal
Start

plsql_notify
Node Tab


NodeTab

NodeTab

Performer :
Item
recipient ,

50

www.hand-china.com


.wft

SAVE AS Database , / OK
EBS
51

www.hand-china.com


6
Nav: ->->->

Item type )SYFTST1 ;


52

www.hand-china.com

Item type Message


recipient wf_role
SYSADMIN;
53

www.hand-china.com


TAB

54

www.hand-china.com

SYSADMIN ,SYSADMIN
55

www.hand-china.com


SYSADMIN

56

www.hand-china.com

57

www.hand-china.com

58

www.hand-china.com

Notification Mailer
oracle.apps.fnd.wf.mailer.IMAPInboundProcessor
INBOX INBOX
lost Message Inbox
Notification Mailer

59

www.hand-china.com

31303: Reference to nonexistent activity


SYFTST1/#T_PROCESS1 in process SYFTST1/ROOT step label #T_PROCESS1.

#T_PROCESS1 Item type

#T_PROCESS1
#T_PROCESS1

60

www.hand-china.com


Notification Mailer
Notification Mailer Notification Mailer

OAMSITE MAPAgent Activity


WF_NOTIFICATION_IN/WF_NOTIFICATION_OUT/WF_DEFERRED Retry Delay
3600 seconds(1)

SELECT NAME, RETRY_DELAY FROM DBA_QUEUES


WHERE NAME = 'WF_NOTIFICATION_OUT';
60
EXECUTE dbms_aqadm.alter_queue (queue_name => 'APPLSYS.WF_NOTIFICATION_OUT', RETRY_DELAY => 60);
EXECUTE dbms_aqadm.alter_queue (queue_name => 'APPLSYS.WF_NOTIFICATION_IN', RETRY_DELAY => 60);
EXECUTE dbms_aqadm.alter_queue (queue_name => 'APPLSYS.WF_DEFERRED', RETRY_DELAY => 60);

61

www.hand-china.com

Oracle Workflow -

62

www.hand-china.com

Oracle Workflow -
1
TXT

Number

Date

Txt , Number , Date

63

www.hand-china.com

Oracle Workflow -
1
Lookup

URL

64

lookup Type;
lookup value

URL
Frame Target
URL

Form

Oracle

Form

Document

www.hand-china.com

Oracle Workflow -
ATTRIBUTE

ROLE

ROLE:

ATTRIBUTE:

65

www.hand-china.com

Oracle Workflow -
URL Form Document

URL

DOCUMENT

Form
Form

66

www.hand-china.com

Oracle Workflow -
URL
TYPEURL

Value: IMGURLURL
IMG:http://syfdemo.ml.com:8000/OA_JAVA/oracle/apps/media/forms_logo.gif

IMG LINK
67

www.hand-china.com

Oracle Workflow -
FORM
TYPEForm

Value: function_name:arg1=value1 arg2=value2 ...argN=valueNfunction_name EBS


Formarg1=value1 Form
SYFFOLDERNOTAB:P_SUB_CONTRACT_PATH_CODE="SYFDEMO_WF_TST1"

68

www.hand-china.com

Oracle Workflow -

69

www.hand-china.com

Oracle Workflow -
DOCUMENT
TYPEDocument

Value: plsql:<procedure>/<document_identifier>
plsqlclob:<procedure>/<document_identifier>plsqlblob:<procedure>/<document_identifier>
plsqlblob:Cfnd_Upl_Pkg.getBlobDoc/2819755

70

www.hand-china.com

Oracle Workflow -

Fnd_lobs
Cfnd_Upl_Pkg.getBlobDoc ID
2819755 ID

Cfnd_Upl_Pkg.getBlobDoc
71

www.hand-china.com

Oracle Workflow -
FND_LOBBlobAPI
/* API to produce a PL/SQL BLOB document for use as a
notification attachment based on the specified
document ID. */
procedure getBlobDoc(document_id in varchar2,
content_type in varchar2,
document
in out nocopy blob,
document_type in out nocopy varchar2) is
l_docid pls_integer;
l_filename varchar2(100);
l_errmsg varchar2(100) := 'The document is not found in the database';
l_bdoc
blob;
l_data_type varchar2(100);
begin
-- Determine the document to display from the
-- Document ID
l_docid := to_number(document_id);
-- Obtain the BLOB version of the document
select file_name, file_content_type, file_data
into l_filename, document_type, l_bdoc
from fnd_lobs
where file_id = l_docid;
document_type := document_type;
-- Now copy the content to the document
dbms_lob.Copy(document, l_bdoc, dbms_lob.getLength(l_bdoc));
exception
when others then
dbms_lob.WriteAppend(document, length(l_errmsg), l_errmsg);
wf_core.context('WFMLR_TEST', 'getBLOBDoc', document_id);
raise;
end getBlobDoc;

72

PLSQL Document API

<121wfdg.pdf > 6-11

Message

www.hand-china.com

Oracle Workflow -
Message itemMessage
Message Body
URL_ATTR
&URL_ATTR
MessageBody

DocumentMessage
Attach Content

73

www.hand-china.com

Oracle Workflow -
URL ,Form,Document

74

www.hand-china.com

Oracle Workflow -

75

www.hand-china.com

Oracle Workflow -

76

www.hand-china.com

Oracle Workflow -

77

www.hand-china.com

Oracle Workflow

Start

End

Noop

And

And

Or

Or

Block

API CompleteActive
Block Form

78

www.hand-china.com

Oracle Workflow

Wait

Wait

Notify

Message

VoteYes/No

Compare XXXX
Compare Date Compare
Number CompareText Item Type

Compare Execution Time

79

www.hand-china.com

Oracle Workflow

Assign
Item Type

Defer Thread

Lanuch Process

Loop Counter

80

www.hand-china.com

Oracle Workflow

Role Resolution

Get Monitor URL


URL
URL Item type

Get Event Property


EBS
Item type

Set Event Property


EBS

Compare Event Property


EBS

81

www.hand-china.com

Oracle Workflow
SYFTST3

WAIT : 11
LOOPCOUNTER PLSQL_NTFNo
23NoExitASSIGN
ASSIGNItem typeNTF-NTFMessage
BLOCK
SYFTST22

82

www.hand-china.com

Oracle Workflow
WAIT

Wait2
Wait Mode : Absolute DateDay of MonthDay of WeekRelative Time
Relative Time
Relative Time 1/24/60 0.0007

83

www.hand-china.com

Oracle Workflow
LOOP COUNTER

LOOP COUNTER1
Loop Limit : Exit 2 2

84

www.hand-china.com

Oracle Workflow
ASSIGN

ASSIGN2
Item Attribute : Item typeAttribute
Text Value

85

Date Value Numberic Value

www.hand-china.com

Oracle Workflow
BLOCK

BLOCK

86

www.hand-china.com

Oracle Workflow
SYFTST2

SYFTST22

87

www.hand-china.com

Oracle Workflow

88

www.hand-china.com

Oracle Workflow

WAIT 11

89

www.hand-china.com

Oracle Workflow

90

www.hand-china.com

Oracle Workflow
1 oaf notify

oaf notify plsql notify

plsql notify no 2
91

www.hand-china.com

Oracle Workflow
plsql notify

no 1 + 23

LoopcounterExit
92

www.hand-china.com

Oracle Workflow
LoopcounterExit

Assignntf_notify message
ntf notify

Block
Block

93

www.hand-china.com

Oracle Workflow
PlSQL Developer APIBlock

API
SYFTST1 ITEM TYPE
Syfdemo-tst-20120912045 Item Key
SYFTST3:BLOCK BLOCKLABEL
LABELWorkflow Builder

94

www.hand-china.com

Oracle Workflow
Block

95

www.hand-china.com

Oracle Workflow &

Oracle Workflow

Oracle Workflow
Oralce Workflow Workflow

Oracle Workflow

WF_USERS -
WF_ROLES -
WF_USER_ROLES -
WF_USER_ROLE_ASSIGNMENTS - WF_USER_ROLES

96

www.hand-china.com

Oracle Workflow &


WF_USERS
WF_LOCAL_ROLES WF_LOCAL_ROLES_TLuser flag Y
WF_LOCAL_ROLES user flag YEBSFND _USER.
EBSHRHR
WF_LOCAL_ROLESHRFND_USER
WF_LOCAL_ROLES
HRWF_LOCAL_ROLESuser flag N
WorkflowEBSHR

97

www.hand-china.com

Oracle Workflow &


WF_ROLES
WF_LOCAL_ROLES WF_LOCAL_ROLES_TLWF_ROLES WF_USERS

WF_LOCAL_ROLES EBS

FND_USR - FND users


FND_RESP - FND responsibilities
PER_ROLE - HR people
POS - HR positions
AMV_APPR - MarketView approvals
AMV_CHN - MarketView channels
ENG_LIST - Engineering approval list
HZ_GROUP - TCA groups
HZ_PARTY - TCA person parties and contacts
GBX - Federal HR group boxes
HTB_SEC - This partition does not participate
in bulk synchronization.
PQH_ROLES - Position Control roles
EBS

WF_LOCAL_ROLES

WF_LOCAL_ROLES
WF

98

www.hand-china.com

Oracle Workflow &


WF

WF_USER_ROLES
WF_LOCAL_USER_ROLES

99

www.hand-china.com

Oracle Workflow &

FND_RESP|FND|FND_REP_APP|STANDARD

3appsadmin,apotter,sysadmin; apotterHR

100

www.hand-china.com

Oracle Workflow &


SYFTST4

YES
NO
Tie
No Match
ASSIGNNTF_NTFPASSEDRejected
101

www.hand-china.com

Oracle Workflow &

VOTE_RECIPIENT

ValueFND_RESP|FND|FND_REP_APP|STANDARD

102

www.hand-china.com

Oracle Workflow &


VOTEFORRESULTTYPE

Performer

103

Percent No

www.hand-china.com

Oracle Workflow &


2ASSIGN Message

104

www.hand-china.com

Oracle Workflow &

105

www.hand-china.com

Oracle Workflow &

Sysadmin NoYes

106

www.hand-china.com

Oracle Workflow &


appsadminYes

107

www.hand-china.com

Oracle Workflow &


2YES60%YES

108

www.hand-china.com

Oracle Workflow API


Oracle Workflow API
CORE APIs :
PURGE APIs:
DIRECTORY APIs:
MONITOR APIs: WebURL
NOTIFICATION APIs:
PREFERENCE APIs:
QUEUE APIs:
DOCUMENT MANAGEMENT APIs: URLJavaScript
VIEWS:

Oracle Workflow API API

109

www.hand-china.com

Oracle Workflow API


API
API

WF_ENGINE.CreateProcess

WF_ENGINE.SetitemOwner

WF_ENGINE.StartProcess

WF_ENGINE.SetitemUserKey

WF_ENGINE.LaunchProcess
api CreateProcess StartProcess

WF_ENGINE.SetitemParentCreateProcess
StartProcess

WF_ENGINE.AbortProcess

WF_ENGINE.background

WF_ENGINE.SuspendProcess

WF_ENGINE.ResumeProcess

110

www.hand-china.com

Oracle Workflow API


API
API
Item type
WF_ENGINE.SetitemAttribute(4) SetItemAttrText SetitemAttrNumber,
SetitemAttrDate,SetItemAttrEvent
Item type
WF_ENGINE.GetitemAttribute(4)
Item
WF_ENGING.GetItemAttributes
Item
WF_ENGINE.GetitemAttrInfo
ItemCLOB
WF_ENGINE.GetItemAttrClob

WF_ENGINE.GetActivityAttribute(3)
Item type
WF_ENGINE.AdditemAttr itemapi

WF_ENGINE.GetActivityAttrInfo

111

www.hand-china.com

Oracle Workflow API


API
API

WF_ENGINE.CompleteActivityStart

WF_ENGINE.BeginActivity CompleteActivity API

WF_ENGINE.AssignActivity
Label
WF_ENGINE.GetActivityLabel

WF_ENGINE.HandleError API

WF_ENGINE.ItemStatus

112

www.hand-china.com

Oracle Workflow API


PLSQL API
PLSQL APIPLSQL API

113

procedure Assign(itemtype in varchar2,


itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout in out nocopy varchar2)
is
--
begin
-- Do nothing in cancel or timeout mode
if (funcmode <> wf_engine.eng_run) then
resultout := wf_engine.eng_null;
return;
end if;
--
resultout := wf_engine.eng_completed||':'||wf_engine.eng_null;
exception
when others then
Wf_Core.Context('Wf_Standard', 'Assign', itemtype,
itemkey, to_char(actid), funcmode);
raise;
end Assign;

Item Type

APIID

www.hand-china.com

Oracle Workflow API


API 1

2 ADD_PATH, SYF_CONTRACT_PATH
Item OPEN_FORM_COMMANDForm

114

www.hand-china.com

Oracle Workflow API


ADD_PATH

Function Name
Syfdemo_wf_test.add_path
API

115

www.hand-china.com

Oracle Workflow API


procedure Add_Path (itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout in out nocopy varchar2)
is
--
l_SUB_CONTRACT_PATH_ID number;
begin
-- Do nothing in cancel or timeout mode
if (funcmode <> wf_engine.eng_run) then
resultout := wf_engine.eng_null;
return;
end if;
--

API

select SYF_CONTRACT_PATH_s.Nextval into l_SUB_CONTRACT_PATH_ID from dual;


insert into SYF_CONTRACT_PATH
(created_by, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN, SIGNED_UNIT_CODE, SUB_CONTRACT_PATH_ID,
SUB_CONTRACT_PATH_CODE, SUB_CONTRACT_PATH_DESC)
values
(0, sysdate, 0, sysdate,
0, 'SYFDEMO_WF_TST'||l_SUB_CONTRACT_PATH_ID, l_SUB_CONTRACT_PATH_ID,
'SYFDEMO_WF_TST'||l_SUB_CONTRACT_PATH_ID,
'syfdemo workflow test'||l_SUB_CONTRACT_PATH_ID);
wf_engine.SetItemAttrText (itemtype => itemtype,
itemkey => itemkey,
aname => 'OPEN_FORM_COMMAND',
avalue => 'SYFFOLDERNOTAB:P_SUB_CONTRACT_PATH_CODE='||'SYFDEMO_WF_TST'||l_SUB_CONTRACT_PATH_ID);
resultout := wf_engine.eng_completed||':'||wf_engine.eng_null;
exception
when others then
Wf_Core.Context('Wf_Standard', 'Assign', itemtype,
itemkey, to_char(actid), funcmode);
raise;
end Add_Path;

116

www.hand-china.com

Oracle Workflow API


EBSAPI
function languch_process(P_process in varchar2) return number is
l_syfdemo_prodess_id number;
l_item_key
VARCHAR2(30);
l_user_item_key VARCHAR2(30);
l_item_type VARCHAR2(30) := 'SYFTST1';
l_process
VARCHAR2(30) := P_process;
BEGIN
SELECT syfdemo_wf_process_S.NEXTVAL INTO l_syfdemo_prodess_id FROM dual;
--01
l_item_key
:= l_syfdemo_prodess_id;
l_user_item_key := 'syfdemo' || lpad(l_item_key, '8', '0');
wf_engine.createprocess(itemtype => l_item_type,
itemkey => l_item_key,
process => l_process,
user_key => l_user_item_key);
--
wf_engine.SetItemAttrText (itemtype => l_item_type,
itemkey => l_item_key,
aname => 'NTF_MSG1',
avalue => 'syfdemo message 1');
--
wf_engine.SetItemAttrText(itemtype => l_item_type,
itemkey => l_item_key,
aname => 'URL_ATTR',
avalue => 'IMG:http://syfdemo.ml.com:8000/OA_JAVA/oracle/apps/media/forms_logo.gif');
--03
wf_engine.startprocess(itemtype => l_item_type, itemkey => l_item_key);
return l_item_key;
END;

117

2
declare
l_item_key number;
begin
-- Call the function
l_item_key :=
syfdemo_wf_test.languch
_process(p_process =>
'SYFTST2');
end;

www.hand-china.com

Oracle Workflow API

118

www.hand-china.com

Oracle Workflow API


API 2

SYFTST2
WAITFORFLOW
SYFTST4
CONTINUEFLOW

WAITFLOW/CONTINUEFLOW

119

www.hand-china.com

Oracle Workflow API


API 2 -
Declare
--

Begin

1Master
Detail

--
wf_engine.createprocess(itemtype => l_item_type,
itemkey => l_parent_item_key,
process => 'SYFTST2' ,
user_key => l_parent_user_item_key);
--
wf_engine.createprocess(itemtype => l_item_type,
itemkey => l_child_item_key,
process => 'SYFTST4' ,
user_key => l_child_user_item_key);
-- Item

--
wf_engine.SetItemParent(itemtype =>l_item_type,
itemkey =>l_child_item_key,
parent_itemtype =>l_item_type,
parent_itemkey =>l_parent_item_key,
parent_context =>'WAITFORFLOW');

2
3

--03
wf_engine.startprocess(itemtype => l_item_type, itemkey => l_parent_item_key);
wf_engine.startprocess(itemtype => l_item_type, itemkey => l_child_item_key);
END;

120

www.hand-china.com

Oracle Workflow API


API 2

Process2 Process4

121

www.hand-china.com

Oracle Workflow API


API 2

Process4
Continue Flow
Wait Flow

API http://blog.retailsolution.cn/archives/2149
122

www.hand-china.com

Oracle Workflow



Seed Date),
1
2

Oracle Standard Item type

Standard Item type



Item Type

Standard
Item type


123

www.hand-china.com

Oracle Workflow
Oracle Workflow

Oracle WorkFlow Protection Level


Customziation Level) Access Level)
01000
Oracle
0-9
10-19
20-99
100-999
1000

Oracle Workflow
Oracle Application Object Library
Oracle E-Business Suite development
Customer organization. example, 100 can represent
Public

100 101

124

www.hand-china.com

Oracle Workflow

APPLSYS.env

125

WF_ACCESS_LEVEL

www.hand-china.com

Oracle Workflow

Workflow BuilderWorkflow ACCESS TAB

Option =Workflow builder 100


Option=1000
<=

126

www.hand-china.com

Oracle Workflow

Workflow BuilderWorkflow ACCESS TAB

Option Preserve Customization =Workflow builder 100


Option Preserve Customization=0
>=

127

www.hand-china.com

Oracle Workflow

128

www.hand-china.com

Oracle Workflow

129

www.hand-china.com

Oracle Workflow

130

www.hand-china.com

Oracle Workflow

131

www.hand-china.com

Oracle Workflow

Oracle0
100
Workflow Builder0 Oracle

132

www.hand-china.com

Oracle Workflow EBS


__OM.pdf

133

www.hand-china.com

Oracle Workflow

134

You might also like