Programming Guide |
Forwards service request data to another service
service_forwardserviceName
[(message
)] [ PRIORITYpriority
]
serviceName
- The JIF-defined service to get the forwarded service request. This argument must be either a variable containing the name of a service or a quoted string.
message
- Message data to relay from the original service to
serviceName
. You can omit this argument only if both services have identical message data definitions; in this case,serviceName
gets the original service's message data. To forward no data, supply an empty argument()
.A supplied message must conform to the JIF definition for
serviceName
. For more information on message data types, refer to "Service Messages and Data Types" in JetNet/Oracle Tuxedo Guide.PRIORITY
priority
- A signed or unsigned integer that sets the priority for
serviceName
. If signed,priority
overrides any priority set in this service's JIF definition; if signed,priority
is added or subtracted from the default priority for all services, set in the middleware configuration file. In both cases, a service's priority level must be between1
and100
.
JetNet, Oracle Tuxedo
Server
The
service_forward
command passes the current service request to another service for processing. After the service is forwarded, the current service routine terminates immediately, thereby terminating processing of the current request by this agent. All properties are restored to normal default settings after execution ofservice_forward
.For example, this JPL forwards credit data from service
TRANSFER
to theDEPOSIT
service:// Service TRANSFER
...receive ARGUMENTS ({acct_id_deb, amount_deb, \
acct_id_cred, amount_cred})...
service_forward "DEPOSIT" ({acct_id_cred, amount_cred})If an exception of severity
TP_ERROR
or greater occurs before the forward operation begins, the service request is not forwarded. Instead, the service returns withTP_FAILURE
. If the service is part of a transaction, the transaction is marked for abort-only and is not committed; it can only be rolled back explicitly by the user.Services are typically forwarded with their original message data by omitting the message argument. This implicit passing of data is valid only if both services define their input message arguments identically.
service_forward
can generate the following exceptions:
receive, service_call, service_return