Dynamically Changing a Service's Connection at Run Time
You can run an adapter service using a connection other than the default connection that was associated with the service when the service was created. To override the default, you must code your flow to pass a value through the pipeline into a service's $connectionName field.
For example, you have a flow whose primary purpose is to create an entry on the production AR System Server. However, you want the flow to have the capability to create the entry on the test server, with the decision of which AR System Server to update to be made programmatically at run time. The output signature of the flow's first service contains a field called Target, which indicates the target server. The flow could branch based on the value in Target:
If
Target contains the value
Production, the second service in the flow, a
Create adapter service, would ignore
$connectionName, and as a result, use its default connection to create the entry on the production server.
However, if
Target contains the value
Test, the second service in the flow would use the value in the
$connectionName from the pipeline and use that connection to update the test server.
Keep in mind these restrictions when using dynamic connections:
The entry with which an adapter service interacts must be deployed on both the production and test AR System Servers.
The $connectionName field is present only in services Created with
Designer.