Programming Guide



service_forward

Forwards service request data to another service

Synopsis

service_forward serviceName [( message)] [ PRIORITY priority]

Arguments

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 between 1 and 100.

Environment

JetNet, Oracle Tuxedo

Scope

Server

Description

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 of service_forward.

For example, this JPL forwards credit data from service TRANSFER to the DEPOSIT 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 with TP_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.

Exceptions

service_forward can generate the following exceptions:

Exception Severity Cause
TP_INVALID_ARGUMENT
TP_COMMAND

Data is passed by omitting (argList), but the services do not have identical input buffers defined

TP_INVALID_ARGUMENT_LIST
TP_COMMAND

The return parameters of the services are not identically defined

TP_INVALID_OPTION_VALUE
TP_COMMAND

The absolute priority value was out of range (must be from 1 to 100)

TP_INVALID_SERVICE
TP_COMMAND

Service specification is invalid

See Also

receive, service_call, service_return