PEX Outbound Adapters
Business operations use outbound adapters to send out specific types of data from the production. You can write a custom outbound adapter that is used by an ObjectScript business operation, or it can be used by a business operation that is also written in a PEX-supported language. For general information related to all production components written in an external language, see About Business Hosts and Adapters.
Developing a Custom Adapter
To write an outbound adapter in an external language, extend one of the following classes:
Language | Class |
---|---|
Java | com.intersystems.enslib.pex.OutboundAdapter |
.NET | InterSystems.EnsLib.PEX.OutboundAdapter |
Python | iris.pex.OutboundAdapter |
Within the outbound adapter, you can create all the methods you need to successfully send out data from the production. Each of these methods can be called from the business operation associated with the adapter. The business operation can call a method with arguments of arbitrary objects and literals. For details on how the business operation calls the adapter methods, see Invoking Adapter Methods.
Implementing Abstract Methods
In addition to creating methods that send out data from the production, your remote outbound adapter class must implement a few abstract methods. For details about these methods, see PEX API Reference.
Registering the Adapter
Once you are done writing the code for the PEX adapter, you are ready to register it. Registering the adapter generates an ObjectScript proxy class that a business operation can use to identify the adapter and defines the external language server that the production uses to connect to the adapter. For details on registering the adapter, see Registering a PEX Component.
Adding the Adapter to a Business Operation
A PEX adapter can be used by a PEX business operation or by a native ObjectScript business operation. The process of configuring a business operation so it uses the PEX adapter varies depending on the type of business operation. Both scenarios require the adapter to be registered as a PEX component.
When a PEX business operation is using the PEX adapter, the remote class of the business operation uses a method to identify the adapter. For details, see Using an Outbound Adapter.
Like all native ObjectScript business operations, a native business operation using a PEX adapter identifies the adapter using an ADAPTER parameter. In this case, the ADAPTER parameter is set to the name of the PEX adapter’s ObjectScript proxy class. By default, this proxy class shares the name of the adapter’s remote class, but a custom proxy name might have been defined when the adapter was registered.