Previous  Next          Contents  Index  Glossary

Forced Synchronous Processes

A workflow process is executed synchronously when it includes consecutive function activities in a single thread that are not deferred to the background engine. The Workflow Engine passes control back to the calling application when it completes those activities and reaches a notification, block, wait, deferred or end activity.

The Workflow Engine also supports a special class of synchronous processes called forced synchronous processes. A forced synchronous process completes in a single SQL session from start to finish and never inserts into or updates any database tables. As a result, the execution speed of a forced synchronous process is significantly faster than a typical synchronous process.

There may be cases when your application requires a forced synchronous process to generate a specific result quickly and recording an audit trail is not a concern. For example, in Oracle Applications, several products require Account Generator workflows to generate a meaningful flexfield code derived from a series of concatenated segments pulled from various tables. The Account Generator workflows are forced synchronous processes that compute and pass back completed flexfield codes to the calling applications instantaneously.

To create a forced synchronous process, you need to set the itemkey of your process to #SYNCH or wf_engine.eng_synch, which returns the #SYNCH constant when you call the necessary WF_ENGINE APIs. Since a forced synchronous process never writes to the database, using a non-unique itemkey such as #SYNCH is not an issue. Your process definition, however, must adhere to the following set of restrictions:

Attention: If you encounter an error from a forced synchronous process, you should rerun the process with a unique item key in asynchronous mode and check the error stack using the Workflow Monitor or the script wfstat.sql. If the synchronous process completes successfully, the error you encountered in the forced synchronous process is probably due to a violation of one of the above listed restrictions. See: Wfstat.sql.


         Previous  Next          Contents  Index  Glossary