˘ ˇˆ˙˝˙ - oracle · oracle workflow release 2.6.2 workflow process development guidelines...

67
2UDFOH:RUNIORZ5HOHDVH :RUNIORZ3URFHVV'HYHORSPHQW *XLGHOLQHV $Q2UDFOH:KLWH3DSHU 'HFHPEHU

Upload: phamhuong

Post on 03-May-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

������������� ������������������������������������������������������������ �������������������

Page 2: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 2

������������� �������������������������������������������������

������������������������������������������������������������������������������������������������������������ � ������ ����������������������������������������������������������������������������������������������������� � ��������!��� ����������������������������������������������������������������������������������������� � ��!�������!����������������������������������������������������������������������������������������� � "#��$���������%�#��$�����&��������������������������������������������������������� � '$��"��������(����'#�������������������������������������������������������������������������������� )

������!�"��������������������������������������������������������������������������������������������������������� * "$����(�+��������, ����������������������������������������������������������������������������� * "$����(�-������"#��$����������,���������������������������������������������� * "������!�������� ������������������������������������������������������������������������������������� * ������!�"����������$�������������� ������ ������������������������������������� .. "$����(�/��������0��������������0���(����'#��,�������������������������� .. /�����!���0�1������%�(������������������������������������������������������������������� ..

/���!�'��$��2��� ����������������������������������������������������������������������������������������� .� ���������'$������������������������������������������������������������������������������������������������ .� �$����������������'$�����,�������������������������������������������������������������������� .� ����!����$����������'$������������������������������������������������������������������ .� �������������"�2��������&�������������������������������������������������������������������� .� 3��!��!�%������������������������������������������������������������������������������������������� .4 ����!����������'$������ ������������������������������������������������������������������������ .5

&�����"#��$������������� ���������������������������������������������������������������� .5 (���!�����!����$����������"#����������������������������������������������������������������� .� ������������������������������������������������������������������������������������������������������ .� /�����!����$�0�1�������������%����������������������������������� .�

'������ ������������������������������������������������������������������������������������������������������ .) 3��'�������������������������������������������������������������������������������������� .6 '�����������0���������������������������������������������������������������������������� .6 '�����������&������� ����������������������������������������������������������������������� .* '������������������� ������������������������������������������������������������������������ .* �#������'������������#������'������/�������� ������������������� �7 '��������� ����������#�����#�������������������������������������������������������� �.

"�8�������������������������������������������������������������������������������������������������������� �. /�����9�����3� �������������������������������������������������������������������������������� �4 ��8�����!�0������������������������������������������������������������������������������� �4 +���!�(����%����8���� ���������������������������������������������������������������������������� �4

:��"���������������������������������������������������������������������������������������������������� �5

Page 3: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 3

��������!����$���:�� ���������������������������������������������������������������������� �5 ��� ������� ��������������������������������������������������������������������������������� �5 ��� �������:������������������������������������������������������������������������������ �� ��� �������(!��������������� �;����������������������������������������������� �� /������8������������������������������������������������������������������������������������ �� 0��������������:����������������������������������������������������������������������������� ��

���������3������! ����������������������������������������������������������������������������������� �� '$����������'��������<�/���$��!�+����������������� �������������� �� ��������'�������������%�#�'�������� ������������������������������������������������ �� +���!�0�������������������3������! ��������������������������������������������� �� �����������3������! �������������������������������������������������������������������� �)

-�����=�������&��� ���������������������������������������������������������������������������������� �6 "������!�/$�������&����$������������������������������������������������������� �* "������!�/$�������������"�������������� ����������������������������������������� �*

"������=/���8���&������ ���������������������������������������������������������������������� 47 �$�����+�����"������=/���8���&��������������������������������������������� 4. �������������������������������������������������������������������������������������������������������� 4.

0���������������������������������������������������������������������������������������������������������� 4. &>(�0���������� ����������������������������������������������������������������������������������� 4. ������� �� ������������������������������������������������������������������������������������������� 4� �������0���������� ������������������������������������������������������������������������� 4� �:="?:��������� ����������������������������������������������������������������������������� 4� �:="?:�/:� ��������� ���������������������������������������������������������������� 44 0���������������%����8�������'#���+ :���������� ��������������� 45 (������������#�����%����$����� ������������������������������������������������������������ 4� 0��������������$���"��!���+ :� �������%����8�������������������������� 4�

���10����������&����������������������������������������������������������������������������� 4� ��������+��� ����������������������������������������������������������������������������������������� 4) 3�����10����������&���������� �������������������������������������������� 4) ���10����������&�����������0����������&������8#����&��������������������������������������������������������������������������������������������������������� 46

@���!����������������������������������������������������������������������������������������������������������� 46 :����������������������������������������������������������������������������������������������������������� 57 %����8���� ����������������������������������������������������������������������������������������������������� 57 (����%����8���������%������#�%����8���������������������������������������������������� 57 (����%����8���� ��������������������������������������������������������������������������������������� 57 /$��!��!�%������#�%����8�������� ������ ������������������������������������������� 5.

"�����%��������� ��������������������������������������������������������������������������������������������� 5� �$�����������������������������#�"���������������,����������������������������������� 5� -��������"���������������������������������������������������������������������������������� 5� "������!����������-����# �������������������������������������������������������������������� 5�

����%������������������������������������������������������������������������������������������������������� 5� �$���������������������������#���������������, ������������������������������������ 5�

"������������ ������������������������������������������������������������������������������������������� 5� ��!�������!��������������������������������������������������������������������������������������� 54 ��������!����$�� ��!�������!����������������������������������������������������� 54

Page 4: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 4

���������� ����������������������������������������������������������������������������������������������� 55 3��������"$�����$�� ��!�������!���� ��, ��������������������������� 55

/������������������������������������������������������������������������������������������������������������ 5� 0�/���������������������������������������������������������������������������������� 5� /���(�/����������������������, ���������������������������������������������� 5� %�������/������������������������������������������������������������������������������� 5�

3���������� �1���8���%�������������������������������������������������������������������� 5� %���0�(A�%<�0����!�"���������������������������������������������������������������������� 56 ��������0����!�"�������� ����������������������������������������������������������������������� 56 ��������"������������%����8B����������������������������������������������������������� 56

�8B����0����!�"�������� ������������������������������������������������������������������������� 5* (����'#�������������������������������������������������������������������������������������������������� 5* (����%����8���� ��������������������������������������������������������������������������������������� 5* :���'#�������������������������������������������������������������������������������������������� �7 :���/��� ���������������������������������������������������������������������������������������� �7 -����!�� �������������������������������������������������������������������������������������������������� �. -����!��%����8������������������������������������������������������������������������������������� �. %����������C&�������D���������D�0����������D�������E������������������ �� %������#�%����8�������������������������������������������������������������������������������������� ��

%���0�(A� <����!������!�"�������� ���������������������������������������������������� �5 F�������������"�������� ��������������������������������������������������������������������������� �5 +���%����������(���������������������������������������������������������������������������������� �5 �������>���(����:!�����#������������������������������������������������������������������� �� %��������������"������! ������������������������������������������������������������������������� �� "������#�>������!��������������������������������������������������������������������������������� ��

%���0�(A�/<�0����������"��������������������������������������������������������������� �) "�8B����:��� ������������������������������������������������������������������������������������������������� �) -����!�� �#���������������������������������������������������������������������������������������������� �) "����"��������-����!������������������������������������������������������������������������ �) :�#�� ������������������������������������������������������������������������������������������������������ �6 �������"��������-����!���������������������������������������������������������������� �6

%���0�(A��<�"���������/$������ ����������������������������������������������������������� �* %���0�(A��<�������# ������������������������������������������������������������������������������� �7 %���0�(A�&<�%�(�"�������� ��������������������������������������������������������������������� �� �

Page 5: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 5

������������� �������������������������������������������������

EXECUTIVE OVERVIEW

'$����!�����������$��$���������������������������������������������������#����������������'$�#���������������������������������������������!�������������!����$�������������D�������������������!������������������������������������&����������������������$�������������������������D�����������������$�����������������������

-��#�������������������!�����$����8��������!�����������������$������!���������������#��'$�����������������������������������������#������������8����#����������$�������������������������������������������$������������������������#��������������������9�������

���$��$������������������D����$���������������!���������������������������������������'$����$���8��������2����#�����!���������$������������������������������!�����!�������������$��$�����������������$�����'$�������������������������!��$�������������������!��$����2������!���������+����$������������!��$������$��$��������!������������$���������������������$�������������������������������������!�����������

• ��������������������� ���!�������"#� �$%� �������&'$(&��#����� ����������G�������8����$��������������� ��������������"#����D��������������������������������������� ������������$���������!����$���������%��������?�����!�����������������������������8���������������8��������#�������

• ������������������)�#�*�������� ���G�������8����$���������������;����%�(��������������$�����������%�(����;���������������������8#���������������������

Page 6: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 6

WORKFLOW BASICS

Workflow Engine

'$����!���������#������!��������������$���(��������#����������:="?:�����!������������$��������8���������8#�����#��������������������$�������������������������������������!��!��$��D����$����$��������#H������������������!��$��������������#�����������(������$����������!�����$�������������$���������������������$������������������������'$������D�����������#��������8����#�������������$��������������������������������$D�!������!��$�����8����$��������9�����$���������������

Background Engine

%��$��������$�D��$�� ��!�������!����������:="?:�����!���$����$�����$����������8���������#�������������$�����2�������������!D����$���������1��������������������������(�������������I8��!����J�8�����������������������������������!���������������8#����#�����������B8�C���$����8���$D�������������!���D�������B8�E����$����$���������������$�������������������������!�����������#���������D��$�� ��!�������!�����������$�����������!����%�(������������$���������#��>����#�$���������$������ ��!�������!����������!������#��������D�����$��$�������$��������������8���$�����8��������$�����

������%������������D�#���$�������8��������!��!������$����$�����8��!�������!����������������������!�����������#��(���������2�������������������������������������������������8��!�������!����������������$��� %��������8����#����$����$����$��8��!�������!�������������!�����������#��(��#��$��������!������������������#�����D�#����#��������������������#����������������$�����8��!�������!���������8��������������������#����#���������#������$������D�#�����������#���������$�������������!�������������������!�����!�������������

Synchronous vs. Asynchronous Flows

'$�������������#��$�����������#��$������������������������������!���!��������������������������%��#��$����������������$���!����������������������������������$�����$����$������D�#����������������#��$������#�������������������������������8��������������#����$������8�����'$���������������#���������������$���������������������!����������K��$��������$������������8�������������!����$����������������$�������������$��!��(���$�������D�#���$�����$��!������������#��$�����������

'$��������!�������������$������#��$����������$�����$�������������������������������������8�����

CreateProcess() -- register a new instance

SetIemAttr() -- set as many item attributes as necessary

StartProcess() -- execute the process

-- workflow is complete: control is returned

Page 7: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 7

GetItemAttr() -– get the result as an Item Attributes

%����#��$�������������������$��$��$����������!����������!����������������������#�8��������������������������������$��������������$������� ��$����$���������!������������#D��$����������!����������$����������8���������������#����������������������$��������!��������$��������������$����������������C'$�����������!$��$����8������������������!�"�������������/���������������8#�������!���������E��'$�����������������������������$������������������������������!���D�������#�8#��$��0����������"#��������$�� ��!�������!����������������������������$�������������#��$��������������������������������D����������������$���������D�8����!�����������D����������������������

• ���������������������

��������!����������������$������������������#�����������$������H����������������%������!�������#��������������������#H�������8����$�����������$���$�������C���:="?:�����!�������8����������7�8#��������E�������������������#����H��������$������������������%�����������$����!�������������#��$��������$��8��!�������������������������������$�����������#��/������������������#�������������$������D��$������������������$�����������!��������������!������D���������!�������������������������(������$��8��!�������!�����$��$�������������$��������������������������������������������������

• 0�����������

%�������������$�����2��������������������������$���#��$���������������������������������������������#���$����������������!D��$���������#�����������������0�'(&(����'$��0����������"#����D�����������!��$���������D�����������$����������$��!$��$������8����������D��&L�0�(0��/ ��

• ����!������������

>���������������#�������$��������$����8#�����!���8����������#��(��������#��$���������������������������������$����$���������#�����������������0�'(&(����'$�����������#���������#��$���9�����$������������������D����$����$����������������������8�����������$������������$������������(�����������$����������������������������$���������#�8#�������!��$����������!����/������%������#�%�(���

• ����������������

%�������������#��������������#��$�����������������������������������8������������%�8��!�������!�������������$����$���������#���������������������

The Standard Item Type

���������������������$����������#����������"��������C���������E��'$�!$��$���������#�����������������#������������!���������������D������������

Page 8: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 8

�������������������$��������!�����#���$������$�����������!������!��/���2�����#�����������#�������8������!�������$���������8���#���������������D������������������������������������������������$��!$����$�������������

+����$��?����"�������9�����������������#���#��$��"��������������#�������#�������������#�����%�����������#D���������#����$��"��������������#���������$���#�������������������C>�������$�����������$������������������������!��$��"��������������#�������#�������������E�

Page 9: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 9

GETTING STARTED

'$����������������������2��������#���$������������8������������!�����������B�����������!���������#�����!���$�����

Should I Use Workflow?

��������������$�����������������������������������������������'$������������$����������8����$��!��!�������������!����������������$���8����#�����������$���������������$��!$�������������������������������������8����$�������������!�#���8����������������

������!����������������8����#���#���8����������������(��#��������������$�����������������$���������������D��$���������������������#����#���(��#������������$������������������8�!�����!��������������������������8���������!��D��$����!���������������!�������

Should I Model a Synchronous Workflow?

(��#������!�����#��$�����������C����$��$�!��������������������$��$�����$����������������!E��������#����������������������������D�#�������!����������$������������$������������������9������������������������#�������������$�������������8�������#��$���������$������$�����������D����#��$������������������������������������������������������$�����8���������������%�(���'$�������#���$����2�������������%�(����$�������9�8���$������������������������������#���������$����'$����#��������!����������!����#��$�������������������������$��!���$�������������������$������������������$��,�3�����$�������9�����������$�����������������������#���������������������#��$����,�(��#�������������������������9����D������#�������$�����#������8��������������������8#���������������

Starting a Workflow

�����#����������������$���8�������������$������8���D�#���������$���������8#�������!��$����������!����%�(����8#�������!���8������������������������!��$�����������$����������

(��#�������$�� ��������������"#��������������������D�#��!�������#������$�����������$���&L�@�0'� �����%�(�����������!�������������'$���%�(����������8�������������K�#�����������������8���������������������������������$���������������������������������������������$����������&���������������D�����������������$����������������������� ���!�������"#� �$%� �������&'$(&��#����� �����������$�����������

(��#�������$����������!����%�(�����������������D�#��!�������#������$�����������$�������������!��������������$����#���������$��%�(����������#��C����������D���������H���1������=������=����������!!���D����������������������D��������E��&�����������������8����$����%�(�D�������������$�����������������������

Page 10: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 10

• /�����������<�'$���������������#������������2����������������$���������������������$����������8������

• "��(���%����8���<�'$�������������������#�8�����������������������������������#�����������8������$��$������8�����������������$������������D����$�����������!����!�8��������8����������!������!����!��!���

������'$��"��(���%����8����%�(�����������������D�������!�#������������������������%�(�������$�������#���#��������������(���$�#��������������D�����!���������!$����������#����������������8��������$�����!�������#����'$��D��$������������!��������D�������������8���������8���������������������8������������C�$���������!��$�������8���D��$�������������8������������$�����!�������#��D�����������������8������������E�'$����#����������������#���������������8�!�� #������������!��$����������D������������$����#�������!������!���8������

• "��(���+���F�#<�'$�!$��$������������D������2�����#������#�������$���%�(�������������1�������#�������#��'$��������#����������#�������$����������������8�������8#��$����������������#��$�����������

• "��(��������<�%���������D�8����!���������2�����#������#�������$���%�(�����������$����������$�������������#��$����$�����������������������$���������8���������8�������$��&�������������8���!���(���$����������������D��$�����#�����������$�����������������������������2���#��$�������������$��&�������������8���!���'$�����������������������������������������8�����$��$���������#���������8#�������!��$��������0����$����$�����������8���������������������������

• "��(���������<����#���2���������#�������������!��$����������������$�����������������������

• "����������<�-������#��'$���%�(�����������8�������������!��$�����������

�$�������!�����!�������������#�������������D����������#������������������������!����������������������$��������'$������������#�����������������������������������������������������!�����!��$��������2�����������������#���������������

'$��������!����������$���$���������$������������������������

wf_directory.GetRoleName

(Orig_System, User_ID, role_name, role_displayname);

-- call engine API to set the owner.

wf_engine.SetItemOwner(ItemType, ItemKey, role_name);

Page 11: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 11

Getting Started with Oracle Workflow Builder

�$���#�������������$��������������� ������D�#��!�����8����$������$#��������(��#���������������!�����������!�����D������$��$��?����"�������9�����������������#���������$�����������$�����#����$��"��������������#�����

Should I Create a New Process or a New Item Type?

(��#��$�����������������8�����������������$�������8������������D��$���#����������������������������������C����������������������#���ED���#�������$����������������$�������������C���������#������$������������E���$��$����8���,�'$������������������������������K������#D����#���8���������������$�����$�����������������8�������������������D��$����$�#��$����8����������$�������������������#����

Calling a Non-Workflow API

%�8��������������������������$���#�����������������!�%�(������������$������������������������#�����������3�������$����%�(��������#������$�����$���������!��������$���������������#�������!������������#����$��������>�������������������������������%�(��$��$����������$�����������������!������������$���������#����������!�%�(��(���������$�����������$���#��������������$����������#���!�������8�����������!�#���%�(��>���������$�����������$�����������#�������������$�����������������8���������!��$����������!�������(���%����8����%�(���

Page 12: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 12

CODING TECHNIQUES

Parallel Threads

What are Parallel Threads?

�$����������������������������������$��������������$������������D��$����$���������������������D��������$��������������$������������������

(��������#D��$����!���������$��!$����$�������������D���������!����$��$�����������������H�����������#�����$�������#��$�������������������$��������$������'$�����������$��$����������������$��$�������������#���8�����#���

Working with Parallel Threads

�$�������!����$�����������$�����D�#�������8�������������$���#��$������$�������������������0���������#���$�������0�������������D��$����!�������������$���������������������������!�������#��$����$����������$�����������'$������D����#��$��������������$��������������������������������������0�D��$���$������������������#��������$����$���0���������������'$�����#����8���$���#������D�����$��$������#��������������8�$�������#�����������#��$����$���#������������'$����#���#���!����������$�����������������$�����������������8#������!��$����������9�������$����%0������������

0��D�$�����D��$����$�������8���������#����������!�����#���������#����������������������$�������!���������$��$����������������������������$�������������C�����$�������+���������,������������E��

Parallel vs. Sequential Flows

Diagram 1: A simple process flow executed in sequence.

/����������!����.��%�������$���"�����'����������������-�����99��������8�1����������B8����2�����!������������������������'�����������������#D�#�����������������������$����������8#���������!��$������$��8��!�������!�����(���$�#�$������������������������$��$��D����$��$����$����������������������D�#�������������$��������������D����������!�������'$��D�8��������$�#�������������D������������8��!��������������#������������$��������#���������!��������������������������!����$�������������������'$��%0������������������$����$��������#�����������$���8�$�������������������������

Page 13: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 13

Diagram 2: The same process flow with two activities placed in parallel.

Diagram 3: Similar to diagram 1b, but without the AND-operator.

���!����4�����������������!������8�������������������$��%0����������0���$���$�����������������������9�����'$������D��$���������$���������������������#�(�����D����&>(�����������D��������$���������������������������#���!����������$���0�D��$�������������!��$���$����$������(��-�����99������"�����'������������������8�������������������������2�����!���������D�����������!����$������8����������������#����������������#��$��!����$������������������$������$���8������(���$��������#�����������������$�������#����$�����99���������������������!�������M�'$�����������$�!$��!$����$���������������$��%0�������������$����#���#���!����������$��������$���������������������

Hanging Activities

�$����$����2�����������������������������D��������������!���$��!�������������������������������!�����������������#D��������!�����������$�������&>(����������������������������������$�����#D��������������������������$�!$���'$���������#����!�����8��������$���������!����������$��������������������������������(���������8���������������$������������������2��������

Page 14: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 14

Diagram 4: Example of an FYI notification “hanging” off an activity.

(���$����������D��$��0���#��������-���!���&>(������!���������8�8�#�8�������8��������$����!������������������$����������������������������3�����D�����$�� �2�����%�����������������������������������$����#��$������������#D����$�������������������&>(�����������D��$����$�����������������������������$��0���#��������-���!���&>(���������8��������������!��$���&>(�����������������$��������������8����������!������������������������$������������!��������������������

Racing Parallel Threads.

'$��������$����$����!�����������������#������������������������������$������������������#����������!���"������������������#���������$�������!���������$��$���������������������������$��$��$�����������������'$���$��������$����������������!����$�����('3� 1� �������$����������������������������������������$����$������%�������������$���������#�����������������������$��������$����������������������$�����$���$��������������������������C�����$���%������,���� �������%������,���� �-��� ��� ��������E���

Forced Synchronous Processes

�$���#����������������������#��#��$�������������$��$�#��������#�������������$������������������������D��������8�����������������������$�������������������%���������������'$��������������������$�����������������8#����������!���#��������������$������������8������8�����%����������������������$�����������$������������!������������������#�����������8������������$��������!���!��������$�����������������#����$����$������8������$����������������������������

Page 15: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 15

'�������������������#��$��������D������#�������#��$��������#����N">0/3���$��������$����!�������������$�������������$��������#D��������������������#�$��!����$������8������

>�������������$�����������������$�������!��������#��$�������������<�

• 0����������������������

• 0���������������8����!�������������

• 0����������������

• 0����������C��������������D�8�������������������!����������E��

• 0��������=�������������������

• 0�����������������C�������������������������#������$��������������������E��

• 0��������$��O%�#O�����������C�$������������������������������E��

• 0��&L��!���������������#������8��������$�����������#��$�����������

• 0��������!�=��������!��

• 0��������$��������!��������������������������������

o %����

o ����

o ������

o 0�����������=�@���!��

o /�������&���=���������&����

o ��� ���������

o /���������������'�����

o 0���#��

o ������'$������

• 0��&L��!����%�(������������������$��������!<�

o �&L��!����"����������C�����#��D������#E��

o �&L��!�������(���%�����

o �&L��!����"��(���%�����

o �&L��!�������%������#%����

'���8�!�������������������������#��$��������D������$��������������!���������8#�������!������2���������#��'$�����#D������$���������!���������������������8�������������$������8�����'$���#��������8�!���������������

Page 16: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 16

Integrating with External Systems

�������������������������!���������$�����������#�������$��!$��$�� ��������������"#����D��$��$����8�������������������!��#������8�$����$�������8�#����$��������������'$�� ��������������"#�����������!����������%��������?�����!����$��!#��������������8���������������8��������#�������&���������������D�����������������$����������������������� ���!�������"#� �$%� �������&'$(&��#����� �����������$�����������

Blocks and Waits

%��!��$�����#����������������������$���&L"'%0�% ��������#���C���������ED�������������������#����������������������!�#���������<� �������������(���$��������!���������D�����$��$��#�����������$���������������$��$������������������������������������$�������������2��������

Coupling with Non-Oracle Workflow Applications

'$�� ����������#������#�������������������!���#�����$���8#�������!��$���������#����������0�'(&(����(���$��������D��$����!������������$���������#�����������������������!���������������������������������#�����������$���������8#�������!�/������%������#��'$�������$������������#����#��$���9�����$����$�������������������!����#��$�������������������9���$���$����#������+�����#��$������$�������������#��$���9��8�������������������$����$������������������!���H�����D�8��������$�������$�������������$��8������������$��������#��D�������#D�����������8����������

������"����$��.�� �'� ����/���������������������������������������#��$���9�����8�����������������������

Diagram 5: This process shows the use of a block activity to call out to an external application. The Get

Salary Authorization function communicates with the external application, and the process is blocked

until that application gives the command to continue using CompleteActivity.

'$��������������#���������$�����������������������������$��$�����8��������������8�����������������������%�8��!�������!�������������$������������������������!�����'$������$����������8����������������������$������������������������8#���8����!��$��������������#����$������������������#��$����$������������������$��������8�������������(���$���������$�������������������1��#D��$�!$D�����$�����������������������$��$����������$����������������#����������$����$������������������������'$�����������������������������!��� ����������#�8������������������������������$��8��!�������!�����$��$����������$��������������������$���$�����

Page 17: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17

Diagram 6: This process performs the same functionality as the process in Diagram 5 with the Block

activity. Use this implementation when you do not have access to update the external application and

so that application cannot be modified to restart the process. Instead, an API and Wait function are

added that check the outcome at regular intervals and only continue when a condition is met. The

advantage is that you do not need to update external applications, and your workflow remains

independent. The disadvantage is that the wait may cause an unnecessary delay in processing time and

add overhead to the background engine.

%��$�����#������������������������������������� ��������������������#D��$��$����������������������������!�������$�� ��������������"#������'$������������������������������������$���������������������&���������������D�����������������$����������������������� ���!�������"#� �$%� �������&'$(&��#����� �����������$�����������

Timeouts

'����������������$���������������!��������������������������#��������$��$��$���������#������������������������#�����������������������!�����������$������+����$������$������������������������������������

Diagram 7: The Node property tab showing a timeout of 5 minutes. The drop box for the Timeout field is

shown expanded to display all three timeout options.

Page 18: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 18

How Timeouts Work

'�����������������������$�������� ����������$���������#����H��������#���!���>����#����$���������� ��������'���������������$����#�D�$��������������������$�������������������D����$���(����%����8�������������������������������8�����'$������������8��������8���������D���!���#��!��$�����8�������������������D���������������D�������#��!��$���8����������������������%�8��!�������!�����������������$����������$�������$����������������������������������������8#�����352&(66B7,0(287�������������"����������#D�����$�����$��$����$������������������$���8���������������������������������������#��������#����$������������:$,7,1*D�6863(1'('D�127,),('D�'()(55('���D�����$���������#��������������������#D�$&7,9(��(���$������������������$���8������������D��$������������$���������#������������&203/(7(��7,0(287��&�����������������������D��$��8��!�������!��������������#����������!�������������C�$����$�����2��������������E�8#�������!��$�������������&$1&(/���&����������D��$��8��!�������!�����������#��$�������������8#������!��$�������������&203/(7(��)25&(�����������������#���������D��$����������!������!�������������������������������0����$������������������������8#�������!��$������������!����&203/(7(�����������#�����������#��������������������������!�����������'$���������$�������������������������!D��$�!$���#�����8�����$��!�����������8��������$�����������������������������8����

&����������������������#D������������������$����$��8��!�������!����8��������#�����!������C�����$��!���+������"�+���������E���

Timeouts and Notifications

����#�������������$�����2���������������������$������������K��$�������#�����������#����������$��!�����������!����D���!���D����$������������������������$���������������

Diagram 8: The Notify Approver process from the Oracle Workflow Requisition demonstration process.

���!����6��$���������������8�����������������!���������������0���$���$�����������������8���!�����<��$������������������������������!��������������������D��$��$�����������������������������������!��������$����������������������%��$����������������8���������������������������$����$���������������$�������������������$�����8���������������������'$�������������8�������#��������#�

Page 19: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 19

C���$�������������������8���E���$���1���������$������!���%�����������#D��$���������������������$��������#����$�������!���

Timeouts and Functions

%����������������$������������������������$���������#�����������#���8D�8����������������#�������������$������������:$,7,1*D�6863(1'('D�127,),('����'()(55('��������������������������'$������D��#��$���������������$����������$&7,9(��$��!$����$�������������������������D�8����������������������������������

'$����������!�������� ��!�������!�������������������������8��������������'$��8��!�������!���������������$�������!���������8#��$����������!�����������$����������!���������������������!������$��������!������������������������������'$����������������������������$������������#��$�����#������������������$�������8������������'$����#���#��������������#��$����������������������������������#��$�������8���������

'$�����������������������������$����������������������������������8����!�������������&���������D�#���8����!��������#���#�8��������!����������������������������D�8�����������������������$����������������$���������$����$������������'$������������$���#������������������������������!���������

Timeouts and Processes

�����������������������D����$�#���������$������������������������������>�����������$���������#������������������������������������������D��$��$���#������#�������������!������!������������$��������������!��$�����#�$��������������$��������������������!�����*�����.7��$�����������������!����������������������

Diagram 9: Example of a process for a typical notification that uses timeouts to generate reminders.

The loop counter is set to 9 and the timeout on the notification is one day. Therefore up to 10

notifications may be sent (the original and 9 reminders) before the process ends with a timeout result.

Page 20: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 20

Diagram 10: With the loop counter removed, this process will keep sending notifications forever until a

response is made. However, this process will perform the same functionality as the one in diagram 7 if

the process itself has a timeout period of 10 days.

�������&���$�������������������������D����#��$������������C����$���$��������������������������������$����������������E�������8������������(��#��������������������������������D������������$���#��$���������8#���������!��$�����������������C'��������$���������D����������������8����$���$���$�������E�3�����D�����$������������������#���������D����������������������#����$���������������������C����������D�����������������������E��������������$���$�������

Dynamic Timeouts and Dynamic Timeout Constructs

'���������������#��������#D����������������������#���������$��������������������#��������8���D��$�����������$��$�����8�����������������������'$�������$�����������������������8�����#��3�����D�#�������������������������$���$����$��������������������8#������!��������������$�������!���������$��$����'$��������������������D�����#���������������$���8�$�����������$������������#��$������'$��������$������$�����������������3�����D�������8�������������8������$�������������������������������D������������������$���������#����������������

Diagram 11: A dynamic timeout construct.

(�����!����..D�������1��������������������������������������������$�����������������D��$��$�����$������������������������8�����'$��������������$��������������

Page 21: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 21

����$�����D��������!���I����J�8��������$������������������$��������������#�C�$��$�����������$�������������������$��!$��$������������8���E���$��$������$�����������������������������$������������������$��������!��������C�����$�������+���������,������������E���

Timeouts on Business Days Only

/�������#��$�������������������������$�������������������8����������#�D�8��������$������#����#�8������������D���������D���������������(��#�����$���������#������������������������!�$������#D�#�����������������%�(�������������$����������������!������#���������������������$���������������#��������������

Subprocesses

%���#��������8�����������!���������������������������$��������������!����������������'$������������������#��������#�#����������������������������#����������������������&���������D�������������������������$���������������������������������������� ��$����$�����������!�#��������������������$���������D��������������$������������=�����������������������8��������

Diagram 12: This example shows the same activity repeated three times, once for the initial notification

and twice for reminders. In each case the same notification has 4 outcomes, each of which is repeated.

This can become very complex if each outcome leads to a very long thread.

Page 22: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 22

Diagram 13 shows the same process flow except that the notification has been dropped into its own

subprocess (see diagram 14), making the diagram far easier to read and draw. Note that the number of

outcomes in the lookup list has been increased to include the No Response option. Alternatively, you

can use the <Default> option to catch all unmodeled responses and process this result without

modifying the lookup.

Diagram 14 shows the Approve Notification subprocess. Note that we use a loop counter to simplify

sending notifications. By including the loop-counter value dynamically in the notification body or

subject, we can indicate that this is the nth reminder.

"�8����������������������������#�������!������������������#��'$���������8�������������8������������$���������������!���������D��$�!$��C%���8�����������������������!�������������E�+���!��$����8�����������������#����������������������������8�������������������C8��������$����������������#�8�����������������$�������$������$#�����EK�$�����D�����������������8���������$�����������8���������$��������-��������������%�����������D����������#�������������$����8��������

Page 23: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 23

Customization Hooks

%����������������������8�������#�������9����3�����D��$��������������#������������!���������������������$�����������$�����������$����������9�����D���������$�����#����������#�������������������������#D��$����������$��2����������8���������#���8�������������������������������$����������������������$�������%�(����

%��$�������������������������������������������������$��������������D�������!���������������9���$������������!�8#��������!���������8��������������$��������������$���������������������-���!����&���������������D�����������������$����������������������� ���!�������"#� �$%� �������&'$(&��#����� �����������$�����������

Embedding Null Processes

��8�����!������������������#������������������#��������$�������������������������9������(��#��������������#����������������8��������D��$���#����������$����8�������#���������D���������!������#����������1��������������$��$��$�����������������9��������������#�������!���$�8������8�����!���������������������������8����$��������!��������������D�8���������������������������$�����$�#��������$����$�����8��������

Diagram 15: Example of a top-level process flow where null processes have been inserted as hooks for

user customization and the main flow has been dropped into a subprocess.

Using Item Attributes

+�������������8������$���#��$�����������#������8������$��������������9������ ��$����$�������!�����������!���������$��������#���������D�#������$�����$��������#�����#��������������8�����'$�����������������#���������$���������!��$����������������������������������������$��������8�������������$��!$���#����������������������������������8�����������

�������$���������!�����������������8������������$������������������������8����8��D������8�������������$������������8��������#��� �:�D��$��$������!����#�������$��8�������������1�����8��������������#�������������$����8�������D�#��������������#�������$����$����$�#�������9���$�����������

Page 24: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 24

Loop Structures

%�����������������������������$��$�����������#��������������������������������������-�������������������������$�����������D�8��������������������������#��������$���8����#�����������������$����������!��$���$�����������#�8�����������������������������������

Processing Within Loops

'$����������!���������������#����������$������������������8#�����!����������������������������!����������$����$��$����$���������#�$���������#�8��������������%������!�������#��$�����$�������������������$�������$����������������#�D������������8#��$����� ����������!���

'$���������������#��$����������������������1����������������#������������$��������������#��(��������$��8�!�����!����$����1����������������!�������$��$�����������$��2���������������������$�������'$��������$������������� ������������#��������������$���������������#�����$�����1��$��������������#��

Diagram 16: The Details tab of an activity node property page. Note the On Revisit option, with the drop

box expanded to display all three possible values.

On Revisit Reset Option

'$�������$����������������(���������$����$����$����!�������������$����������������D���������������$���$�������������������$�����C����#�$��!��$����������$����������#��$��$�$���������#�8�������E�����������$����!�������&$1&(/������(����������$�������������������������������������'$������8����#����������������������!������#���%�(����������#���������$�����#�$����������������$������������������D������������#��(���$�����#D�#��$�����$���8����#���������������������#��������1������������'$�����������������#���������$���#�������������#������������$������8��������������������������$����$�������������$�����������1������������$������(��#�������$������#��$��!��������D��$�����!�������������������

Page 25: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 25

'$��������!����������$���$�����������%�(���$�������$�������������8���������

If (funcmode = ‘CANCEL’) then

… do cancel mode processing …

else if (funcmode = ‘RUN’) then

… do regular run time processing …

else if (funcmode = ‘TIMEOUT’) then

… only valid for vote functions …

else

-- there shouldn’t be any other modes

null;

end if;

On Revisit Loop Option

'$��:���������������������������������������#�8#����������!�������#1�����������������������&$1&(/������(���$����������������������#��$�����������$�� �����������������������$�����������������

On Revisit Ignore Option and OR Joins

'$����#��������������$��(!�������������$�����!������!�� �B���D��$��$����������������������������$�������!����� �B��D�#����#�������$���������#������$���$����������������8������������$��������������������%�����8��2���������������������!�����$����������$���$��������������������'$����#�������������������������$����������������������������

Common Problems

(��#��������$����������������������!�8��������������$��!D���������������������D��$����$����� ���������������$��������������#��(����� ����������������(!���D��������������$���������$��!�����$�������������������������%�8��!�������!�����������������$�����#�����$�����������$�����������$����������$��������K���#��$���������$��8��!�������!���������$������������������(5525����$������������678&.���

Notifications in Loops

0������������$�����������$�������������8����������������������#��'$��������������#��������!���������8������������������8�����������������������$�������������������������������������������8���������8���$��������!����������!��������8���������������������(����������#�������������$���������������8����������D��$���������$��������������������������D����$�����$�����������127,)<��������#��

Page 26: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 26

Exception Handling

�������$����B���������!����������������������������������#����������$���8����#����������#��������������������������$��������������!��$����������������������!������������!�����������������$���$������8���$�����8#��������������������������������!�����8������'$������D�����������������������������$������!�����!�����#���$�����#����������������

The Default Transition: Catching Unexpected Outcomes

(��#�����������%�(������!��������������������������������C���$�������������������������������������������#������������ED��$��������$����������8����$���$�����������$����������!�����������������������!���������������������������������&���������D�������%�(���������>�����0����������������������������$�����������������������D�#�����������$����������8����$�������$�����������������

Diagram 17: In this process, all unexpected return values from the Is Document Complete? function are

caught by the Default branch and logged by the Document Manager Failed function. With this approach

you do not have to include every possible outcome in the lookup type for the return values.

Default Transition vs. Any Transition

'$��8����������������#�������������������%�#�������������$����$���������#�$������������������������#�������������������#�8�����������������$�������������������$��������D��$����%�#��������#�������������!�����������$�����������

Using Notifications for Error Handling

0�������������������!�����������$������!��+�������������������������$���#�������������������D�8�����������D��$���������8��������D��$�����������$���8�������������������������������!��(�����������$�����������������2����������������������!�����$����$�������$���8������������������$�����������������������

&���������D������!�����2���������������D��$��"������-���!������������������$����$�������������!���������������$��3 ���8���D��$��$����������0������&���������� ��$����$��������������$��������D���������������������2��������$��3 �����������������������$�������������������$����$������������������>��������$�����

Page 27: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 27

�$������������8#�����������!������������������$��%�(���������������������$����$��$����$���������8����$���8�����������������$���#���������$������������(�������������������D����$���������������������D����$�����������������(����������������D��$������������������������$���������!���������������

Diagram 18: This example shows how a notification can be used to handle a missing data error. The

Continue branch is the only valid response, and it permits the process to try again. The Timeout branch

tries the function again if there is no response, to check whether the data error has been corrected by a

different source, or the user corrected it but forgot to respond to the notification.

Workflow Error Handling

��������������������������$������!����$���������������������$���������$����������������������(5525�������������������������������������!����������������������<�

• +�$�������8����$������������������8#��$��8��!�������!����

• %�#��#�������������$����������8����#����������������D�����������8��D���������

• ��!������������������������������������������

• ��������������$���������#�������������D������������D��������8#�9��D���������

���������������������D��$����!����������$���������#����������� � D��$��$��������������������!����$���������(����������������������������D����$�������$����������#�����#�$����$�!$�������$����������������#�$������$#D��$��������������������8�������$��������������������������8��������D�����������������$����������������������(��#��������������������D��$���������������������������'$���������������$����8���������������������$���1�������1����������������'$�������������������������������8#���������������$����8�������������#�!����������������$������������(�D�$�����D�#���������������#�����������$������D����������#�������$�����������������8��������������������$���������������������D�8��������$�������$����#���#�������1�����������$����!����������������������

�������������$���#�������$����&%+:'L� � ����������������8#������������������$���&L� � �������#����'$���������#������������������$������������������� #��������D��$��������������������������������$���#�����

Page 28: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 28

������������D��������!��$������������������$�������������2������!������������'$���������������$����$�������������#����8����$��������D�����������$����������������������������������D����$����������!��$���������#����$��������������������'$������������������������������#����������������$���������������������$���������������$�������������%���������#D����#����������������������8�����������&L%�-(0("' %'� ����#���������D��$����������������$��������8������������������$���#����������������������$���������������$������������!���'$�����#�#��������������$�������������������$���������������������#������������������#������������������#������D����$����$���$����!�����#����!������������$���#�����!��!������������

Diagram 19: The SYSTEM: Error generic error message. This message is sent to the system

administrator when an error occurs. Note that all the notification attributes refer to item attributes that

were defined by the error handling function in the errored process prior to calling this error handling

process. These item attributes are always set regardless of which error process is called.

Master/Detail Flows

������������H��"��������������#���������������������������������D�����&�&�������/������&��D��$��������������������8�����������������������=���������������$�����"����$������������������������������������!�����!�$���������$����'$����������������������"����#�������������C���������E�������������������������������=��������������������<��$�������#�����$���������������D��������$������������H��2�����������������������������

Page 29: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 29

'$�������������#���������������������=�������������D��$��$�$������8�����������������

Starting Children From the Parent Process

Diagram 20: Parent and child processes. The parent process includes an activity to spawn the child

processes.

(���$����������D��$�����������������������������������#����������$���$�������������������#���!����������$��������������#����������$�������������������!������$���$��������0����$���8��������������������������������������!�����������D��$����������������������������$��$������������������������$�������8���������������(���$�����������������������8��������$���$������D�#���$�����������$�������������$��!$������

0����$������#����$������������#��$��������������C���������������$��/������&����������#ED��$����$�#������8�������������������������'$�������������������$���������!�����8������������������������������

Starting Children from a Separate Process

Diagram 21: Parent with child processes started from separate procedure.

�$�������������������������������$���$������D����������������$�������$���#���������#���������1�$������������$����'$��������������������8�����$�������������������$��$����$��$��������������������������������������#�����$����$��������D��$���������$������������$��������$����C8��������$��������$����$������8����������������������#��ED��������������������/������&��D��$��������������������$�������������������#��'���������$��D���������$��������1�$������������$����8������������!��$���$������D�����$�������$��������������������8�����

Page 30: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 30

Example 1: Creating and starting each detail line individually

--set up and start the parent flow

WF_ENGINE.CreateProcess(order_header, header_id, process_name);

WF_ENGINE.StartProcess(order_header, header_id);

--set up child flows

For each detail_line loop

WF_ENGINE.CreateProcess(order_lines, detail_line.line_id);

WF_ITEM.SetItemParent(order_lines, detail_line.line_id,

order_header, header_id);

WF_ENGINE.StartProcess(order_lines, detail_line.line_id));

End loop

Example 2: Creating all detail lines first and then starting them

--set up and start the parent flow

WF_ENGINE.CreateProcess(order_header, header_id, process_name);

WF_ENGINE.StartProcess(order_header, header_id);

--set up child flows

For each detail_line loop

WF_ENGINE.CreateProcess(order_lines, detail_line.line_id);

WF_ITEM.SetItemParent(order_lines, detail_line.line_id,

order_header, header_id);

End loop

--now the relationship is established, start the children

For each detail_line loop

WF_ENGINE.StartProcess(order_lines, detail_line.line_id));

End loop

0��<�%����������������D�#���������������$�� ��������������"#�����������������$����������!�������������������D�8#�����!���������������������������$����������������$������������$����$��$����&���������������D�����������������$����������������������� ���!�������"#� �$%� �������&'$(&��#����� �����������$�����������

Selector/Callback Function

'$���������=����8�����������������������#��������$���#���������%�(��$���������������������9�������������$������������������(����������9��������������#�������������������!����$����������$��$����������������

• +0����<�(���$������D��$����!�������������$����������$���������!����������8������������'$��������#������������$��/������������%�(���������������$���������#��!��$����������������

Page 31: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 31

• "�'L/'A����<�(���$������D��$���������=����8�������������������9�����#��:="?:������8�����'$������������������������$������������������#�"?:�����������������������!��$�����������������������#��

When to Use a Selector/Callback Function

+����$�� +0������$���#�������������#������������!����������������!��$��$����������������������������$�����%�(��>����#�����������$����$���#��$���������$���������������$����������������������D����$���$���1����!��$�������������������������8����&���������������� ���������������� �������� ��������������������������� ���������������������'$���������$����������!���������������������������������������������$���������#��!��������������D���������������������������D�������$��������!����������������

+����$��"�'L/'A������������������#����:="?:������8�����'$������������$����:="?:������8������������#�����������#��$���������������$�����������������������������������������������������!���8���������8������$�������������������������������������!�!�8��������8������(����������1 ��������"����D�#�����������$������$��������#����!�������������$������������$���������

Restrictions

>���������������������=����8������������$������������!������������������������8���������8����������������8�������!!����'$������8������������������������8����������8����������������!��$�����������8���������������#�����$����!�������������$����������!��$���������=����8�������������$������������!����������������������8���������8����D�#����������������#��������$�����������������%������������������#����������=����8������������������������������������������#������������������������

Notifications

FYI Notifications

&>(�C&��>���(��������E������������������$����$�����2��������������������$��������(���$������8���D����&>(����������������������������������������$����������$������#�������������8������'��������������#D��$���������������������$�����$��������� ��������8�����$������

'$��������!�������������$��������������������������������������������!���$��!�&>(��������������

Page 32: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 32

select notification_id, message_name, message_type

from wf_notifications n

where not exists (select ‘respond attributes exist’

from wf_message_attributes

where message_name=n.message_name

and message_type=n.message_type

and subtype='RESPOND')

Expand Role

'$��������� ��������8�������������$�������#����������$������!��������������������#����$��������������(���$�����#D����$������������������$�������������������������'$����������$����������������� �����������$����D��$��$�����$������������$����$���������������$����D��$�����������������$�����8��������������'$����������$����$�������������������������$��������������������������������������$���������������������!�����'$���8�$��������������8�������$�������������������2����������!����������D�8������������������&>(D����������$�����2������������������������$������������'$����������&>(���������������������!��������������������������������������$���������� �������$�������

Response Notifications

0������������$�����2����������������������$������������������������������������8�����(��#���������8����$�#���������8����������������D��$���#���������������������������$�������!���'$��������������#�����������������8�������$��$������������������ �"+:'��%���������D���������������������8���������������������������8������'$�������#����������������$���������������������������������������$����������������$��$������������(���%����8����%�(���3�����D�8�����������$�������!��$������������8������������������������������������$���#�����$��D�#����#����8��������$��$���������������#���������������!D���������8����������#���������������!�������8��������2����

������'$�������� �������������������$�����������������������!��������������������8��������$���������������$������!�����������

PL/SQL Documents

%��:="?:�����������������������#����������!�������8�������$���#�����������������8�������#����:="?:��������D���������8����������$�������8���D�������$��������������������������8���������D�8������$��$�������������������:="?:�����!������������'$���������������#���������$���#��$�����������������������8�������������$�����������8��������������������������������������&���������D�������$���������$���������������K��$�����������8����������������$�����$���������� ��$����$����������!�#��������!���������������8�����������CP:(0�L.D�P:(0�L��Q�P:(0�L0ED�������������!��������8�����$����������������$��������

Page 33: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 33

CP�:"?:L��/E��%�������������������������$�� �2��������������������������C���������E��&���������������D������$����������������������

PL/SQL CLOB Documents

�$�����:="?:������������������������4�FD��������$����$�����������������������!������:="?:D��:="?:�/:� ��������������������������!������������������!�$�8��������$�#�����8��������$�����������!��8B�����C/:� �E���

�:="?:�/:� ��������������������������#��$������������������:="?:���������D���������$����$������!������������$�#��������������������/:� ������������������!��'$�#�$�������!$�����$�����8����������$��/:� ������#��D������$�#�����������������$�����8�����������������!�������8�����������$�����������������$��/:� ����������������$�������!��8�#��'$������D�#����������������D�����#��������������������������!�����������������$�����

'$��������!���8����$���������������8��������$���:="?:������:="?:�/:� ����������#�����

0���� %����8���������'#���

%����8����@������ "�!�������

PLSQL DOCUMENT PLSQL:package_name.procedure/

argument_string

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out varchar2,

document_type in out varchar2)

PLSQLCLOB DOCUMENT PLSQLCLOB:package_name.proced

ure/argument_string

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out clob,

document_type in out varchar2)

'$��0����������"#����������������������������/:� ���#�������!������������>���������#��������������$��������������/:� ��+����$��%�(��&L0�'(&(/%'(�0"������'/�8�����$����(�����������������$���#��8��������!�������!��C������$��4�F������E������$���������$���%�(���������$�������!����$��/:� D����������������$�����8��������������$���%�(��

'$��������!����������$���$�������������:="?:�/:� ����������

procedure Example_package

(document_id in varchar2,

display_type in varchar2,

document in out clob,

document_type in out varchar2) is

Page 34: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 34

build_string varchar2(4000);

open_td varchar2(5):= ’<TD>’;

close_td varchar2(5):=’</TD>’;

open_rw varchar2(5):=’<TR>’;

close_rw varchar2(5):=’</TR>’;

cursor data_stream (ordernumber number) is

select c.catalog_number, c.catalog_description

from parts_catalog c, customer_order_line co

where co.catalog_number = c.catalog_number

and co.order_number = ordernumber;

begin

build_string := ’<P><TABLE>’;

for data_rec(to_number(document_id)) in data_stream loop

build_string :=build_string||

open_tr||

open_td||to_char(data_rec.catalog_number)||close_td||

open_td||data_rec.catalog_description||close_td||

close_tr;

WF_NOTIFICATIONS.WriteToClob(document,build_string);

build_string :=null;

end loop;

-- if string is null, then it must have been written to

-- document, so we must add the close table tag.

if build_string is null then

WF_NOTIFICATIONS.WriteToClob(document,’</TABLE>’);

end if;

end;

Notifications and Attributes of Type URL or Document

-����!�������8��������#���+ :�����������$������������������������������&�����'��!�������%����$�/�������+���&�����'��!�����������#��$��������������������$��$�#��������$��+ :����������8��������#������������#��$���������������D�&���������D��$��$�������$���������������������#��$��������D�����������

������&���������������8����D��$��&�����'��!����������#�������������������-���!��������������D��$��$����������������#�������������������������

Page 35: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 35

+���%����$�/��������������#�����$������������$��+ :������������$����8����������������������$������

• (��#���������%����$�/������������:="?:����:="?:�/:� ��������������8���D��$���#�������#�������������������$��0������������8���!�D�#��������������������������!��$������������������!��8�#��$���������#���$�������������$�������$��������!�������8�����$���#�����������(��#�������#�������������������1����D��$�����������������$�������$�������������#���������!���#����1���������������������������������!��

• (��#���������%����$�/�����������+ :������8���D������������������������������$������������0���������� �������������$������������������!���'$���attachment includes a link to each URL attribute for the

message that has Attach Content checked. You can navigate to a

URL by choosing its link.

Note: You can both attach and embed (by token substitution) Document and

URL attributes in the notification message; you are not limited to one or the

other.

Diagram 22: Defining the Frame Target and Attach Content options for a URL message attribute.

Inline Display vs. Attachments

'$�������������#���+(D�8��������!��������D����������$����������$��������������������������$��8�#����$�������!�������$�������$��������3'-:�C���$������3'-:��������������!������������$�����������3'-:E���

���������$����$��0����������-������$������������$���������������������#����������!����$������H���1��������������������������D��$�����������#��������

Page 36: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 36

3'-:1��#����1�������������������&������������D�+ :������$�����������������������$�������+ :����$��&��3'-:���#�������D��$��-���������������$������������$����������3'-:���������������$�������$���1�����������$#��������#���'$���$��������������2������<�

• "������#<� ����������������$#��������#D��$��������������#���������$��!��$������8�$����������������'$�����#�8��8��������������������8�����������#�$�9������������!����$������������$�������!���

• ������������<�%!���D�8����������������$#��������#D���#�������������������������$���������������$���������������$�������������$������������8����������H�����������$���������������������$������'$����������������#���������������!�������������

• 0�13'-:������<�'$�������������8���$#������#������D�8����$�#������8�����������$����������!�3'-:�����������1������������$�#�����3'-:��'$����������������D��$��$���������������D�����������$������������!D�������8��������������������������������

Notifications with a Single URL Response Attribute

'$��������������������������������#�������#��$��+ :�����$�����������������(���$���8�������$���������8����#����$��������#�����8���!������!����8������$����������!������#�����������������������$���������������'����$��D�#�������������$�������������(�������������������#�����8���!���'$�������������������������������8��������$����������N0(���'$��������!����������$���$����������������8����������������������������������(���������!���+ :��������������8���<�

• %����8����'#��<�+ :�

• %����8����@����<������������=�#L��8L��!�,���R1PN0(�1�

�����#��$�����$�������������(�D�#������������$���������������0����$�����L��������������������������$������L�#���D�����L�#�������������������!��������������D����1���������������!��>������������#�����������������8��������$���L������������"��%����%�(�D���������!��$�� �"+:'���������������#����8����$��!D�����������#����������$����������������$���L�����������������C���E���

'$��������!����������$���$���������������������������

Wf_Notification.SetAttrText(nid,’RESULT’.’Y’);

Wf_Notification.SetAttrText(nid,’ATTRIBUTE1’,’My response’);

Wf_Notification.Respond(nid,my_response_comment,responder_name );

Post-Notification Functions

%����1����������������������������1�����������������$�����������������������������������$��!����������'$������������$������������������������������

Page 37: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 37

!���������#���������������$�������������������������%�#����������������$���������������������������$������

Example Uses

+��������1��������������������$���#��������������������������D���������������������������������������������

• @��������������!��������<�(��#������������������������������#�������!�����D����$������������������!����D�#����������#��������������!���$�����+����$�������������������!���������������������#����������������

• ������������������������������������!�����<�%�������!��������#��������#���8�������������������������8���������������������&���������D�������$������������������������$��������������������#���$������$#������8���$�����������2������8#���������!������8��������$�����������������!��������$����!�������������S������!������$����$����$��������!��������S������!����'$������D������$�����1������������������������������#�����������8������$���!������$������������!�����������D�����#��$���������������������!��

• @����������������������<����$���������������������!������������#��������������8�������������$��$�����1��������������������'$�������������������8���8����������������#�����������$��������������������$�����1���������������������������������������#��

• +������������#�����������������$���������!����������<��������������$������������D��$�����1���������������������������������$��������#����$�����������������������������������0�'(&(������$����!�����(���$�����#D��$����������������������������#D�����8��!�����$������S����������'$������$�������#���������������������������$�������������#�������8����������������$����$����1������

How Post-Notification Functions Work

%����1������������������������8����������$�������%�(����������������!������������������������C����������0�/1���2�$ �������E��'$����������!�����������$���������������������������������������������������������������� #���������!��$������������C�������ED�#��������!��������������!���������$���������$��!���'$������������$���8������

&+0/-���� �����������

�"��0�� &����#���������!������������������

&� �% �� &����#��������������$��������1�������

' %0"&� � &����#��������������$����������1�������

Page 38: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 38

&+0/-���� �����������

+0� &����������!�����!1��#�����������!��'$������������������������8���$��!����������������$�����

������'$�������������������������=������=�����������������!D��$��$������$����������#�8��������������

'(-��+'� "������� +0�����8�����������������������#������������������������

'$����������!�������������:="?:������8�����������������!��$�����1��������������������>��������������$���������8�������$���#������������

• �&L�0�(0��������L���<��

�&L�0�(0��������L����R��$������������L(���+����$������������L(����8�������#�����������������'$���������$����8�������������������������������#������8����D��������$���&L0�'(&(/%'(�0����%���'����%�(��

• �&L�0�(0��������L����<�

�&L�0�(0��������L�����R��������������L���D�����$�����1��������������������������������&� �% ����' %0"&� ������'$��������8�������$�������������$��$��$������������������������=�������������

�&L�0�(0��������L�����R���������D�����$�����1�������������������������������� �"��0�������

����<�'$����������������������������������!����$������������������������$���������������������������(���$������������������������!��$��0������������8���!�D��������������������$��������������$������������(���$��������������������8#��1����D������������������������<��������L�����L���������

Post-Notification Function vs. Notification Followed by a Function

+��������1��������������������$���#����������������������������������!���������������D������$�������������������8��2�������������!��!��$�����������������!�����8���������������#��'$������������$����$�����I����������J���������8������������%�����������#D�#�����������$���������������������8��2���������������������8���������������$����8���������!����������$���������������9��������������$��!�������

Voting

@���!��������1������������#�����$��$����������������������2�����!�����������������������!�����������D������$�����������������������$�������������$������������������������������������$���������D��$��������������������8����$��!����

Page 39: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 39

Diagram 23: A voting notification. Note that Expand Roles is selected and the Function field is filled.

'�������������D����������#���$���������� ��������������#�����������������������������������$���#�������&L"'%0�% ��@��&� �����'#��D��$��$����������������� ����������������������3�����D����#����������������#������%�(D�#�������������$����������#��$�������������������������#D������8�����������$���������$�����$�������������$����$�����������������

Diagram 24: Drawing a process with a voting activity. Note the Tie and No Match branch options.

Page 40: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 40

Lookups

:������������������������������$���#�������������������$�������#����3�����D�������������������#������������D���#�������$�����$���������������#����������������(�����!����������D��$�����������!����!������������$����#�������#���D�������������������#��������������#��������B����#��������C�������������D��������������������E��'$�����#D�#�����������#��$������������$�������������

&���������D�����������������#���AAAL"��������C�$����AAA����#�����������$�������E��'$���������#����������#�$��������������(��#��$������������������#���D����$��$����!��$�����������D����$����$����$����!����$��������$��������������D�#����������!�����������#���#���AAAL"��������������#����

�������"$����!������#���������������������������������3�����D�8�����������$���#�������������C��������E����������#��D�8��������$����������������������������$��������#�����$��������$��������#����&���������D�#����#������������I-���������������2�����J������%�����= �B���������#����>�������$�����������������������$��8����$��!��!������#���������#��D�8���#����!����$����$���������#���������$����!��$������������0����������#�����#����$��$����������������$���$���������#�����$���$�������8�������������'$��������8����������������������������$����!�������������������

Attributes

%����8������������������������������!���������������'$�#���������������������#���<�����������8����������������#������8������>����������������8�������������������������8��������������#���������D�����#�������������#������8�������������9����������������������#��������������

Item Attributes vs. Activity Attributes

����������������������$�����������������������'$����������#������!�����������������������!��$��8������������������������������$�������������8���������8����������������������%���������D�$�����D��������������������$������������$��������������������#����!���������������$��������#��D����$�#��������������8���������������'$�����������������8�����������������������$�����������#������8�������������!�������������

Item Attributes

(���������8������$����8����������������������������������!�8��������8�����'#������#��$�#�����������#��#�����������$���������������������������������#�������������$������8�����(���������8������$��������������������������������������$��������������$������8�������$����$�������������������8��������!��$�������������#��������#�!�����������C������#��#��������$��!��E��

'$�!$��$�����������������������8�����������������#��#����8B���������$������8���D����$��������������������#������$�������$���#������������������#��������#��&���������D��$����������������������������#���#�8���������

Page 41: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 41

�������D���#�����������������������������8�������������$����������������B����8�������������!��$��������������(���������8�������������8���������������#����$���#����������������������$�������!�����������8���������$���������D�����������$�#��������������B����8������$�#����������������������������������

(���������8�������������������$����������8�������$���������������������������$���#��������������������(������D��$�#���������$��8������#������������������������������������������#���������!���!�����(��#�������#������������������������������8����D��$��������!���!�������������������������������$�������!��$�����(���%����8����%�(���

Changing Activity Attributes at Runtime

'���������$������������������!�����������#������8��������������D�#������������������������#������8�����$���������$�������������������������������8������������������>��������������������������$�����������$������������8���D������$����$��!�������8����������������$���������������$���������#���

%�������������$������$��2����������$����3� �����������+�����������C�����8��2�E��'$�������������������������8������������!����������������� �$��$������������8���������$������!���������������������#������8������

-- Get attribute name stored in activity attribute

-- with internal name ‘ATTR’

aname := wf_engine.GetActivityAttrText

(itemtype, itemkey, actid, 'ATTR');

wf_engine.GetItemAttrInfo

(itemtype, aname, atype, asubtype, aformat);

-- NUMBER value

if (atype = 'NUMBER') then

wf_engine.SetItemAttrNumber(itemtype, itemkey, aname,

wf_engine.GetActivityAttrNumber

(itemtype, itemkey, actid, 'NUMBER_VALUE'));

-- DATE value

elsif (atype = 'DATE') then

wf_engine.SetItemAttrDate(itemtype, itemkey, aname,

wf_engine.GetActivityAttrDate

(itemtype, itemkey, actid, 'DATE_VALUE'));

-- TEXT value (VARCHAR2, LOOKUP, FORM, URL, DOCUMENT, etc.)

else

wf_engine.SetItemAttrText(itemtype, itemkey, aname,

wf_engine.GetActivityAttrText

(itemtype, itemkey, actid, 'TEXT_VALUE'));

end if;

Page 42: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 42

Start Activities

When are start activities really Start activities?

%�"������������#��������������#��$���$�������"����=���������8��������������������#���!��������67$57��'$��������������� ����������������������"������������#���������$���������!��������������$�������������������>������������#��������#���"������������#D�8����������������$���#�������$�����������"����������������:)B67$1'$5'������$��������#����������������������C"���������0�!1����+������+�$ ��������E�

Multiple Starts for a Process

>������$�������������"�����������������D������$�#���������8������$��8�!�����!������$������3�����D��$����������!����8�!������������!�����"�������$�����������$��8�!�����!������$����D�8�������������������$���"��������8������������$����������8�������������$���L��!����/������%������#���$���#��$�������������"��������������������$��8�!�����!�����$�����D�#������#��$��������������������8��������$��K�#����������������$��$�����$����!������������������������

Starting a Process Midway

>��������������������������������8#�������!���L��!����/������%������#�������������L��!����"������������'$���������#�#��������#������8����"������������#����$�����"����=���������8����������"������

End Activities

When are end activities really End activities?

"���������"���������������D���������������������$�����$����"����=���������8����������(1'���>�����������������������8��������������$�������������������D�8���#������$���������������������������D��$�����$�������������8�����������������������$�����������

������������� ������������������$���#��$���������������������������#K�$�����D�������������������#����!����'$������D�����������D����$�������#��������$�����!������������#����$����$�����������������#��C"����$��4��+��+��� �#� �������������������������$���������$��!��!��$������E�(���$���$������������$����������$�����������$����D��$����$���������8��������������$����$��������!��'$������D�#���$��������#��������������������#������������������$�������

Stuck Processes

%�������������������������678&.�8#��$��8��!�������!�����$���������$&7,9(�8�����������!�������#�����$����'$�����#�����������������#���������<�

Page 43: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 43

• &���������<�%��$��������$������������������������������#��$����������������(1'�����$������$����������#����������������D��������$����������#������������0����$����$�� �����������������$���#��$���������������������������#D�8������������������#�#���8����$��!��!�������������!����������1�����$���������

• :�������<�%�����������$���#�����$���������8��D�8����$��������������#�$������ �������������(!�����

• +���������������������$�����������8����$<�%���������%�(�����������������������������$���$������8����������������$��������������������$��������'$��������$�����������$������������������#=��C��������E�����������>=0�C���������E���>��=0��

�����������D��$��8��!�������!�������������$�������������%/'(@����"'+/F���������������$�����������������������������

Background Engine

'$��8��!�������!����������:="?:�����!������������$����$�����$�����������$�����������������8���������������#���������������D�����������D�������������������!��"����������#D���8��!�������!�����$������<�

• '�������

• "�������������

• ������������������C��������!�����������������������������������$�������!��������$����$���$���$������E�

&����������������������#D������������������$����$��8��!�������!����8��������!���������#�����#�����$�����#�����#����������$����$�����������������������������������$�������������������������$����������$������'$����������$����$����������������!���������#���������������������������8#��$������8���������������$��8��!�������!�����&���������D����#���8��!�������!�����������8�����������#�$��D�#���������������������������������������������$�������8��!�������!����������������$�����������

%�8��!�������!����������������������������������������������!�����$��$��������������8�������������������2�����D����������$��$������'���������$��D��$��8��!�������!�����$����8������8�������������2�����������������

Deferring to the Background Engine

'$���������$������#�������������$��8��!�������!���<�

• %������#����<�%������!�������#�����������$���������#������8����$����!�����$���$�������C�������������������7E���'$������������$����$��������$����������#��������D���������8������������3�����D�����$������������������#�����������$����$������$��$���������������

Page 44: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 44

• %������!��$���$���$�����������������<�%����������#������������L��!�����$���$�������#��������%����������$��������������������7D������#�������$���$���$���������G.D�#����������$�������#����������������#��������������>����������������$���$���$������#�$�!$�����������$�����$��!��������������>������������8������������$���$���$��K��$��������������������������������$�������������8������������'$������$��2��������������$���#����������������������������$�����������������#�����������

• +����$��������'$���������������������#<�'$�������$������������������#����������������$������(������#�����������������8��!�������!������������������������#�8���!�����8#���8��!�������!������

Parameters

>�����������$��8��!�������!���������������#�����������������������#�����������#����$���$������!�������������#�����8���������������������������>�����������$����$��$�����$�������������D��������������������D������������������'$���!�����#�����������8����#������$������!���

'$��������!������$����$�������������������$��8��!�������!���<�

procedure Background(itemtype in varchar2 default ’’,

minthreshold in number default null,

maxthreshold in number default null,

process_deferred in boolean default TRUE,

process_timeout in boolean default TRUE)

process_stuck in boolean default FALSE);

������'$��8��!�������!�����$����8������8#��������������������8����B8��(����������������$�����������8������������$������������$������������������$�"����������D��$����$��������!���!�����������������������D���������!��$��8������������������!��������������

How Often Should the Background Engine Run?

(����������������$���#���8��!�������!����8������8�����������������#��������������2�����������(���������������2�����#������������D��$����������������������������8����������D�����#������������������������$��!��'$������������8����������������$��8��!�������!���������������$�����������#����������������3�����D�������8����������1�������������2�����#��$����������#D�8��������$���������$������8��������������K��$����!��������������������9�������������������D���������$���������$��!����������D�����������&���$�����D����������8��!��������������������$�����$�������D���������!������������$��!$������

(����������1 ��������"����D���8��!�������!�����������#��������!������������������!�����

Page 45: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 45

Commits

No Commits in Workflow

�����������������������������#���������(���$�����#��������8�������������B�������$���%�(D�������!�������������8����#����������$��!������$��������!���!�����'$����������8�����$����������!������$��������8����#���������������������D��������!��$������$��������������������������������������

Can I Commit in a Workflow Process?

>��������������������$���������������������������!���������������������$����������!���H��������������������'$�����������������$����������!����������������!�����������8�����$������������������%��D����������$�����������������8�������������8������$�������8������������������������!��'$������D����$�������8����������D����$������8��!�������!���D���#���������������!��$���������#�����������#D�������!������������#�������������������������������

&����������������D�#�����������8�������������������������������������������$����������#��'$����������������$�������������������������������������������������'$������D����$��������#������8�������������8����������

Autonomous Commits

'$�������������8�������������������6������$�!$������������������������������ #���8�����!��$�����!���%+'�0�-�+"L' %0"%/'(�0����#�����������D�#���������������������������8����������������#����$����������������������������������$�����������������������K�������$D�#����������$���������������#�����8�����$��!����$�����������������$��������������8����������#�������������/���2�����#D�#����������������������������!������1��������������������������������������K������������D�#����������������������8������>����������������$��������8��������$��������������$������#���8������������D�����8�������#����#�$��������������������$��$����������������

������������������������������������������������#��������������������������#��(��#����������������������D��$�����8���#���"?:��������8��������������������������������������8����'$�����8��������������8������8�����8���!��������%���������#D������$����������������$�������������8#������!�8����$����������������������������!��������������� � ������8���������������������8#����������������������8��������8��D���#��������������������#���������������#��!�����������$������!��&���������������D����<�%�������'����������D��������� �����-���� ���

Page 46: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 46

Diagram 25: Example of using autonomous commits. Note that Workflow calls a standard package

procedure, check_customer, that computes all necessary variables and then calls the autonomous

block. The autonomous block cannot reference or set any variables in Workflow. Its function is purely

to perform DML (in this case, create a customer) and nothing more. It must also be capable of being re-

run.

How to Write Re-usable Activities

(��#�������������!����������������$����$�#�����8����1�����8#��$������������D��$�#������8���������������������#�������9�8��D��$��$��������$����������#��������#������8����������8��8�����#��������(�����#D����#������$���������������D�������8������$�����������#������8��������������������������8�����2���������������������C8��������������#������8�����������8��������������������E��&���������D��$��:���L/�+0'� �������������&L"'%0�% ����2�����������������������8����������������������D��$��$�����#������������$�9����'$��������������8�����$���$���$����������������������������$����$����������������8�$�����8#��$�������8�����3�����D�����$�����������������������$�������8����8��������������������������9�8��D��$���#���$������������������������������������&���������D��$���%('L&� L&:�������/�0'(0+�L&:����������������&L"'%0�% ��

Page 47: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 47

$��������������$��$����8����$�����8�����������������������������������������$���������9�������

'$��������!��������������$���$���������������8�����������������������������������������������#������8�����0�����$���$������������8�������������������$��$���������#�(������������$�������������#������8�����������$����������#��

loop_count := wf_engine.GetItemAttrNumber(

itemtype, itemkey, ’LOOP_COUNT’||’:’||actid);

exception

when others then

--

-- If item attribute does not exist yet then create it;

--

if ( wf_core.error_name = ’WFENG_ITEM_ATTR’ ) then

wf_engine.AddItemAttr(itemtype, itemkey,

’LOOP_COUNT’||’:’||actid);

loop_count := 0;

else

raise;

end if;

Page 48: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 48

APPENDIX A: NAMING STANDARDS

'$����������������8���$�����$�������������$���������8B�������������������������������������

General Naming Standards

'$��������!��������������8B�������2�������������1����������������

• (�����#����

• (���������8�����

• :����#����

• :��������

• -����!���

• -����!�������8�����

• %����������C��������D���������D������������D�������E�

• %������#������8�����

(���������D�������������������C������������$��������������$�����!���������������������E�������2���������8����'$�����8�����������������#�!��������D�8�������8���$��!���8#��$��������

'$�������������������������������������������$���!�����������$���8���8B������"����������������#�8#��$���#�����8B���D�8����$��������!���������������#�!�������#�������������8B������

General Standards for All Objects

Internal Names

(��������0�������8B���������������#�4718#��1�������������!���%���������������$��������#������������������$��$����6�8#������������� ���������$�������������SNSD�STS�����S<SD��$��$������������������������������������(����������������������������������������������������������D����������������������8�������#��$��!��D�����$�#�������������$��������#��#�����$��8B������'$�#�����!�������#���������8#��$����������D�8����$����������8���$������������#D��������$�#���������������8����

Display Names

������#������������$�����1����1����8���������������������������8B�������'$�#����������������������������������������������#�����������6718#������������������������������!���$����������������#���!���������8����$���������0���������!��$����������������������������#���������#�8���������������#�������

Page 49: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 49

Object Naming Standards

Item Types

Internal Name

'$������������������������$��������8�����2����������������������+����$��������$����8#����$�����������#���������D������$������$��������$���������������$���#���������������8B�����$����������!���8#��$�������������������0����$������������������������������$�������������������

• ��<��O�� �?OD�O3 �&&� O�

'$�������$���������������������������������$����$������������9�������#�6�8#�����'$�����������������8��������$���������������������������$��������#��#���������#�����#���������8����"������$������������8�����������������������D�����$����8�������$����

Display Name

%�8��������������$��8������������������������������$�������$����8B�������$���������������C67�8#���E��-����$������������$����������8��D�8���������������������!$��$����$��������������������$��$���������#�����&���������D�O �2�������O��������!��D��$�����O�����������$���������� �2�������O��������!�C������$�!$����������$����$��67�8#��������E��

• ��<��� O��� �2�������OD�O3 ������O�

• ��<�� O �2�������OD�O�����������$���������� �2�������O�

'$������������������������#�����#�����������������������������������!��9�������������

Item Attributes

Internal Name

'$�������������8�����������$���47�8#����������D��������:="?:��'$������������������������$������$��$��������#������������#�$��!�������'$�����������������$����$������������$��������#����"$��������������������������$������D�8������������������$��������������� �������������������#��$�������47�8#��������������$����������!��

• ��<��� �?L%-�+0'�

• ��<��� �� �?L �?+("('(�0L%-�+0'�

0����$�������$�������������������������������8����8�!�������$���������CS�SED��$�������8������������8������8�������$��������-�������(��#����������!�����!������������������������������$��������-����D�#����#����$��������$������$��2�����$������������������������8������

Page 50: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 50

Display Name

• ��<�� �2��������%�����

%!���D��$��������������������������$�������#���������$��$��������#���������#��������F�������������$����$��������#������������������$����������������������������������!���������������8�������%������������!��������$��$���#������������$������������$�����������#�8��������������������!���$�����$�� ��������

Lookup Types

Internal Name

&����<��U(���L'#��VLU:��L�#��L����V�C47�8#���E�

3��������������������$���#������������������$���������������D�8��������������#��������8��!�8���#����2��D�������$�!$��������������������$����������#���������!!�����$���#�������$��������#��������������D�������������$����������$���������

• ��<����&"'�L ��:�%0D��� �?L"'%'+"�

• �F<�� ��L"'%'+"�1��$����$�����8��������������������#�����

• ��<��� "'%'+"�

Display Name

&����<��U������V�U'#�������V�C67�8#���E�

'$��������#�����������8��!�8���#����2���������������#���D���#���$�����$����������������������������#�����'$���8�$�����������������������������������������������#������8��������#����!��$���������$�8�������#��������������'$��������#�������$����8�����!����D�8��������������$����������$�������C������������������������������8������������������������#�����$�����������������E���%�!�������#���������#�������������!������������������$�������������������������������������

• ��<�� ��� �2��������"������

• ��<�� "�����D���� �2��������"��������

Lookup Codes

Internal Name

'$���������������������������������������47�8#���D�8�������$����8�������$��D��$����������!�������!��������!����$��������������(����������8����$�������#����$�������8�����������������$������

• ��<��� %�� �@�D� �;�/'�

• ��<� %D� �

• ��<� %�� �@��/%0�(�%'���&&� D� �;�/'�/%0�(�%'���&&� �

Page 51: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 51

Display Name

'$�!$�#���������������������67�8#���D������$����8����������������8��������$�#�����������������������8���������������!�������������$������������������������$���������������������8�������$������������������������

• ��<��� %�����D� �B����

• ��<��� %������/��������������D� �B����/���������������

������%���#�����������������������8�����$����$�#�����8��������������������������������������

• ��<��� %�����D� �B����

• ��<��� %������D� �B������

• ��<��� %������D� �B������

Messages

Internal Name

'$������������������������$�������!��������������������$���#�$��!K��$�#���#��������8�����2������$����$��������#�����'$��������������8��������������������$�������!���������������������������������$������������������$��$��$�#������������

• ��<�� /�0&( -L %��:L��:(@� >D�0�'(&>L"+ -(''� L�&L �;�/'(�0�

Display Name

'$���������#�������$����8�������������������������$��������#���������$������������������������������#D����������#������!�����������#�$��������������-����!��������#��������$����8�����8����������������������8��D�����!����������������������$�������+���!��$��&>(�����������$��������$�����������������#��

• ��<�� /������ �!����������#D�0���#�"�8��������� �B������&>(�

'$������������������������$��8����������������������$������!��������#��������-����!���8���!������������#��D�������������$������������D������������$�#����������$��������#������������#��

Message Attributes

Internal Name

-����!�������8������������������������$��������������������������8������

������'$����������!���������� �"��0�������8��������������$������������8�����������(���$��������������8�����������������#D��$�#������8����������������$��$�������������'$������D����������#�������$��������������8��������$��$����������������������������#����������������$�����������$�� �"��0�����������

Page 52: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 52

Display Name

-����!�������8����������#������������$��������������������������8������

������-����!�������8����������#���������#������������$�������������������������� �"��0�������8����D��������8�������&� -�����+ :��#���������

Description

%�����������������#���������#���� �"��0�������8�����8�������������������#���������������������$�������������'$������D��$����$����������8��$���$���������������8���������������$������S���������������

Activities (Functions, Processes, Notifications, Events)

Internal Name

'$������������������������������#�������������������$���#�$��!<��$�#���#��������8�����2������$����$��������#����0����$����$���������������������������������������8��D��$��$������8������������$�����������$���������#������������������%�(����"������$���������� �#� ��D��$�#��$����8�����������������������$�������

• ��<�� ��'L-�0('� L+ :D�/�0&( -L %��:L��:(@� >�

Display Name

%������#�������#��������������������8����$���������#��������������������!�����'$�#��$����8�����8����������������������8��D�����!����������������������$�������

• ��<�� /������ �!����������#�

Label

'$����8��������������$��������#���!�����$���������#�����#��$�������!!����������#�����������(������������$��������������$���������#����������8�����2����/�������#��������������������!��������������������������������!����%�(�D��������#�8���������8������$������������/���2�����#D�#���$�����$���������D�������!�����$������� #��������D��$����8�������$�������������������$��������������������������������2��D�8���#���$��������#���$��!�����������$��!�������!������

• ��<�� ���1"������D����1&�������

• ��<� ���1.D����1��

Activity Attributes

Internal Name

"�����������������������8������

Display name

"�����������������������8������%������#������8����������#����������������������������$�������$���������#������8�����������������#���!�D����������������������������$��

Page 53: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 53

�������O���������O�����������8����������#���+�������#�����#�����������������������$�����������������$���������������������D������$�#����������������������$����2�������������#������8�������������-��������#���������#��������������������������2�����#�������������$����$���������#���2����������������!�������������

Page 54: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 54

APPENDIX B: DIAGRAMMING STANDARDS

�������$������������8�������������������������������8����#��������#����������#�������$������H��8��������������������������������!����+(�����!���D�������������� ��������/���2�����#D������#������������!�����$����������������������������������������������������$�������8������������������������

&���$�����D��$�����!�������������������������$���������������D�������������$����������$�������!����D�8������������8�������������������!��$��������-������$���������!��$����!��������$����������'$�����������������������������8����������!��������$�����1���$�����������������8��������!��$�����!�����$��!$��$��-����D��$��$�$���������������������9����8�!!����$�����8���������������

'��������!��������������������������������������D����$�����$��������!������������

Keep to a Grid Structure

• -����������!�����������������������#��$�����������������D��������������!�������!����������������������������������$��$����'$���$��������������������������������$���������

• -��������!���������������������8�����#���������������������������#�������!��������!��!�8����D������#������������$�����#��$��!$��$������!���$���D������H������#����$������������#���������

• F�����$�����������������!��������������!$���������������������8����$������������!��D�8�������$�#�������!D��$���������$����������������������������!$�����$�����!������

• @��������#����!������!�����������������$�������������8����$����&���������D��$��I0J�8����$���������������#�$�����$�������������O0���#�+������&������O�����O���������������8���OD��$�����$��I>��J�8����$�$���O0���#�+������"������O�����O+����������8���O��>���$����������$��I0J�8����$����!������$��I>��J�8����$����������$������!�����������!�������$��������!�������$����������������������$���$�����8����$������������

• F���������������������������������!��������$����������$�����!���D��������������������������������!��������$����!$���'$������������$��������������1�1��!$�������$��������������#���������3�����D��������!��������$�����2������������!��

Use Appropriate Icons

• /$��������8���������%�����������������#���!������������������!D����$�����������#��&��������9��#����������������$��$���������������8#���������������>����������#����������D�8����$��������������8����#��>����������������������!��������������$����������$�������������$��������-�������������#��C&���������������D������$��������

Page 55: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 55

�������������E�(���$��������������� ������������������#������D��������������������$�����������������������C8�������$�8�����!�E���

• /$�������������������+����$�������������������������������$��!$���#����������'$�����B��������������������!��!�����$���������

• %���#�������$���&"'��"�������������������������'$��������������������<��

o +���!��$�����������"��������������������������������#�����������������D�����!��$������������������

o +���!��$���&"'��"���������������������������������$����$�#�����0�1�����$������������#�$��!��������������#�������������$�������'$�����#D���������������$�����$�������������#��!���������%�(��

Position Your Icons Logically

• F������������8����$��!��������!��$����&���������D�����������$��0��������������D������!��$����!��$��D������$����������$��>�"�����������S���������������$��������K��$���������8����$�����!���$��������

• -����$��I�������J����$�#���8��������C$��9��������$E�����$��������������8����$��������

Avoid Excessive Scrolling

• %������!��������$���������������$���#������!���D����������$�#�����$���������������#����$���������������$��������!$��� ����8����$������!�����!��������$��������-����������������#�����8��D����������������������'$��������������!D��$�������������������������������(���$��������$�����$�����!����������!����$����$��������-����������D�������8�������������������$���������#����������������#�����D���#����#�����������$���������������������

• �$�������������D������$���������������������������������$�������C������������$�����������������8���E��'$������������$�����!����������!�8����$���$����!�������������!�������B������������������������������$�����!�����>���������������$����������$������!��!��������������!$�������!���D��������#�������#�����������8�����

• +�����������������#���������������$��������������������9����!�����$������$��������!K��$��������$�#�8�����������!��8�������$��������-������'�#�����������!����������������D�8��������������������������������8�����(�����������������������#���������8����#D��$���#��������������!������#�������������(���$��������#�������$������8����#����������������8�����������

Page 56: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 56

Simplify Your Diagram

• ��������#�I$��!��!J��������������8�������2���������$����$������� ���������������8����$��!����������$������'$���������!���������#����������!�8����#����$��������������$��!���C"����$��4��+��+��� �#� ���������������������������E�

• +����$����1��������������������������������$��8�����8����������������2�����������������$�������'$�������������������$����8����������������8����������0����$���#��������#������������������8������������������������������&���������D����#����������8����������#�����1���������!���D��$���������8�������������8��������!��������$����������!��������#���8�������������������C"����$��$����������������������������������E�

• +�������8����������������������������$���������������2����������������$��������$��������������������������8�������!������������$���������

• ������������������������������������'$�����$����8��$�������8#��$����������!��������������$����������������$�����!������

• %������������!�01������������'$������H������#�$��!D����$���������#��$����H��8����#����������$�����������$�#����������������$����������������������D����$������������������D����������"���������������������D����������������������������

Page 57: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 57

APPENDIX C: NOTIFICATION STANDARDS.

Subject Line

• �$�����������!������������������8B��������D������$��������I&����L�����:���L����J����������������$������������������$�����������D���������������$�������(���'$�����������������#��������#���$���#��������������8�������#��� �:�D��$��$�������������������$��������#�������

• �����������$����8B��������$��������$�������!��������������������D��������$�������������������������������������������$��������������$�������!��8�#D��������$���$����������������������������������������$����8B�����������(��!������D��������������$����8B�����������������������$�������!���&���������D������!�����$����2������H�����������$����8B���������$�����������$����2����������������������$�������!���������#�����������!��������������������$�����������������

• ��������#�$��!������������������$���������!��$��!$��$���������!����8�D�����$����8B����������&���������D�������������������8����������$����2���������$�������������������������D����������$����2������H�����������$����8B������

• �����������

Message Body

Send Section of Message

• +���8���������������!#������$�����!�����$������������D��������8�������������������

• ����������$��������������#����������������������8��������������!��$��������������!������$����������������������������#����������������D������������������������������������������$��8������

• �$�����������!����������D�������������8�������#����������$����$�������D�8������������������8����������#������$������H��������#������CI&����L�����:���L����JE��%��D��������8���!�D��$������H��������#��������������������#������������$#�����������$����������$�����1��������������

• (��#��$������8���������D����$������������������������D��������:="?:��������������8�����������������!�������������!���������$����8��������������$��8�#���#���������>�������!����������������$�������$����$����������8���!������������C������#L�#����������������$���:"?:�����!�E������������3'-:���!���$������������������8���!����

• �$�����������$�����������������������D������������������!����$�������2����#��������%����2�����#����������C���$����������!�����������$����������!���B8�����E��$����8��������������������$��������$��������������%������$�����������#�������D����$����������!�����2��������

Page 58: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 58

�$��������$������������������������������#�����$������������D��$����8��������������������$��8������

Layout

• '�#���������9���������!K������������������������#�$��!������!���������$���$�����!��������

• %���#����������������8�#����������#�����������3'-:�8�#��'$�!$��$��3'-:�8�#����������D��������������������#���������$����������������D������������$��$�������������������

• �$����������!��$�������8�#D�����/%�('%:�:�''� "����������#�������!���$���!���$��������+��������������������������9���������$�����8����C���$����I+������-������JE��

&���������<�

/ ��('�3("'� >��

/�������"����<�7.=7.=*���

0��8����� ��������/$���<�7��

0��8�����'����������:����<�.��

3�!$�/������%����<�W.�D757��

Response Section of Message

• %�#��������������8�����$�����#���2����������������������������������$����8�������������$���������$������������D�����������!���������$���������$��������������������������������������������!���

• /�8�����������#�������������������������������!�������������8�����������������1�����������������&���������D�O�������$�������������B���������$�������������������������������������O������$����8D��$��������B����8�����O�������$�������������B���������$����������������������������O�������������������������$����!�����������������8�����������������$����������8��������$�������������3�����D�#���$���������8�����������#������������������������$�������������������������������#����C����D����8��D�����E������������8�������������

Page 59: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 59

APPENDIX D: STANDARDS CHECKLIST

• (��#����������!��$���&L�0�(0��%�(����������������������$�#��������D�����#���������������!�������������������������8����$��������������

• %���#�������$��������#����$�"��+���F�#������$����������$�"��(���������C��������������E��$������������!��$���������

• %���#����������������������������'$����������������!���������������!�����!���������$�����������������������������!���������������

• %����$��!��!��������������������$��������2���������$����$��������������������������������������$�����������������!��$�������

• %���#��������������������$�������#�������������

• ����������$���������8������������$�����������$���������������>����#��������������������������������$����$��������������

• %���#��������� ��������� �������:������#�����(!�������������������������

• %���&>(������������������$�����$��������� ����������$������

• (��#��$�����������8����D��������#����������$����������������#��(������D��������:="?:�����������!�������������$�������8�����#���������

• 0��������������$����������������������

• 0��������8���������������������������>����#����8������$����$����������������������#D�$�������

• ��������������������8�����������&L%�-(0("' %'� �����������������������������������#����������!��$��������������������������&L� � ��

Page 60: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 60

APPENDIX E: GLOSSARY

Activity

%������������$������������!�������������$�����8����������������%���������#���#�8�����������D�������������D���8�������������D�������8���������

Database Process / Session

%�������������$������8�����

Item

%�����������������������������#����%�����������������������������

Item Attribute

%������������8��������������������8�����$������������8����������8#����������������C��������D������������D�������D�������������E�����$��������#����(���������������������������������$�����2���������������$��������#������������#�������#��������������������������#��#�����$�����������������2�������������������������������%�(����������������������8�����������������#�������8���D������!�������$�����#��$��!�������!�#���������������"��$�������8������������������������������#��$���9����������$����8������������

Item Type

'$�������������������$�������8�����������8#��������������������D�����$���������������������#����$���������������������������������������������������������������#����

Subprocess

%���������$������������������������������$���C���������!E��������C����8������ED������$����������������$���������C���������!E���������-�������������������8�����������������������

Thread

%��$������������2������������!��������������������������������!��$��$��$�������������������������������$���$������%�����������$������������������$�����������

Workflow Process

%����������������������������������$��$�����������#������9����8��������8B�������������#�!��D�������#����$����$���������������!���9������������������������!����������������������������$�����

'$��������������������8�������������������������$�������������������������������D����$����������!D�������������8#�������������!�������#������

Page 61: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 61

'$�������������������������������������������������������$������������$���D����������������������$��������������������������$��������D����������������8����$�����������������������D����$����������������D�����������('���������������������D����������

Worklist

%������������������������������$���!�����������������������C������������������$���!��������������������������$���#��$�����������������E��'$����������������������$������������8��������$����������!���������$���������$��������

Page 62: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 62

APPENDIX F: API STANDARDS

/*==========================================================+

| Copyright 1998 Oracle Corporation Redwood Shores, Ca USA|

| All rights reserved. |

+==========================================================+

| FILENAME

| xxfuns.pls

|

| DESCRIPTION

| TEMPLATE PL/SQL spec for package XX_ITEM_TYPE

|

| NOTES

| This file is a TEMPLATE that should be modified with your

| own names and procedures before installing. Names that

| begin with XX should be replaced with values for your

| implementation.

|

| It may be convenient to use the following naming standard

| - package name == the item type internal name

| - procedure names == the workflow activity

| function internal which the procedure implements.

*==========================================================*/

WHENEVER SQLERROR EXIT FAILURE ROLLBACK;

create or replace package XX_ITEM_TYPE as

/* $Header: xxfuns.sql 21.1 97/10/27 19:09:18 appldev ship $ */

-- PROCEDURE XX_ACTIVITY_NAME

--

-- <describe the activity here>

--

-- IN

-- itemtype - type of the current item

-- itemkey - key of the current item

-- actid - process activity instance id

-- funcmode - function execution mode

-- (’RUN’, ’CANCEL’, ’TIMEOUT’, ...)

-- OUT

-- result

-- - COMPLETE[:<result>]

-- activity has completed with the indicated result

Page 63: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 63

-- - WAITING

-- activity is waiting for additional transitions

-- - DEFERED

-- execution should be deferred to background

-- - NOTIFIED[:<notification_id>:<assigned_user>]

-- activity has notified an external entity that this

-- step must be performed. A call to

-- wf_engine.CompleteActivty will signal when this

-- step is complete. Optional return

-- of notification ID and assigned user.

-- - ERROR[:<error_code>]

-- function encountered an error.

procedure XX_ACTIVITY_NAME(

itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

result in out varchar2);

end XX_ITEM_TYPE;

/

show errors package XX_ITEM_TYPE

commit;

exit;

For the package body:

/*==========================================================+

| Copyright 1998 Oracle Corporation Redwood Shores, Ca USA|

| All rights reserved. |

+==========================================================+

| FILENAME

| xxfunb.pls

|

| DESCRIPTION

| TEMPLATE PL/SQL spec for package XX_ITEM_TYPE

|

| NOTES

| This file is a TEMPLATE that should be modified with your

| own names and procedures before installing. Names that

| begin with XX should be replaced with values for your

| implementation.

|

Page 64: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 64

| It may be convenient to use the following naming standard

| - package name == the item type internal name

| - procedure names == the workflow activity

| function internal which the procedure implements.

*==========================================================*/

WHENEVER SQLERROR EXIT FAILURE ROLLBACK;

create or replace package body XX_ITEM_TYPE as

/* $Header: xxfunb.sql 21.0 98/01/30 09:53:53 uname ship $ */

-- PROCEDURE XX_ACTIVITY_NAME

--

-- <describe the activity here>

--

-- IN

-- itemtype - type of the current item

-- itemkey - key of the current item

-- actid - process activity instance id

-- funcmode - function execution mode

-- ('RUN', 'CANCEL', 'TIMEOUT', …)

-- result

-- - COMPLETE[:<result>]

-- activity has completed with the indicated result

-- - WAITING

-- activity is waiting for additional transitions

-- - DEFERED

-- execution should be deferred to background

-- - NOTIFIED[:<notification_id>:<assigned_user>]

-- activity has notified an external entity that this

-- step must be performed. A call to

-- wf_engine.CompleteActivty will signal when this

-- step is complete. Optional return

-- of notification ID and assigned user.

-- - ERROR[:<error_code>]

-- function encountered an error.

procedure XX_ACTIVITY_NAME(

itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

result in out varchar2)

is

Page 65: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 65

begin

--

-- RUN mode - normal process execution

--

if (funcmode = ’RUN’) then

-- your run code goes here

null;

-- example completion

result := ’COMPLETE:APPROVED’;

return;

end if;

--

-- CANCEL mode - activity ’compensation’

--

-- This is in the event that the activity must be undone,

-- for example when a process is reset to an earlier point

-- due to a loop back.

--

if (funcmode = ’CANCEL’) then

-- your cancel code goes here

null;

-- no result needed

result := ’COMPLETE’;

return;

end if;

--

-- Other execution modes may be created in the future. Your

-- activity will indicate that it does not implement a mode

-- by returning null

--

result := ’’;

return;

exception

when others then

Page 66: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 66

-- The line below records this function call in the error

-- system in the case of an exception.

wf_core.context(’XX_ITEM_TYPE’, ’XX_ACTIVITY_NAME’,

itemtype, itemkey, to_char(actid),

funcmode);

raise;

end XX_ACTIVITY_NAME;

end XX_ITEM_TYPE;

/

show errors package body XX_ITEM_TYPE

commit;

exit;

Page 67: ˘ ˇˆ˙˝˙ - Oracle · Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines Page 17 Diagram 6: This process performs the same functionality as the process in Diagram

Oracle Workflow Release 2.6.2 Workflow Process Development Guidelines

December 2001

Authors: Kevin Hudson, Tim Roveda

Contriubting Authors: George Buzsaki, Mark Craig, John Cordes,

George Kellner, Clara Jaeckel, David Lam, Kenneth Ma, Steve Mayze,

Robin Seiden, Susan Stratton

Oracle Corporation

World Headquarters

500 Oracle Parkway

Redwood Shores, CA 94065

U.S.A.

Worldwide Inquiries:

Phone: +1.650.506.7000

Fax: +1.650.506.7200

www.oracle.com

Oracle is a registered trademark of Oracle Corporation. Various

product and service names referenced herein may be trademarks

of Oracle Corporation. All other product and service names

mentioned may be trademarks of their respective owners.

Copyright © 2001 Oracle Corporation

All rights reserved.