<-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
Skip to content

Green

color

Default screen resolution  Wide screen resolution  Increase font size  Decrease font size  Default font size  Skip to content Default color Pink color Green color Green color

Related Items

Home arrow Technical Articles arrow Oracle Workflows arrow Oracle Workflows Training Lesson 2
This website has now moved to http://apps2fusion.com





Oracle Workflows Training Lesson 2 | Print |  E-mail
Written by Anil Passi   
Tuesday, 26 September 2006
The Lesson 2 of Oracle Workflow training is driven by screenshots.

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.
Image

Select lookup type XX_MY_RESPONSE_TYPE.
Click on Apply and OK, after having created the Lookup Type.
Image

 
Step3. Within lookup type, right click and select New, to create two new lookup codes.
Image
Create lookup codes like as below.
Lookup code:XX_APPROVED
Image

Ditto as above for Lookup Code: XX_REJECTED
Image

 
Step 4. Now lets define two attributes.
These attributes will later be assigned to workflow message that we created in Training Lesson 1 .

Attribute: XX_RESPONSE_ACTION
Image
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.

Attribute: XX_RESPONSE_REASON
Image
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.
Image



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"
Image

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.
Image

 
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”
Image 

 
Step 8
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
    l_nid                  NUMBER;
    l_activity_result_code VARCHAR2(200);
    v_response_reason      VARCHAR2(50);
  BEGIN
    IF (funcmode IN ('RESPOND'))
    THEN
      l_nid := wf_engine.context_nid;
      l_activity_result_code := wf_notification.getattrtext(l_nid
                                                           ,'XX_RESPONSE_ACTION');
      v_response_reason := wf_notification.getattrtext(l_nid
                                                      ,'XX_RESPONSE_REASON');
      IF l_activity_result_code = 'XX_REJECTED' AND
         v_response_reason IS NULL
      THEN
        RESULT := 'ERROR: You must enter rejection reason if rejecting.';
        RETURN;
      END IF;
    END IF;
  EXCEPTION
    WHEN OTHERS THEN
      RESULT := SQLERRM;
  END xx_validate_response;



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

When testing, select "XX Rejected" in response while leaving the rejection reason blank. You will then see the error as below.
Image

For any comments/questions for this training session, leave a comment here.

Comments (32)add
...
written by Anil Passi , December 21, 2006
Hi Srikanth

I certainly will write up on that, but will probably be after xmas holidays.

I think there is a white paper on metalink too for Payables/Expenses. Did you have a look at that?

thanks
anil
...
written by Srikanth , December 21, 2006
Hi Anil ,
Can you please direct me to some documentation on using AME in Workflow.I could not find much informative docs on this.

It would be great if you could handle a session on this.

Please help me in this regard.

Thank you in advance,
Srikanth
...
written by Anil Passi , December 21, 2006
Hi Srikanth

I certainly will write up on that, but will probably be after xmas holidays.

I think there is a white paper on metalink too for Payables/Expenses. Did you have a look at that?

thanks
anil
...
written by Srikanth , December 21, 2006
Hi Anil ,
Can you please direct me to some documentation on using AME in Workflow.I could not find much informative docs on this.

It would be great if you could handle a session on this.

Please help me in this regard.

Thank you in advance,
Srikanth
...
written by Srikanth , December 22, 2006
Hi Anil ,
I didnt find the document.Can you give the details of the white paper .

Thank you,
Srikanth
...
written by Anil Passi , December 22, 2006
Hi Sri

Refer to Metalink Notes 369040.1 and 251770.1

Those will provide you an insight

Thanks
Anil Passi
...
written by Srikanth , December 22, 2006
Hi Anil ,
I didnt find the document.Can you give the details of the white paper .

Thank you,
Srikanth
...
written by Anil Passi , December 22, 2006
Hi Sri

Refer to Metalink Notes 369040.1 and 251770.1

Those will provide you an insight

Thanks
Anil Passi
...
written by Srikanth , January 03, 2007
Hi Anil ,

I have followed the steps in WF Lesson1.The issue is it is working in Lical instance but the same Package and same WF Process are not working in client instance.

Will there be any differences for on the fly roles from instance to instance.

The status field in wf_notifications table of client is CLOSED where as in local instance it is OPEN.

Thanks,
Sri
...
written by Anil Passi , January 03, 2007
.
.
.
.
Hi Sri,

Is the ad Hoc Role API returning an error?
Try calling that API from SQL*Plus and see how it behaves.

Thanks
Anil Passi
.
.
.
...
written by Srikanth , January 03, 2007
Hi Anil ,

I have followed the steps in WF Lesson1.The issue is it is working in Lical instance but the same Package and same WF Process are not working in client instance.

Will there be any differences for on the fly roles from instance to instance.

The status field in wf_notifications table of client is CLOSED where as in local instance it is OPEN.

Thanks,
Sri
...
written by Anil Passi , January 03, 2007
.
.
.
.
Hi Sri,

Is the ad Hoc Role API returning an error?
Try calling that API from SQL*Plus and see how it behaves.

Thanks
Anil Passi
.
.
.
...
written by Anil Passi , January 12, 2007
.
.
.
Hi Jon,
Great yuo fixed the problem. Many thanks for sharnig your experience/research on this error.

Thanks
Anil pAssi
...
written by Anil Passi , January 12, 2007
.
.
.
Hi Jon,
Great yuo fixed the problem. Many thanks for sharnig your experience/research on this error.

Thanks
Anil pAssi
...
written by SAI , February 08, 2007
Hi anil

This is a great work you are doing man keep it up
.I am a fresher to oracle apps and am trying to do the screen shots in leson two and i was not able to figure out where can i see the last screen shot in which ican select aprroved or rejected.i checked my mail and have not recieved any thing can you please explain that last step in detail

Thanks

Sai
...
written by Raj , February 21, 2007
Hi Anil,

Great job Man. Its really a good one for the freshers like me to get started with the Work Flows.

Thanks,

Raj.
...
written by Sasidhar , April 26, 2007
Hi Anil,

Thanks for sharing the knowledge.

I Have a case where in the Action is not been captured inside an attribute, we simply attached a lookup to the Message, in this case how can i achieve the validation for reason column.
Thanks in Advance.

Regards,
Sasidhar.
...
written by Anil Passi , April 27, 2007
Hi Sas

Have you attached a lookup to attribute of type Respond ? If so, the workflow notification will convert the lokkupcodes into a List Of Values, and it will be presented in notification as drop down list. In this case, no further validation is required as LOV will be restricted to the list of valid values in lookup.

Thanks
Anil
...
written by Sasidhar , April 28, 2007
Hi Anil,

Thanks for responce.

In continuation of my previous question, is there any way to capture the Events of Approved, Rejected on the notification if we are not maintaining any attribute to store the lookup values but directly attaching the lookup to the Message.

Regards,
Sasidhar
...
written by Anil Passi , April 29, 2007
HiSasi

If you wish to store the auditing of action/responses on custom notifications [so that you can report that elsewhere], then you would need a custom table and then using post notification insert record into that table. Much like PO_APPROVAL_HISTORY, whereby Oracle captures the entire lifespan of a purchase order which includes creation, reservation, approval, timeout etc.

Thanks
Anil
...
written by Jagdish , May 15, 2007
Hi Anil,

The articles what you are providing are really fantastic to have a good start. Thank you for your wonderful effort.

Regards,
Jagdish
...
written by S.Mahaboob Basha , June 19, 2007
Hi Anil,

Its Good.Its really helpfull for oracle Apps Consultants.Its Good work from your side.Keep it up.If any issues i will mail to you.

Regards
Basha
...
written by Sasidhar , June 23, 2007
Hi Anil,
In our current project we had a requirement to invoke a child workflow process from the Parent Workflow. We have achieved this by calling the start process in a loop for each child workflow process. Here the Problem is, in the Status Monitor we are seeing as many lines as child workflow process are invoked.
We donot want these child workflow process appear in the Status Monitor is there a way to do that.
This is all becoz our client wants only one Process against one workflow in Status Monitor.
As wel we want the main workflow to error state if any child process fails.

Thanks in Advance...

Regards,
Sasidhar.
...
written by Suresh Babu , August 21, 2007

Hi Anil,

Thank you very very much for your WF training materials. It is more than a tutor for me... Excellent job....

I have a query regarding the FUNCTIONS executed thru WF Notification. For eg., in your sample procedure xx_validate_response is called from the WF. My query is, when exactly is this xx_validate_response procedure getting executed, i mean before the APPROVE/REJECT action from the user or after the APPROVE/REJECT action.

I asssume that the function is executed after the user select either APPROV/REJECT. Kindly confirm me.

Thanx
Suresh

...
written by moammed khasawneh , August 26, 2007
thanks alot ,but i want to ask about where to find documents or lessons on which connect the alerts of apps with some workflow .please I need that.
thanks in advance.
...
written by Pavan , November 14, 2007
This is the best way(Screen shots) to practice what ever been taught in the lesson. Thanks alot Anil for such a vivid explanation and to Swetha for giving such a splendid feedback.

- Pavan.
I m getting an error during validation of response after rejection
written by zafar sadiq , November 30, 2007
Hi every one ,
Thanks for this tutorial, its has helped me a lot .. but i am facing one problem if i select response action as rejected and click on submit with response reason as null i get an error as

Cannot create picklist ViewObject for region item (N40); Pick list view object definition must be supplied, if pick list view usage or list view object is not set.

plz help me ..

thanks a alot
hi
written by Premal Mehta , January 08, 2008
It was a great tutorial...
I just need to ask one think...how would the User be able to Launch the Workflow?
regards
Premal mehta
Notification error
written by Jayesh Bhangdiya , February 28, 2008
Hi Anil,
Thanks a lot for such wonderful tutorial.

I follwed all the steps of Step 1 & Step 2 & it worked successfully.

I am trying to follow the same steps for my project requirement as its almost the same.
The only change is my notification has the the result type of Approval.
I am getting following error:

Notification activity's message must have a respond attribute named 'RESULT' with lookup type 'WFSTD_APPROVAL'.

What's the solution for the same?

Thanks & Regards,
Jayesh



smilies/smiley.gif
...
written by Jayesh Bhangdiya , February 29, 2008
I got the solution. I didn't add type in result navigation of Message.

Thanks & Regards,
Jayesh
...
written by Hirdesh Gupta , March 05, 2008
Dear Anil

It is a great online training tutorial...

Thank you so much , I was new for workflow, Now I can start work on WF independently .

Once agian
Thank you

Regards

Hirdesh



Its really helpful
written by Siva sankar v , March 09, 2008
Hi Anil,

I am going through your articles and training.I would like to appreciate your efforts on this.I got several vision access where i can access application but i dont have any free database access.Do you have any idea where i can get free vision database access so that i can have trails on your training stuff.

Thanks for your efforts.

Regards
Siva V

You must be logged in to a comment. Please register if you do not have an account yet.

busy