Oracle Workflow Developer's Guide Release 2.6.3.5 Part Number B12161-02 |
Previous | Next | Contents | Index | Glossary |
Oracle Workflow provides two standard queue handlers for queues that use the WF_EVENT_T format, WF_EVENT_QH for normal processing and WF_ERROR_QH for error queues. Oracle Workflow also provides a standard queue handler named WF_EVENT_OJMSTEXT_QH for queues that use JMS Text messages as their payload format.
You can also create your own custom queue handlers for queues that use other formats. If you create a custom queue handler, you must provide standard enqueue and dequeue APIs in your package. Java queue handlers must also include some other standard APIs.
Mapping Between WF_EVENT_T and SYS.AQ$_JMS_TEXT_MESSAGE, Oracle Workflow API Reference
When an event message is being sent, the generic WF_EVENT.Enqueue procedure determines which queue handler is associated with the specified outbound agent and calls the Enqueue procedure in that queue handler to enqueue the message.
The PL/SQL Enqueue procedure must have the following standard API:
procedure enqueue (p_event in WF_EVENT_T,
p_out_agent_override in WF_AGENT_T);
The arguments for the procedure are as follows:
p_event | The event message. |
p_out_agent_ override | The outbound agent on whose queue the event message should be enqueued. |
When an event message is being received, the WF_EVENT.Listen procedure determines which queue handler to use with the specified inbound agent and calls the Dequeue procedure in that queue handler to dequeue the message.
The PL/SQL Dequeue procedure must have the following standard API:
procedure dequeue (p_agent_guid in raw,
p_event out WF_EVENT_T);
The arguments for the procedure are as follows:
p_agent_guid | The globally unique identifier of the inbound agent from whose queue the event message should be dequeued. |
p_event | The event message. |
public interface QueueHandlerInterface
{
public void init(Connection conn,
AgentEO agent,
Log log,
String uniqueLogId,
Properties props)
throws QueueHandlerException;
public String enqueue(BusinessEvent event)
throws QueueHandlerException;
public BusinessEvent dequeue()
throws QueueHandlerException;
public void destroy();
public String getMsgId()
throws QueueHandlerException;
public CLOB getEventData();
}
In addition to the enqueue and dequeue APIs, a Java queue handler must also contain methods to initialize the connection to the agent, destroy objects created during queue processing after the processing is complete, retrieve a message ID from a message on the queue, and retrieve the CLOB reference to the event data of the last business event dequeued by the queue handler.
The arguments for the init method are as follows:
conn | The JDBC connection used to establish the connection with the queue. |
agent | The AgentEO object that contains the information for this agent and its queue. |
log | The Log object which can be used for logging. |
uniqueLogId | The log ID for recording debug messages. |
props | The property mapping for enqueue and dequeue operations. |
event | The BusinessEvent object to be enqueued. |
Oracle Workflow Javadoc on OracleMetaLink
Previous | Next | Contents | Index | Glossary |