TPPOST-post an event
01TPEVTDEF-REC.
COPY TPEVTDEF.
01TPTYPE-REC.
COPY TPTYPE.
01DATA-REC.
COPY User data.
01TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPPOST" USINGTPEVTDEF-RECTPTYPE-RECDATA-RECTPSTATUS-REC.
The caller uses TPPOST to post an event and any accompanying data. The event is named by EVENT-NAME in TPEVTDEF-REC and DATA-REC contains the data to be posted. The posted event and its data are dispatched by the BEA TUXEDO system event broker to all subscribers whose subscriptions successfully evaluate against EVENT-NAME and whose optional filter rules successfully evaluate against DATA-REC.
EVENT-NAME must be 31 characters or less, but cannot be SPACES. EVENT-NAME's first character cannot be a dot (".") as this character is reserved as the starting character for all events defined by the BEA TUXEDO system itself.
DATA-REC is the typed record to be posted and LEN in TPTYPE-REC specifies the amount of data in DATA-REC that should be posted with the event. Note that if DATA-REC is a record of a type that does not require a length to be specified, then LEN is ignored (and may be 0). If DATA-REC is a record of a type that does require a length to be specified, then LEN must not be 0 (if it is 0, no data will be posted). If REC-TYPE in TPTYPE-REC is SPACES, DATA-REC and LEN are ignored and the event is posted with no data.
When TPPOST is used within a transaction, the transaction boundary can be extended to include those servers and/or stable-storage message queues notified by the event broker. When a transactional posting is made, some of the recipients of the event posting are notified on behalf of the poster's transaction (for example, servers and queues), while some are not (for example, clients).
If the poster is within a transaction and TPTRAN is set, the posted event goes to the event broker in transaction mode such that it dispatches the event as part of the poster's transaction. The broker dispatches transactional event notifications only to those service routine and stable-storage queue subscriptions that had TPEVTRAN set in TPEVTDEF-REC when the subscription was made. Client notifications, and those service routine and stable-storage queue subscriptions that had TPEVNOTRAN set in TPEVTDEF-REC when the subscription was made, are also dispatched by the event broker but not as part of the posting process' transaction.
Following is a list of valid settings in TPEVTDEF-REC:
TPNOTRAN
TPNOTRAN or TPTRAN must be set.
TPTRAN
TPNOTRAN or TPTRAN must be set.
TPNOREPLY
TPPOST not to wait for the event broker to process all subscriptions for EVENT-NAME before returning. When TPNOREPLY is set, EVENT-COUNT in TPEVTDEF-REC is set to zero regardless of whether TPPOST returns successfully or not. When the caller is in transaction mode, this setting cannot be used when TPTRAN is also set. Either TPNOREPLY or TPREPLY must be set.
TPREPLY
TPPOST to wait for all subscriptions to be processed before returning. When TPREPLY is set, the routine returns [TPOK] on success and sets EVENT-COUNT in TPEVTDEF-REC to the number of event notifications dispatched by the event broker on behalf of EVENT-NAME. When the caller is in transaction mode, this setting must be used when TPTRAN is also set. Either TPNOREPLY or TPREPLY must be set.
TPNOBLOCK
TP-STATUS to [TPEBLOCK]. Either TPNOBLOCK or TPBLOCK must be set.
TPBLOCK
TPBLOCK is specified and a blocking condition exists, the caller blocks until the condition subsides or a timeout occurs (either transaction or blocking timeout). Either TPNOBLOCK or TPBLOCK must be set.
TPNOTIME
TPNOTIME or TPTIME must be set.
TPTIME
TPNOTIME or TPTIME must be set.
TPSIGRSTRT
TPNOSIGRSTRT or TPSIGRSTRT must be set.
TPNOSIGRSTRT
TP-STATUS to [TPGOTSIG]. Either TPNOSIGRSTRT or TPSIGRSTRT must be set.
Upon successful completion, TPPOST sets TP-STATUS to [TPOK]. In addition, EVENT-COUNT contains the number of event notifications dispatched by the event broker on behalf of EVENT-NAME (that is, postings for those subscriptions whose event expression evaluated successfully against EVENT-NAME and whose filter rule evaluated successfully against DATA-REC). Upon return where TP-STATUS is set to [TPESVCFAIL], EVENT-COUNT contains the number of non-transactional event notifications dispatched by the event broker on behalf of EVENT-NAME.
Under the following conditions, TPPOST fails and sets TP-STATUS to one of the following values. (Unless otherwise noted, failure does not affect the caller's transaction, if one exists.)
TPEINVAL]
EVENT-NAME is SPACES).
TPENOENT]
TPETRAN]
TPTRAN was set, and TPPOST contacted an event broker that does not support transaction propagation (that is, TMUSREVT(5) is not running in a BEA TUXEDO system group that supports transactions).
TPETIME]
TPBLOCK and TPTIME were specified. If a transaction timeout occurred, any attempts to do new work will fail with [TPETIME] until the transaction has been aborted.
TPESVCFAIL]
EVENT-COUNT contains the number of non-transactional event notifications dispatched by the event broker on behalf of EVENT-NAME; transactional postings are not counted since their effects will be aborted upon completion of the transaction. Note that so long as the transaction has not timed out, further communication may be performed before aborting the transaction and that any work performed on behalf of the caller's transaction will be aborted upon transaction completion (that is, for subsequent communication to have any lasting effect, it should be done with TPNOTRAN set).
TPEBLOCK]
TPNOBLOCK was specified.
TPGOTSIG]
TPNOSIGRSTRT was specified.
TPEPROTO]
TPPOST was called in an improper context.
TPESYSTEM]
TPEOS]
TPSUBSCRIBE(), TPUNSUBSCRIBE(), EVENTS(5), TMUSREVT(5), TMSYSEVT(5)