0% found this document useful (0 votes)
82 views3 pages

XAOATEST Code and Details ALL ORACLE APPS

This document describes a PL/SQL package used in an XAOATEST workflow. It includes two procedures - one to insert data into a table and set a result, and another to launch a workflow by creating and starting a process. Sample scripts are provided to trigger the workflow by calling the launch procedure, and to check the workflow statuses by querying tables.

Uploaded by

satish1981
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views3 pages

XAOATEST Code and Details ALL ORACLE APPS

This document describes a PL/SQL package used in an XAOATEST workflow. It includes two procedures - one to insert data into a table and set a result, and another to launch a workflow by creating and starting a process. Sample scripts are provided to trigger the workflow by calling the launch procedure, and to check the workflow statuses by querying tables.

Uploaded by

satish1981
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

XAOATEST Code and Details

PLSQL Package used in XAOATEST Workflow:

CREATE OR REPLACE PACKAGE XXAOA_TEST_WF_PKG


AS
PROCEDURE INSERT_PROC( itemtype IN VARCHAR2,
itemkey IN VARCHAR2,
actid IN NUMBER,
funcmode IN VARCHAR2,
resultout IN OUT NOCOPY VARCHAR2
);

PROCEDURE LAUNCH_WORKFLOW ( itemtype IN VARCHAR2,


itemkey IN VARCHAR2,
process IN VARCHAR2
);
END XXAOA_TEST_WF_PKG;
/

CREATE OR REPLACE PACKAGE BODY XXAOA_TEST_WF_PKG


AS
PROCEDURE INSERT_PROC( itemtype IN VARCHAR2,
itemkey IN VARCHAR2,
actid IN NUMBER,
funcmode IN VARCHAR2,
resultout IN OUT NOCOPY VARCHAR2)
AS
BEGIN

INSERT INTO xxaoa_test_wf VALUES (itemtype,itemkey,actid,funcmode,resultout);


resultout := 'Success';
EXCEPTION
WHEN OTHERS
THEN
resultout := 'Error';
END INSERT_PROC;

PROCEDURE LAUNCH_WORKFLOW ( itemtype IN VARCHAR2,


itemkey IN VARCHAR2,
process IN VARCHAR2
)
AS
BEGIN
WF_ENGINE.Threshold := -1;

WF_ENGINE.CREATEPROCESS( itemtype,
itemkey ,
process
);
WF_ENGINE.STARTPROCESS ( itemtype,
itemkey
);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE('Error at LAUNCH_WORKFLOW: '||SQLERRM);
END LAUNCH_WORKFLOW;
END XXAOA_TEST_WF_PKG;
/

Sample Script to Kick off or Trigger the workflow:

DECLARE
lvItemType VARCHAR2(80) := 'XAOATEST';
lvUserId NUMBER := -1;
lvItemKey VARCHAR2(10);
vErrorMsg VARCHAR2(2000);
vErrorCode NUMBER;
BEGIN
lvItemKey := 'XAOA-01'; -- This should be unique value
xxaoa_test_wf_pkg.launch_workflow( itemtype => lvItemType,
itemkey => lvItemKey,
process => 'AOAMAIN_PROCESS' -- Main Runnable process name
);
COMMIT; -- Use commit if we need to see the WF Status from Front End from workflow Admin
Resp
EXCEPTION
WHEN OTHERS
THEN
vErrorCode := SQLCODE;
vErrorMsg := SQLERRM(SQLCODE);
RAISE_APPLICATION_ERROR(20001, vErrorMsg);
END;
/

Script to test the Workflow statuses:

SELECT *
FROM wf_items
WHERE item_type = 'XAOATEST';

Result:

ITEM_TYPE ITEM_KEY ROOT_ACTIVITY ROOT_ACTIVITY_VERSION


OWNER_ROLE PARENT_ITEM_TYPE PARENT_ITEM_KEY PARENT_CONTEXT
BEGIN_DATE END_DATE USER_KEY HA_MIGRATION_FLAG
SECURITY_GROUP_ID
XAOATEST XAOA-01 AOAMAIN_PROCESS 1 08-
JUN-13
SELECT *
FROM wf_item_activities_history_v
WHERE item_type = 'XAOATEST';

Result:

ITEM_TYPE ITEM_KEY ACTIVITY_DEF_BEGIN_DATE ACTIVITY_DEF_END_DATE


BEGIN_DATE END_DATE EXECUTION_TIME BEGIN_DATE_TIME DURATION
ACTIVITY_ITEM_TYPE ACTIVITY_TYPE PARENT_ACTIVITY_NAME
ACTIVITY_NAME ACTIVITY_DISPLAY_NAME PARENT_DISPLAY_NAME
ACTIVITY_STATUS NOTIFICATION_STATUS NOTIFICATION_ID
RECIPIENT_ROLE RECIPIENT_ROLE_NAME ACTIVITY_STATUS_DISPLAY
RESULT
XAOATEST XAOA-01 08-JUN-13 08-JUN-13 1 08-JUN-13
11:25:12 162 XAOATEST PROCESS ROOT AOAMAIN_PROCESS All Oracle
Apps Main Process All Oracle Apps Test ACTIVE WF_ENGINE
Workflow Engine Active

If you are running this Script outside of Oracle Applications like Running from any Oracle IDE then
run the Workflow Background Process for your Item type to save time to Kickoff the workflow.

Creating workflow from scratch 2 →

You might also like