Business operations connect with external systems and send messages to them via an outbound adapter.
For general information related to all production components written in a PEX-supported language, see About Business Hosts and Adapters.
Using an Outbound Adapter
Within a production, a business operation uses an outbound adapter to communicate with systems outside the production. When developing a PEX business operation, you can include a special method in the remote class to define which outbound adapter the business operation uses. This outbound adapter can be a PEX adapter or a native ObjectScript adapter.
The method used to specify the outbound adapter for the PEX business operation is getAdapterType(). For example, if the PEX business operation uses a custom PEX outbound adapter, your remote class might include:
When using a PEX adapter, the getAdapterType method should return the name of the ObjectScript proxy class that was specified when the adapter was registered. By default, this proxy name is the same as the remote class, but a custom name might have been defined.
Invoking Adapter Methods
A business operation uses its outbound adapter by invoking methods defined in the adapter’s code. The syntax for invoking these methods varies depending on whether the business operation is a PEX component or a native ObjectScript class. For details on invoking the PEX adapter methods from a native business operation, see Accessing Properties and Methods from a Business Host.
If your business operation is a PEX component, use Adapter.invoke() to call the adapter’s method. Its signature is:
Adapter.invoke("methodName", arguments)
Where:
For example, to invoke the adapter’s printString method, add the following code to your business operation:
When the business operation passes a primitive to the adapter, the same primitive is received by the adapter. However, by default, when the business operation passes an object to the adapter, the object is serialized into JSON and received by the adapter as an IRISObject type. If you want to change this behavior so the adapter receives and returns the same object type, see Sharing a Connection.