Practice - Defining A Function Activity: Distribution

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

Practice - Defining a Function Activity

Distribution
Oracle Workflow

Job Title*

Ownership
The Job Title [[email protected]?Subject=LABxxxxx] is responsible for ensuring that
this document is necessary and that it reflects actual practice.

Copyright © Oracle Corporation, 2004. All rights reserved.

Practice - Defining a Function Activity 517692090.doc


Effective Paradigm_effective Page 1 of 6 Rev Paradigm_revision
Practice - Defining a Function Activity
Overview
In this practice, you will define a function activity to update a schedule of planned vacations. For
this practice, you will use a predefined PL/SQL procedure for your function activity. In a later
practice, you will have the opportunity to develop your own PL/SQL procedure for this function.

Note: Because many students access the system and create objects during this course, you need a
way to distinguish between the objects created by you and by your classmates. Therefore, you
will be assigned a terminal number by your instructor. Use this number as a prefix wherever you
see XX included in the name of something you are defining. In this way, you can ensure that the
definitions you create are unique.

Note: In order to use the sample solution scripts provided for these practices, you must enter the
internal names for all objects you define exactly as shown in the instructions. Otherwise, you
must modify the sample code to reference the object names you define.

Assumptions
 You must have access to an Oracle Applications Vision database, a standalone Oracle
database with Oracle Workflow installed, or a comparable training or test instance at
your site on which to complete this practice.

 The instructor will provide you with the connect string for the class database and the
username and password of the Oracle Workflow database account.

 The instructor will provide you with the username and password of a user with
workflow administrator privileges. The workflow administrator is defined in the
Workflow Configuration page in Oracle E-Business Suite or in the Global Workflow
Preferences page in standalone Oracle Workflow.

 For standalone Oracle Workflow, the instructor will provide you with the URL for the
Oracle Workflow home page. The URL is <webagent>/wfa_html.home, where
<webagent> is the base URL of the Web agent configured for Oracle Workflow in your
Web server.

 For Oracle Workflow embedded in Oracle E-Business Suite, the instructor will provide
you with the URL for the Oracle E-Business Suite login page and the name of a
Workflow administrator responsibility. The username you use to log in should have this
responsibility assigned to it.

 The instructor will provide you with the names of users that you can assign as the
requestor and approver in the Vacation Proposal process. In Oracle E-Business Suite,
these usernames should have Workflow administrator and user responsibilities assigned
to them.

Copyright © Oracle Corporation, 2004. All rights reserved.

Practice - Defining a Function Activity 517692090.doc


Effective Paradigm_effective Page 2 of 6 Rev Paradigm_revision
Tasks
Defining a Function Activity

In the Vacation Proposal item type you created in the Creating a Workflow Process practice, add
a function activity that updates a schedule of planned vacations.

Loading a PL/SQL Package

Load the PL/SQL package containing the predefined PL/SQL procedure that the function activity
calls.

Copyright © Oracle Corporation, 2004. All rights reserved.

Practice - Defining a Function Activity 517692090.doc


Effective Paradigm_effective Page 3 of 6 Rev Paradigm_revision
Solution - Defining a Function Activity
Defining a Function Activity

1. Start the Oracle Workflow Builder.

2. From the File menu, choose Open to open the wfvacXX.wft data store you defined in the
Creating a Workflow Process practice.

3. In the navigator tree, open your item type and open the process diagram window for the
Vacation Proposal process.

4. Delete the transition between the Vacation Approved FYI node and the End (Approve)
node.

5. Click the New Function button, position the cross-hair cursor between the Vacation
Approved FYI node and the End node, and click again to create a new function activity node
there and open the property pages for the node.

6. Define the following properties for the function activity:


 Internal Name: SCHEDULE_UPDATE
 Display Name: Update Vacation Schedule

Note: As a workflow development standard, where possible, you should use the procedure
name of the function called by the activity as the internal name of the activity. For example,
the activity that calls the function WFVACXX.SCHEDULE_UPDATE should have the
internal name SCHEDULE_UPDATE.

7. Select the icon DB_UPD.ICO for the activity.

8. Enter the package and procedure name WFVACXX.SCHEDULE_UPDATE for the activity.
This function will have no result. Choose OK.

Note: If you are defining a function activity during the process design phase and you do not
yet know the package and procedure name for the PL/SQL procedure you want the activity
to call, you can enter WF_STANDARD.NOOP as a placeholder in the Function Name field.
WF_STANDARD.NOOP is a standard Workflow PL/SQL procedure that sets the resultout
to wf_engine.eng_completed and returns.

9. Draw transitions from the Vacation Approved FYI node to the Update Vacation Schedule
node, and from the Update Vacation Schedule node to the End (Approve) node.

10. To specify error handling for the Vacation Proposal process, open the property pages for the
Vacation Proposal process and choose the Details tab. Enter WFERROR as the error item
type and DEFAULT_ERROR as the error process. Choose OK.

11. In the Navigator window, click the Verify button to verify your workflow.

Copyright © Oracle Corporation, 2004. All rights reserved.

Practice - Defining a Function Activity 517692090.doc


Effective Paradigm_effective Page 4 of 6 Rev Paradigm_revision
12. From the File menu, choose Save to save your work to your workflow definition file.

13. From the File menu, choose Save As and save your item type to the class database, using the
database username, password, and connect string provided by the instructor.

14. Close the data store.

Loading a PL/SQL Package

15. Copy and edit the sample table creation script named wfvacxxc.sql. Open a copy of the
sample file and replace all instances of XX with your own terminal number. Save the file
and rename it by replacing xx with your terminal number.

This script creates a vacation schedule table named


WFVACXX_VACATION_SCHEDULE. The table includes the following columns:
 REQUESTOR - varchar2(30)
 APPROVER - varchar2(30)
 FROM_DATE - date
 TO_DATE - date

16. Copy and edit the sample package specification and body scripts. The sample scripts are
named wfvacxxs.sql and wfvacxxb.sql, respectively. They create a package named
WFVACXX that contains all the sample PL/SQL procedures for all practices in this course.
The procedure specific to this practice is WFVACXX.SCHEDULE_UPDATE. Open a copy
of each sample file and replace all instances of XX with your own terminal number. Save
the files and rename them by replacing xx with your terminal number.

The WFVACXX.SCHEDULE_UPDATE procedure records an approved vacation proposal


in the WFVACXX_VACATION_SCHEDULE table.

Copyright © Oracle Corporation, 2004. All rights reserved.

Practice - Defining a Function Activity 517692090.doc


Effective Paradigm_effective Page 5 of 6 Rev Paradigm_revision
17. Log in to SQL*Plus using the database username, password, and connect string provided by
the instructor. Run the table creation, package specification, and package body scripts in that
order by entering the following commands from the directory where the scripts are located:

@wfvacxxc

@wfvacxxs

@wfvacxxb

18. Use a Web browser to connect to the Oracle Workflow home page with the URL provided
by the instructor for standalone Oracle Workflow, or to a Workflow administrator
responsibility with the URL provided by the instructor for Oracle Workflow embedded in
Oracle E-Business Suite. Log in as a user with workflow administrator privileges.

19. Use the Launch Processes page or Developer Studio to launch your workflow process and
test your work. You can use the Worklist Web pages to view the notifications sent by the
process and approve the vacation proposal, and use the Monitor Web pages to review the
status of the process.

 Run the process and approve the vacation proposal.

 Use SQL*Plus to verify that the appropriate row was inserted into your
WFVACXX_VACATION_SCHEDULE table. Enter the following command:

select * from WFVACXX_VACATION_SCHEDULE;

Copyright © Oracle Corporation, 2004. All rights reserved.

Practice - Defining a Function Activity 517692090.doc


Effective Paradigm_effective Page 6 of 6 Rev Paradigm_revision

You might also like