How to call workflow from oaf page
In this post , We will discuss how we can launch/start or trigger the Workflow from oaf page. To call workflow from oaf page means , we need to start the workflow process from OAF page that will execute the complete workflow itself. We do handle all the code of How to call workflow from oaf page in our oaf page controller. Either we can trigger the Workflow with the event or we can also create some button in the OAF page and when user will do click on the button , then our workflow will be trigger to execute. Here below you will be get the complete details steps of How to call workflow from oaf page .
Example of How to call workflow from oaf page
In this Example , I am assuming that , We have already create the OAF with OAF button 'Launch Workflow'. If you want to know the steps in detail for how we can create OAF page and this button then you can refer this post. How to Create OAF Page
We are using the Workflow with Item Type '' and Process ''.
Item Type : POAPPRV
Processes : AME_APPROVAL (Click on the Processes to know the internal name of the processes).
Item Type : POAPPRV
Processes : AME_APPROVAL (Click on the Processes to know the internal name of the processes).
Put this code under the Process Form Controller
{
//'LaunchWorkflow' is the ID of the Button in the OAF page.
//'LaunchWorkflow' is the ID of the Button in the OAF page.
if (pageContext.getParameter("'LaunchWorkflow")!=null)
{
{
String strWfItemType = "POAPPRV";
String strWfProcess ="AME_APPROVAL";
String strWfItemKey = "TEST-PO1";
OANavigation wfNavigation = new OANavigation();
// Create Workflow Process
wfNavigation.createProcess(pageContext, strWfItemType, strWfProcess,
strWfItemKey);
wfNavigation.setItemOwner(pageContext," MOKSHITH");
// Start Workflow Process
wfNavigation.startProcess(pageContext, strWfItemType, strWfProcess,
strWfItemKey);
}
0 comments:
Post a Comment