01.02.2013 Views

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

17<br />

Using Event-Driven <strong>Publishing</strong><br />

Modern business processes often require <strong>the</strong> blending of au<strong>to</strong>mation in<strong>to</strong> <strong>the</strong> work<br />

environment through <strong>the</strong> invocation of behind-<strong>the</strong>-scenes functions and procedures.<br />

Behind-<strong>the</strong>-scenes tasks can include <strong>the</strong> au<strong>to</strong>matic production of output such as an<br />

invoice that prints au<strong>to</strong>matically when an order is processed, a <strong>Web</strong> site that is<br />

au<strong>to</strong>matically updated with current data, or an au<strong>to</strong>matic e-mail with fresh report<br />

output when a transaction is completed.<br />

Au<strong>to</strong>matic output in response <strong>to</strong> events used <strong>to</strong> be a fairly complicated effort,<br />

particularly if you wished <strong>to</strong> produce <strong>the</strong> same results possible through interactive,<br />

RAD development <strong>to</strong>ols, such as <strong>Oracle</strong> <strong>Reports</strong> Developer.<br />

To address <strong>the</strong> requirement of au<strong>to</strong>matic output, <strong>Oracle</strong> introduced a scheduling<br />

mechanism in <strong>Oracle</strong>AS <strong>Reports</strong> Services that enabled <strong>the</strong> invocation of reports on a<br />

scheduled basis without requiring additional user interaction. But this left one<br />

requirement unresolved: <strong>the</strong> ability <strong>to</strong> au<strong>to</strong>matically run a report in response <strong>to</strong> an<br />

event in <strong>the</strong> database, such as <strong>the</strong> insertion of a record or <strong>the</strong> change of a value.<br />

With <strong>the</strong> <strong>Oracle</strong>AS <strong>Reports</strong> Services Event-Driven <strong>Publishing</strong> API, you can<br />

au<strong>to</strong>matically run a report in response <strong>to</strong> an event in <strong>the</strong> database, such as <strong>the</strong><br />

insertion of a record or <strong>the</strong> change of a value. The Event-Driven <strong>Publishing</strong> API is a<br />

PL/SQL API that allows for <strong>the</strong> au<strong>to</strong>matic submission of jobs <strong>to</strong> <strong>Oracle</strong>AS <strong>Reports</strong><br />

Services from within <strong>the</strong> database.<br />

This chapter provides a look at <strong>the</strong> Event-Driven <strong>Publishing</strong> API and includes<br />

examples of its use. It includes <strong>the</strong> following sections:<br />

■ The Event-Driven <strong>Publishing</strong> API<br />

■ Debugging Applications that Use <strong>the</strong> Event-Driven <strong>Publishing</strong> API<br />

■ Invoking a Report From a Database Event<br />

■ Integrating with <strong>Oracle</strong> Advanced Queuing<br />

17.1 The Event-Driven <strong>Publishing</strong> API<br />

17.1.1 Elements of <strong>the</strong> API<br />

The Event-Driven <strong>Publishing</strong> API is a PL/SQL package that provides <strong>the</strong> basic<br />

functions required for <strong>the</strong> development of procedures that respond <strong>to</strong> events in <strong>the</strong><br />

database. Event-driven jobs are submitted using <strong>the</strong> HTTP pro<strong>to</strong>col. The server assigns<br />

a unique job_ident record <strong>to</strong> every call, useful for tracking <strong>the</strong> status of <strong>the</strong> job.<br />

The API consists of several key elements:<br />

Using Event-Driven <strong>Publishing</strong> 17-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!