Contents
This sample demonstrates the use of the TIBCO StreamBase® Adapter for FXall Relationship Trading Customer.
-
In the Package Explorer, double-click
fxall.sbapp
. -
Select the Parameters tab.
-
Enter site-specific values for your FXall host (typically an HTTPS URI), username, and password. Enter the absolute path of the directory containing your FXall keystore files.
-
Click the Run button. This opens the SB Test/Debug perspective and starts the application.
-
In the Test/Debug Perspective, open the Application Output view. If connectivity is configured correctly, look for tuples emitted on the
Status
streams indicating a connection has been opened to your FXall server. -
In the Manual Input view, select the
QueryRequest
stream, enter a value in theTag
field, and click . A tuple is emitted on theQueryResponse
stream containing information retrieved from the FXall server, including the set of valid accounts, providers, currencies, tenors. -
Select the
SubmitDeal
stream, enter values in the following required fields, and click . Missing or invalid input will result in a tuple from theFXallOutputStatus
stream describing the invalid input.-
UserId (note: the sample application appends a sequence number to the UserId to ensure its uniqueness)
-
TwoWay
-
Providers (enter at least one)
-
Order.InstrumentOrders (create at least one)
-
Order.InstrumentOrder.Type
-
Order.InstrumentOrder.BaseCurrency
-
Order.InstrumentOrder.TermsCurrency
-
Order.InstrumentOrder.DealtCurrency
-
Order.InstrumentOrder.Legs (one required for SPOT deals)
-
Order.InstrumentOrder.Leg.ValueDateType
-
Order.InstrumentOrder.Leg.Requirements (create at least one)
-
Order.InstrumentOrder.Leg.Requirement.TakerBuysBase (required for one-way deals)
-
Order.InstrumentOrderLeg.Requirement.Account
-
Order.InstrumentOrderLeg.Requirement.DealAmount
-
-
Assuming a valid deal was entered, one or more tuples are emitted on the
FXallEvents
stream indicating the deal was submitted successfully (EventType=SubmitOk
) and, possibly, that the deal was picked up by one or more providers (EventType=DealPickup
), which start providing quotes (EventType=NewPrice
). -
Select the
AcceptDeal
stream, enter in theQuoteId
field the corresponding value from one of the NewPrice tuples, entertrue
orfalse
in theTakerBuysBaseField
(if the corresponding field had not been set when submitting the deal), and click . -
Assuming the deal is accepted, a deal logged tuple (
EventType=DealLogged
) is emitted on theFXallEvents
stream. -
When done, press F9 or click the Stop Running Application button.
This section describes how to run the sample in UNIX terminal windows or Windows command prompt windows. On Windows, be sure to use the StreamBase Command Prompt from the Start menu as described in the Test/Debug Guide, not the default command prompt.
Note
Because of the complexity of the input and output schemas used by this adapter, it is not practical to submit deals from terminal windows.
-
Open three terminal windows on UNIX, or three StreamBase Command Prompts on Windows. In each window, navigate to your workspace copy of the sample, as described above.
-
In window 1, type:
sbd fxall.sbapp
-
In window 2, type:
sbc dequeue -v
This window will display the tuples dequeued from the adapters' output ports.
-
In window 3, issue a query request :
echo MyTag,null,null,null,null,null,null,null,null,null,null | sbc enqueue QueryRequest
-
Observe in windows 2 a tuple emitted from the QueryResponse stream.
-
In window 3, type the following command to terminate the server and dequeuer:
sbadmin shutdown
In StreamBase Studio, import this sample with the following steps:
-
From the top menu, click
→ . -
Select this sample from the Embedded Input Adapters list.
-
Click OK.
StreamBase Studio creates a project for this sample.
When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.
Important
Load this sample in StreamBase Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.
Using the workspace copy of the sample avoids the permission problems that can occur when trying to work with the initially installed location of the sample. The default workspace location for this sample is:
studio-workspace
/sample_fxall
See Default Installation
Directories for the location of studio-workspace
on your system.
In the default TIBCO StreamBase installation, this sample's files are initially installed in:
streambase-install-dir
/sample/fxall
See Default Installation
Directories for the location of streambase-install-dir
on your system. This location
may require administrator privileges for write access, depending on your platform.