Showing posts with label Oracle Workflow. Show all posts
Showing posts with label Oracle Workflow. Show all posts

Monday, June 8, 2020

Oracle Workflow All Function Modes (funcmode)

/*Oracle Workflow All Function Modes (funcmode) */
   begin
---1
      if ( funcmode = 'RUN' ) then

           <your RUN executable statements>

           resultout := 'COMPLETE:<result>';

           return;

      end if;
---2
  if ( funcmode = 'CANCEL' ) then

           <your CANCEL executable statements>

           resultout := 'COMPLETE';

           return;

      end if;
---3
  if ( funcmode = 'SKIP' ) then

           <your SKIP executable statements>

           resultout := 'COMPLETE:<result>';

           return;

      end if;
---4
  if ( funcmode = 'RETRY' ) then

           <your RETRY executable statements>

           resultout := 'COMPLETE:<result>';

           return;

      end if;
---5
   if ( funcmode = 'VALIDATE' ) then

           <your VALIDATE executable statements>

           resultout := 'COMPLETE';

           return;

      end if;
---6
  if ( funcmode = 'RESPOND' ) then

           <your RESPOND executable statements>

           resultout := 'COMPLETE';

           return;

      end if;
---7
  if ( funcmode = 'FORWARD' ) then

           <your FORWARD executable statements>

           resultout := 'COMPLETE';

           return;

      end if;
---8
  if ( funcmode = 'TRANSFER' ) then

           <your TRANSFER executable statements>

           resultout := 'COMPLETE';

           return;

      end if;
---9
  if ( funcmode = 'QUESTION' ) then

           <your QUESTION executable statements>

           resultout := 'COMPLETE';

           return;

      end if;
--10
 if ( funcmode = 'ANSWER' ) then

           <your ANSWER executable statements>

           resultout := 'COMPLETE';

           return;

      end if;

---11
  if ( funcmode = 'TIMEOUT' ) then

           <your TIMEOUT executable statements>

           if (<condition_ok_to_proceed>) then

              resultout := 'COMPLETE';

           else

              resultout := wf_engine.eng_timedout;

           end if;

           return;

      end if;
--12 Other Developer Defined
  if ( funcmode = '<other funcmode>' ) then

           resultout := ' ';

           return;

      end if;
--Main exception
  exception

           when others then

            WF_CORE.CONTEXT ('<package name>', '<procedure name>', <itemtype>,

                            <itemkey>, to_char(<actid>), <funcmode>);

           raise;

  end <procedure name>;

Sunday, July 28, 2019

Get Workflow User, Item Name, Function Message and Lookups

==Workflow Users/Roles
SELECT * FROM WF_USERS where name = 'XXUSER';
SELECT * FROM WF_ROLES where name = 'XXUSER';
SELECT * FROM WF_USER_ROLES where user_name = 'XXUSER';
SELECT * FROM WF_USER_ROLE_ASSIGNMENTS where user_name = 'XXUSER';

==Workflow Item Name and Attributes
SELECT * FROM WF_ITEM_TYPES where name = 'OKCAUKAP'; --PO Approval (POAPPRV) ; PO Requisition Approval (REQAPPRV); 
--OM Order Header (OEOH); OM Order Line (OEOL)
SELECT * FROM WF_ITEM_TYPES_VL where name = 'OKCAUKAP';
SELECT * FROM WF_ITEM_TYPES_VL where display_name like '%Approval';
SELECT * FROM WF_ITEM_TYPES_VL where description like '%Order%';
SELECT * FROM WF_ITEM_ATTRIBUTES where item_type = 'OKCAUKAP';
SELECT * FROM WF_ITEM_ATTRIBUTES_TL;

==Workflow Functions
SELECT * FROM WF_ACTIVITIES where item_type = 'OKCAUKAP' and version = 1;
SELECT * FROM WF_ACTIVITIES_TL where item_type = 'OKCAUKAP';
SELECT * FROM WF_ACTIVITY_ATTRIBUTES where activity_name = 'CREATE_SOA';
SELECT * FROM WF_ACTIVITY_ATTRIBUTES_TL;
SELECT * FROM WF_ACTIVITY_TRANSITIONS;

==Workflow Lookups
SELECT * FROM WF_LOOKUPS_TL where lookup_type = 'OKC_DB_RETRY';

==Workflow Messages
SELECT * FROM WF_MESSAGES where type = 'OKCAUKAP' and name = 'APPROVE_CONTRACT';
SELECT * FROM WF_MESSAGES_TL where type = 'OKCAUKAP' and name = 'APPROVE_CONTRACT';
SELECT * FROM WF_MESSAGE_ATTRIBUTES where message_type = 'OKCAUKAP' and message_name = 'APPROVE_CONTRACT';
SELECT * FROM WF_MESSAGE_ATTRIBUTES_TL where message_type = 'OKCAUKAP' and message_name = 'APPROVE_CONTRACT';


==Workflow Particular item run and values
SELECT * FROM WF_ITEMS where item_type = 'OKCAUKAP' order by begin_date desc;
--USER_KEY/ITEM_KEY => select * from okc_k_headers_b where contract_number = '3308531';
SELECT * FROM WF_ITEM_ATTRIBUTE_VALUES where item_type = 'OKCAUKAP' and item_key='20683312';
SELECT * FROM WF_PROCESS_ACTIVITIES where process_item_type = 'OKCAUKAP' and process_version = 1;

SELECT * FROM WF_NOTIFICATIONS WHERE MESSAGE_TYPE = 'OKCAUKAP' AND MESSAGE_NAME = 'APPROVE_CONTRACT';
SELECT * FROM WF_NOTIFICATION_ATTRIBUTES where notification_id = ;

SELECT * FROM WF_DEFERRED;