Thanks to all the responses from Lesson 1 of Oracle Workflows Training. The most promising response was that from Swetha who mentioned that although
Audio-Visual training is good, however if someone wants to practice the steps as they read then its best to have screenshot.
Another problem with Audio-Visual is that it is not possible to print such audio-video presentations of macromedia.
( Many thanks Swetha, I appreciate your sincere views. )
Hence the Lesson 2 of Workflow training is driven by screenshots. Please note that Workflows Training Lesson 1 ( Audio Visual)
is a pre-requisite for fresh workflow learners.
In this lesson we are going to learn:-
1. How to creates lookups in workflow.
2. How to provide a drop down list in notification to user. User will be select the response(approve or reject) from drop down list.
3. How to make a user enter rejection reason in free text response field within notification.
4. Validate that the value of rejection reason is not null, if user selects rejected. Effectivley this will train you on how to do
validations on notification responses using pl/sql.
Step 1. Open the Workflow â€œXX Training Workflowâ€ that we created in lesson one.
The source code for this is in Workflow Training Lesson 1.
Step 2. Under ItemTypeâ€ XX Training Workflowâ€, right click on â€œLookup Typesâ€ and select New.
Select lookup type XX_MY_RESPONSE_TYPE.
Click on Apply and OK, after having created the Lookup Type.
Step3. Within lookup type, right click and select New, to create two new lookup codes.
Create lookup codes like as below.
Ditto as above for Lookup Code: XX_REJECTED
Step 4. Now lets define two attributes.
These attributes will later be assigned to workflow message that we created in Training Lesson 1 .
Note: This attribute will be used in conjunction with the Lookup Type â€œXX_MY_RESPONSE_TYPEâ€ to display the drop-down list in notification response.
Each lookup code value will be presented to the user in notification.
Note: User will be able to enter a free text response reason. Please note that we will validate the value entered into this Notification response field using PL/SQL.
For this training, we will validate to ensure that Response Reason is entered if the user decides to reject notification.
Step 5. Drag these two attributes one by one using left mouse click, into the message â€œPO Informationâ€. You will be prompted with a message box when you drag
these attributes, simply click OK to those messages. After dragging the two attributes to message, these will appear in Workflow as below.
Step 6. Double click on attribute "XX Response Action" within the Message.
Set type to a value of â€œLookupâ€.
Set Source to a value of â€œRespondâ€.
Set Lookup Type to "XX My Response Type"
Now double click on attribute "XX Response Reason" within the message "PO Information".
Set Source to "Respond". Leave everything else to its default value and click on OK.
Step7 Important Note: This Oracle Workflow training lesson is simply trying to depict how to present drop down list for response to notification.
Ideally, for approvals, you will simply attach a Lookup Type to notification itself.
Double click on notification â€œPO Notif Infoâ€.
In the Function Name field assign â€œxxxx_po_wf_training_pkg.xx_validate_responseâ€
Write the pl/sql function as below for xx_validate_response (dont worry, I am attaching the code for this tutorial).
PROCEDURE xx_validate_response(itemtype IN VARCHAR2
,itemkey IN VARCHAR2
,actid IN NUMBER
,funcmode IN VARCHAR2
,RESULT IN OUT VARCHAR2) IS
IF (funcmode IN ('RESPOND'))
l_nid := wf_engine.context_nid;
l_activity_result_code := wf_notification.getattrtext(l_nid
v_response_reason := wf_notification.getattrtext(l_nid
IF l_activity_result_code = 'XX_REJECTED' AND
v_response_reason IS NULL
RESULT := 'ERROR: You must enter rejection reason if rejecting.';
WHEN OTHERS THEN
RESULT := SQLERRM;
Step9 Now save the workflow in database.
The definition of Workflow File can be downloaded by right clicking here
Step 10 Test your workflow.
The remainder PL/SQL scripts for this training tutorial can be downloaded from Lesson 2 Scripts
For any comments/questions for this training session, leave a comment here.
written by Suresh Babu , August 21, 2007
written by moammed khasawneh , August 26, 2007
written by Pavan , November 14, 2007
written by zafar sadiq , November 30, 2007
written by Premal Mehta , January 08, 2008
written by Jayesh Bhangdiya , February 28, 2008
written by Jayesh Bhangdiya , February 29, 2008
written by Hirdesh Gupta , March 05, 2008
written by Siva sankar v , March 09, 2008
written by Hemanth , November 09, 2008
written by Santhosh Kotha , January 10, 2009
written by gjpraveen , April 23, 2009
written by sujathaorcl , January 19, 2010
written by Imran Baig , February 23, 2010
written by umamaheswararao , September 18, 2012
|< Prev||Next >|