44
Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team Leader - Systems Environment Waikato (Asparona/ More4Apps) Sarah Sinclair Technical Consultant Specialist Solutions

Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Embed Size (px)

Citation preview

Page 1: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Electronically approve and create Suppliers in Oracle Financials using a combination of APEX

and Oracle Workflow. 

NZOUG Conference 2010

Brad SayerTeam Leader - Systems Environment Waikato(Asparona/More4Apps)

Sarah SinclairTechnical Consultant

Specialist Solutions

Page 2: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Agenda

The Business Case

The Technology

The Process

The Application

Other Application Advantages

Questions

Page 3: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

The Business CaseEnvironment Waikato created their suppliers in Oracle

Financials using the common approach where users complete a pre-printed form and send it to a

manager for approval.

Page 4: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

The Business CaseOnce approved the Payables processing staff would

manually create the Supplier master-file records.

Lots of requests were received on a daily basis and delays during the manual process were experienced

in addition to a lack of audit and volume control.

There has to be a better way!

Page 5: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Technology Components

Oracle Application Express

Oracle Application Express (Oracle APEX) is a rapid web application development tool for the Oracle database.  Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure.

http://www.oracle.com/technology/products/database/application_express/index.html

Page 6: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Technology Components

Oracle Workflow Builder

Oracle Workflow delivers a complete workflow management system that supports business process based integration. Its technology enables modeling, automation, and continuous improvement of business processes, routing information of any type according to user-defined business rules.

Oracle Workflow 2.6.2 was used in this example.

http://www.oracle.com/technology/products/integration/workflow/workflow_fov.html

Page 7: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

The Technology Flow

Page 8: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

The Technology Flow

APEX database Oracle Financials database

LDAP Server

APEX authentication

Ew_po_vendors

Web Browser

HTTP Requests

PL/SQLDatabase Package

Oracle WorkflowEWPOVEND

OraclePayables

Create Vendors

Vendor Details

Send out emails and notifications

Request Data and Launch Processes

Retrieve Data Launch Workflow

Action Notifications

Page 9: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Requestor

Search for Supplier Found

Email with Supplier details

FINISH

Enter a Supplier Request

Not Found

Submits

Reviewer

Supplier goes for review

Checks DetailsAdds Information

Clicks on the link for reviewFINISH

Email to Requestor

Reject

Email with Supplier Details

Submits

Approver

Supplier goes for approval

Approves the Supplier

Supplier is created

Requestor is emailed

Requestor and reviewer are emailed

RejectFINISH

FINISH

Supplier Creation

Page 10: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Requestor

Search for Supplier

Email with Supplier details

Request a Vendor Reactivation

Found but Inactive

Submits

Approver

Supplier goes for approval

Supplier is reactivated

Approves the reactivationFINISH

Email to Requestor

Email to Requestor

FINISH

Rejects the reactivation

Supplier Reactivation

Page 11: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX – Application Express

LDAP – we use the built in LDAP authenticationFunction in APEX to authenticate via Active Directory

Page 12: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX – Supplier Search

Forced to initially search for the supplier in Financials

Supplier Name and Address automatically enclosed in % wildcard. Searches are case insensitive.

Page 13: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX – Search Results

The result set returns vendors in the po_vendors and po_vendor_sites views and also any PENDING vendors still in the workflow process which may match their criteria.

Page 14: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX –New Supplier Form

Page 15: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX –New Supplier Form

Page 16: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX – Special Validations

City We use an AJAX HTTP call to validate city against our list of cities in the AJAX database. If an invalid city is used then a city selection box is automatically popped up. This is all done using Javascript and HTML.

PostcodeWe link out to the NZ Post site so end users can lookup correct post codes.

Bank AccountWe have a bank account validation program which ensures the bank account is in the correct format.

Page 17: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX – Storing the dataWe use the APEX database to store a copy of the request in the ewapps_po_vendors table.

There is a unique ID for each request which is used to raise the business event and is used for the workflow itemkey.

Details about the approver, reviewer and process dates are kept in this table.

Once the vendor is approved and created in Oracle Financials this table is updated with the corresponding vendor_id and vendor_site_id.

Page 18: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow – Business EventThere are two things we must do before we can call our workflow:

Setup the Business event

Setup the workflow

Our business event is called ew.apps.ap.vendor.create and it subscribes to our workflow EWPOVEND.

Page 19: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow – Raise the Business EventInside APEX when the requestor submits the vendor for creation – we call out to the Oracle Financials database package to raise the event.

There are two parameters:

The event name (ew.apps.ap.vendor.create)

A unique itemkey

Page 20: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow – Raise the Business EventThe itemkey will uniquely identify this workflow.

In this case we use the primary key from our APEX ewapps_po_vendors table so we can easily link our workflow back to our vendor.

Page 21: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow – Raise the Business Event

This is the PL/SQL code which raises the event:

PROCEDURE raise_event(eventname IN VARCHAR2, itemkey IN VARCHAR2 ) ISl_parameter_list wf_parameter_list_t;l_debug varchar2(200);BEGIN wf_event.raise(eventname, itemkey);EXCEPTION WHEN OTHERS THEN WF_CORE.CONTEXT('EW_WF',eventname, itemkey); RAISE;END;

Page 22: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

WorkflowLoad Attributes

This function is where we load up all the details that workflow will need to send notifications and make decisions about what to do.

We select the details from the APEX vendor temporary table:

This code assigns the value of the vendor name to the attribute VENDOR_NAME.

select * into ewapps_po_vendors_recfrom ewapps_po_vendorswhere id = p_item_key;

wf_engine.setitemattrtext (itemtype => p_item_type, itemkey => p_item_key, aname => 'VENDOR_NAME', avalue =>

ewapps_po_vendors_rec.vendor_name);

Page 23: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

WorkflowPL/SQL calls from Oracle Workflow

Here is an example of how the pl/sql procedure to set the attribute values looks.

Oracle Workflow expects these parameters:

PROCEDURE setattributevalues( p_item_type IN VARCHAR2, p_item_key IN VARCHAR2, p_actid IN NUMBER, p_funmode IN VARCHAR2, p_result OUT VARCHAR2 )

Page 24: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

WorkflowPL/SQL calls from Oracle Workflow

Column Explanation

P_item_type This is passed from workflow and will be the internal name of the process. This parameter can then be passed on to further workflow calls.

P_item_key This is passed from workflow and is the unique ID for the workflow. In this case this is the ID we raised the business event with and links directly back to our APEX vendor table.

P_Act_id This is passed from workflow and is the activity related to this function. Not used in this example.

P_Funmode Not used in this example.

P_result Where a process or function expects a result passed back – this parameter can be used.

Page 25: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow Model

Page 26: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow – Create Supplier

Page 27: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow – Reactivate Supplier

Page 28: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow - NotificationsThe reviewer will receive one email notification for each supplier request containing all the entered supplier details.

A reviewer can review each supplier request individually by clicking the “Click here to SUBMIT/REJECT the Supplier” url or open a list of pending requests by clicking the “Click here to see all Pending Suppliers for review” url in the email notification.

Page 29: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow - NotificationsHere is an example of the email notification in Outlook the reviewer received for a new supplier request.

Notice the only option is to click on a URL. The Reviewer and Approver are required to log into the Application to respond to the notifications.

Page 30: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX - Review Upon clicking on the URL the reviewer can check all the supplier details and add/amend additional information if required.

Page 31: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX - Review

A summarised review/approval screen is also available:

Page 32: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX - Review If Suppliers already exist with the same bank account, they are displayed to the reviewer and approver in this screen.

Page 33: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX Review Before submitting for final approval the reviewer can add comments if required

Page 34: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Workflow – Review RejectionIf the reviewer decides to reject the supplier for creation they are required to enter comments.

The email notification goes back to the requestor with those comments.

Page 35: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX Review Submitting the Notification

Clicking the Submit or Reject button in APEX will call our Oracle database package to respond to the notification.

We pass in the notification id, the apex user, the action and any comments.

Page 36: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX Review Submitting the Notification

In the Oracle Financials database package the following actions occur to action the notification. Our Notification has an attribute associated with it called: REVIEWCOMMENTS.

First we set the value of this attribute so these comments can be passed on the next step in the workflow

WF_NOTIFICATION.SETATTRTEXT(NID => nid, ANAME =>'REVIEWCOMMENTS', Avalue=> comments);

Page 37: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX Review Submitting the Notification

Then we set the value of the RESULT (this will be SUBMIT or REJECT)

WF_NOTIFICATION.SETATTRTEXT(NID => nid, ANAME => 'RESULT', Avalue=> status);

Then we respond to the notification – passing in the username. This will in effect submit the notification with the result and comments as we have set.

WF_NOTIFICATION.RESPOND(NID =>nid, RESPONDER=>username);

Page 38: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

APEX Approve Approving the Notification

Once submitted and the notification has been passed onto the Approver, the notification is then removed from the Reviewers list and now appears in the Approvers list. The approver will now receive a notification.

Page 39: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

WorkflowApproving the Notification

The approver will receive one email for each supplier requested with the supplier details.

A approver can review each supplier request one by one from within their notification OR

View all pending approvals via APEX, depending on which URL they click on in their notification.

Page 40: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

WorkflowRejecting the Notification

If the approver decides to reject the supplier for creation they are required to enter comments.

The email goes back to the reviewer and the requestor.

Page 41: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Oracle Financials – Supplier Creation

Supplier Supplier Site Bank Account and Assignment Contact information Descriptive flexfields – Requestor, Reviewer, Approver

Upon Approval the following Supplier data is created automatically in Oracle Financials using built in API calls:

Page 42: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Other AdvantagesLeverage of standard Oracle Workflow features, e.g.:

Vacation Rules

Process Flow

Escalation by System Administrator

Use profiles to nominate the reviewer and approver

No synchronization between applications required

Is also a useful supplier search tool.

Page 43: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

More informationWorkflow APIS and usage:Oracle Workflow Guide RELEASE 2.6.2- can be downloaded from Oracle

APEX documentation http://www.oracle.com/technology/products/database/application_express/html/doc.html

Page 44: Electronically approve and create Suppliers in Oracle Financials using a combination of APEX and Oracle Workflow. NZOUG Conference 2010 Brad Sayer Team

Questions?