We can call Workflow in 2 ways from the OAF
1) Using PL SQL Procedure, call procedure from OAF page using callable
statement.
CREATE OR REPLACE PROCEDURE start_wf_prc
IS
l_itemtype VARCHAR2 (30) := ‘XX_ASN_WF’;
l_itemkey VARCHAR2 (300) := ‘ASN’;
BEGIN
wf_engine.createprocess (l_itemtype, l_itemkey,
‘XX_ASN_MAIN_PROCESS_WF’);
wf_engine.setitemowner (itemtype => l_itemtype,itemkey => l_itemkey,owner
=> ‘ASN1’);
wf_engine.startprocess (l_itemtype, l_itemkey);
COMMIT; END;

2) Write following function in Controller of the OAF page.
public void callCustomWorkFlow(OAPageContext pageContext)
{
String strWfItemType = “XX_ASN_WF”;
String strWfProcess =
“XX_ASN_MAIN_PROCESS_WF”;
String strWfItemKey = “ASN”;
OANavigation wfNavigation = new OANavigation(); // Create Workflow
Process
wfNavigation.createProcess(pageContext, strWfItemType, strWfProcess,
strWfItemKey);
wfNavigation.setItemOwner(pageContext,” ASN1″); // Start Workflow
Process
wfNavigation.startProcess(pageContext, strWfItemType, strWfProcess,
strWfItemKey);
}

Recent Posts

Start typing and press Enter to search