
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Orchestra Tutorials &#8211; FIX Trading Community</title>
	<atom:link href="https://www.fixtrading.org/category/orchestra-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fixtrading.org</link>
	<description>Version 2.1.</description>
	<lastBuildDate>Sat, 21 Jan 2023 16:12:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>

<image>
	<url>https://www.fixtrading.org/wp-content/uploads/2017/03/favicon.png</url>
	<title>Orchestra Tutorials &#8211; FIX Trading Community</title>
	<link>https://www.fixtrading.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Extension Packs now with Orchestra XML File</title>
		<link>https://www.fixtrading.org/eps-now-with-orchestra-xml-file/</link>
		
		<dc:creator><![CDATA[Hanno Klein]]></dc:creator>
		<pubDate>Tue, 07 Apr 2020 16:26:34 +0000</pubDate>
				<category><![CDATA[GTC Blog]]></category>
		<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=57630</guid>

					<description><![CDATA[The FIX Global Technical Committee (GTC) is proud to announce the availability of a FIX Orchestra XML file with every Extension Pack (EP) starting with EP255. The file follows Version...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><img decoding="async" src="https://cdnws.fixtrading.org/wp-content/uploads/2020/02/FIXorchestraLogo.png" /></p>
<p>The FIX Global Technical Committee (GTC) is proud to announce the availability of a FIX Orchestra XML file with every Extension Pack (EP) starting with EP255. The file follows Version 1.0 of the new FIX Technical Standard <em>FIX Orchestra</em> published in February 2020 (<a href="https://www.fixtrading.org/standards/fix-orchestra/">https://www.fixtrading.org/standards/fix-orchestra/</a>). It is a metadata standard that defines all elements of a messaging application as well as the syntax for the rules that govern these elements. The term <em>FIX Orchestra</em> <em>file</em> stands for the physical representation of an electronic interface that follows the FIX Orchestra standard and uses the XML format.</p>
<h2 id="objective">Objective</h2>
<p>The FIX Orchestra file published with every EP contains all FIX messages, components, repeating groups, fields and values (aka FIX Latest). It does not use any of the extended features of FIX Orchestra to define subsets, scenarios, workflows, etc. as it simply represents the complete repository.</p>
<p>The FIX Trading Community can use it as a central source and <em>Golden Record</em> of information for any of their FIX interfaces. It is intended for development and testing environments and to be consumed by applications generating artifacts such as specifications, source code and test cases.</p>
<h2 id="extension-pack-content">Extension Pack Content</h2>
<p>Every EP (<a href="https://www.fixtrading.org/extension-packs/">https://www.fixtrading.org/extension-packs/</a>) contains a number of individual files as follows:</p>
<ul>
<li><strong>ASBUILT</strong>: PDF document with the Gap Analysis showing only the <em><strong>incremental</strong></em> extensions to FIX together with the newly assigned tag numbers and values</li>
<li><strong><span style="color: red;">NEW</span> Orchestra</strong>: ZIP file with the representation of FIX Latest (complete application layer) using the new Technical Standard FIX Orchestra Version 1.0</li>
<li><strong>Repository</strong>: ZIP file with the two legacy representations of FIX Latest (complete application layer), i.e. basic repository and unified repository (aka FIX Repository 2010 Edition)</li>
<li><strong>FIXML Schema</strong>: ZIP file with a set of XML files representing the FIXML encoding of FIX Latest (complete application layer)</li>
</ul>
<h2 id="faq">FAQ</h2>
<table>
<thead>
<tr class="header">
<th><strong>Question</strong></th>
<th><strong>Answer</strong></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>What is the difference between the FIX Orchestra file published by FIX and FIX Orchestra files I exchange with counterparties to define our Rules of Engagement?</td>
<td>There is no difference in structure, i.e. both are based on the Technical Standard FIX Orchestra Version 1.0. The main differences are in the scope of the content and the number of Orchestra features used.</p>
<p>The FIX Orchestra file published by FIX as part of an EP does not use advanced features such as scenarios or workflows. These may be relevant when publishing an Orchestra file together with recommended practices having a narrow business focus.</p>
<p>A FIX Orchestra file representing Rules of Engagement between two counterparties is only a small subset of the FIX Orchestra file published by FIX. However, it will contain additional elements such as user defined fields or values and may use advanced features to describe the desired behavior.</td>
</tr>
<tr class="even">
<td>What is the difference between the FIX Orchestra file and the FIX Repository file published by FIX?</td>
<td>The content is identical in terms of the content, i.e. covering the complete application layer (FIX Latest). However, the structure of the files is quite different.</p>
<p>The FIX GTC has developed a tool to migrate an existing unified repository to a FIX Orchestra file. Please contact the FPL Program Office if you are looking into the transition to FIX Orchestra.</td>
</tr>
<tr class="odd">
<td>How long will the legacy representations of FIX Latest (basic and unified repository) be published alongside the new representation with FIX Orchestra?</td>
<td>The legacy representations of FIX Latest (basic and unified repository) will continue to be part of an EP as long as it is required to support existing applications in the community.</p>
<p>We encourage the community to get involved with FIX Orchestra to discover the benefits of a transition. The FIX GTC is also working on a number of tools making it easier to get started with FIX Orchestra, also if a FIX repository had not been used before.</td>
</tr>
<tr class="even">
<td>Where can I learn how to use FIX Orchestra?</td>
<td>The documents describing the Technical Standard are available <a href="https://www.fixtrading.org/standards/fix-orchestra/">here</a>. If you are a FIX member, you can join the FIX Orchestra Working Group to find out about available tools to get you started. The FIX Trading Community also has a number of public projects on <a href="https://github.com/FIXTradingCommunity" target="_blank" rel="noopener noreferrer">GitHub</a>. This also includes Orchestra <a href="https://github.com/FIXTradingCommunity/fix-orchestra/wiki" target="_blank" rel="noopener noreferrer">tutorials</a>.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Concepts-Part5-Service-Offerings-And-Session-Configurations</title>
		<link>https://www.fixtrading.org/concepts-part5-service-offerings-and-session-configurations-2/</link>
		
		<dc:creator><![CDATA[FIXTrading Community]]></dc:creator>
		<pubDate>Wed, 11 Sep 2019 17:57:28 +0000</pubDate>
				<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=54761</guid>

					<description><![CDATA[Orchestra Concepts Part 5: Service Offerings and Session Configurations The Orchestra Interfaces schema provides a standardized way to specify service offerings and configure sessions for connectivity. Overview Every system that...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><em>Orchestra Concepts Part 5:</em></p>
<h1>Service Offerings and Session Configurations</h1>
<p><strong>The Orchestra Interfaces schema provides a standardized way to specify service offerings and configure sessions for connectivity.</strong></p>
<h2>Overview</h2>
<p>Every system that allows customers or partners to connect uses some stack of communications protocotols. Those protocols must be specified to the peers in order to establish connectivity. We call an application-layer protocol a service offering. A firm may have several service offerings for different business phases, such as order routing, market data, reference data, and post-trade clearing and settlement. The Orchestra Interfaces schema provides a standardized way to specify those APIs.</p>
<p>Commonly, order entry customers are directed to a dedicated gateway by a listening address and port, and sessions are assigned specific identifiers. In FIX, sessions are traditionally identified by a combination of SenderCompID and TargetCompID, but other protocols have different identifiers. It is now common to use public/private key infrastructure to securely identify parties. The Orchestra Interfaces schema provides features for transport connectivity and user identification, either by declared IDs or with security keys.</p>
<h2>Service Offerings</h2>
<p>Each service offering in an Orchestra Interfaces file is specified by an <code>&lt;interface&gt;</code> element under the root <code>&lt;interfaces&gt;</code>. The application layer protocol for a service offering is named in a <code>&lt;service&gt;</code> element. A service is configured with an <em>orchestration</em>, another Orchestra file in the repository schema. It contains the message structures and workflow associated with that service in formats described by parts 1 and 2 of this tutorial.</p>
<p>An orchestration file may be distributed to peers in a bundle with an interfaces file or may be accessible through a web inteface.</p>
<h3>Protocol Stack</h3>
<p>Below application layer, a service runs over a protocol stack that includes a session protocol, message encoding, transport, and possibly other protocols. At each layer, a protocol version and configuration may be given.</p>
<p>Here&#8217;s a sample interface definition with two orchestrations. It all works over TagValue encoding, FIXT session layer, and TCP transport.</p>
<pre><code class="language-xml">&lt;fixi:interface name="Private"&gt;
    &lt;!-- one or more service offerings, with local orchestration file or internet address --&gt;
    &lt;fixi:service name="orderEntry" orchestration="https://mydomain.com/orchestra/orderEntry.xml"/&gt;
    &lt;!-- the protcol stack --&gt;
    &lt;fixi:userInterface name="ATDL" orchestration="https://mydomain.com/orchestra/algo.xml"/&gt;
    &lt;fixi:encoding name="TagValue"/&gt;
    &lt;fixi:sessionProtocol name="FIXT.1.1" reliability="recoverable" orchestration="https://mydomain.com/orchestra/session.xml"/&gt;
    &lt;fixi:transport name="TCP"/&gt;
&lt;/fixi:interfacer&gt;</code></pre>
<h2>Session Configuration</h2>
<p>For each service offering, a party may be assigned one or more sessions. A session configuration includes session identifiers, transport settings, and possibly security keys. Each <code>&lt;sessions&gt;/&lt;session&gt;</code> element is contained by an <code>&lt;interface&gt;</code> that describes its service offering.</p>
<p>Here&#8217;s and example of a session configuration:</p>
<pre><code class="language-xml">&lt;fixi:session name="XYZ-ABC"&gt;
    &lt;!-- inherits services and protocols from interface --&gt;
    &lt;!-- alternate addresses are supported --&gt;
    &lt;fixi:transport address="10.96.1.2:567" use="primary"/&gt;
    &lt;fixi:transport address="10.96.2.2:567" use="secondary"/&gt;
    &lt;!-- there can be any number of identifiers --&gt;
    &lt;fixi:identifier name="SenderCompID"&gt;
        &lt;fixi:value&gt;XYZ&lt;/fixi:value&gt;
    &lt;/fixi:identifier&gt;
    &lt;fixi:identifier name="TargetCompID"&gt;
        &lt;fixi:value&gt;ABC&lt;/fixi:value&gt;
    &lt;/fixi:identifier&gt;
    &lt;!-- tells when session becomes effective so it can be configured in advance --&gt;
    &lt;fixi:activationTime&gt;2019-08-07T09:30:00Z&lt;/fixi:activationTime&gt;
&lt;/fixi:session&gt;</code></pre>
<p>A <code>&lt;session&gt;</code> element can contain configuration for any protocols in the stack that is specific to the session. In this case, the transport is always TCP for the service offering, but each session contains transport settings that are unique to that session. In this example, a primary and secondary port are offered for fail-over.</p>
<p>Optionally, security keys may be provided for a session in a <code>&lt;securityKeys&gt;</code> element. It must follow the textual encoding format described in IETF RFC 7468. Optional parts include certificates and private keys.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Concepts-Part5-Service-Offerings-And-Session-Configurations</title>
		<link>https://www.fixtrading.org/concepts-part5-service-offerings-and-session-configurations/</link>
		
		<dc:creator><![CDATA[FIXTrading Community]]></dc:creator>
		<pubDate>Thu, 29 Aug 2019 19:52:18 +0000</pubDate>
				<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=54667</guid>

					<description><![CDATA[Orchestra Concepts Part 5: Service Offerings and Session Configurations The Orchestra Interfaces schema provides a standardized way to specify service offerings and configure sessions for connectivity. Overview Every system that...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><em>Orchestra Concepts Part 5:</em></p>
<h1>Service Offerings and Session Configurations</h1>
<p><strong>The Orchestra Interfaces schema provides a standardized way to specify service offerings and configure sessions for connectivity.</strong></p>
<h2>Overview</h2>
<p>Every system that allows customers or partners to connect uses some stack of communications protocotols. Those protocols must be specified to the peers in order to establish connectivity. We call an application-layer protocol a service offering. A firm may have several service offerings for different business phases, such as order routing, market data, reference data, and post-trade clearing and settlement. The Orchestra Interfaces schema provides a standardized way to specify those APIs.</p>
<p>Commonly, order entry customers are directed to a dedicated gateway by a listening address and port, and sessions are assigned specific identifiers. In FIX, sessions are traditionally identified by a combination of SenderCompID and TargetCompID, but other protocols have different identifiers. It is now common to use public/private key infrastructure to securely identify parties. The Orchestra Interfaces schema provides features for  transport connectivity and user identification, either by declared IDs or with security keys.</p>
<h2>Service Offerings</h2>
<p>Each service offering in an Orchestra Interfaces file is specified by an <code>&lt;interface&gt;</code> element under the root <code>&lt;interfaces&gt;</code>. The application layer protocol for a service offering is named in a <code>&lt;service&gt;</code> element. A service is configured with an <em>orchestration</em>, another Orchestra file in the repository schema. It contains the message structures and workflow associated with that service in formats described by parts 1 and 2 of this tutorial.</p>
<p>An orchestration file may be distributed to peers in a bundle with an interfaces file or may be accessible through a web inteface.</p>
<h3>Protocol Stack</h3>
<p>Below application layer, a service runs over a protocol stack that includes a session protocol, message encoding, transport, and possibly other protocols. At each layer, a protocol version and configuration may be given.</p>
<p>Here&#8217;s a sample interface definition with two orchestrations. It all works over TagValue encoding, FIXT session layer, and TCP transport.</p>
<pre><code class="language-xml">&lt;fixi:interface name="Private"&gt;
    &lt;!-- one or more service offerings, with local orchestration file or internet address --&gt;
    &lt;fixi:service name="orderEntry" orchestration="https://mydomain.com/orchestra/orderEntry.xml"/&gt;
    &lt;!-- the protcol stack --&gt;
    &lt;fixi:userInterface name="ATDL" orchestration="https://mydomain.com/orchestra/algo.xml"/&gt;
    &lt;fixi:encoding name="TagValue"/&gt;
    &lt;fixi:sessionProtocol name="FIXT.1.1" reliability="recoverable" orchestration="https://mydomain.com/orchestra/session.xml"/&gt;
    &lt;fixi:transport name="TCP"/&gt;
&lt;/fixi:interfacer&gt;</code></pre>
<h2>Session Configuration</h2>
<p>For each service offering, a party may be assigned one or more sessions. A session configuration includes session identifiers, transport settings, and possibly security keys. Each <code>&lt;sessions&gt;/&lt;session&gt;</code> element is contained by an <code>&lt;interface&gt;</code> that describes its service offering.</p>
<p>Here&#8217;s and example of a session configuration:</p>
<pre><code class="language-xml">&lt;fixi:session name="XYZ-ABC"&gt;
    &lt;!-- inherits services and protocols from interface --&gt;
    &lt;!-- alternate addresses are supported --&gt;
    &lt;fixi:transport address="10.96.1.2:567" use="primary"/&gt;
    &lt;fixi:transport address="10.96.2.2:567" use="secondary"/&gt;
    &lt;!-- there can be any number of identifiers --&gt;
    &lt;fixi:identifier name="SenderCompID"&gt;
        &lt;fixi:value&gt;XYZ&lt;/fixi:value&gt;
    &lt;/fixi:identifier&gt;
    &lt;fixi:identifier name="TargetCompID"&gt;
        &lt;fixi:value&gt;ABC&lt;/fixi:value&gt;
    &lt;/fixi:identifier&gt;
    &lt;!-- tells when session becomes effective so it can be configured in advance --&gt;
    &lt;fixi:activationTime&gt;2019-08-07T09:30:00Z&lt;/fixi:activationTime&gt;
&lt;/fixi:session&gt;</code></pre>
<p>A <code>&lt;session&gt;</code> element can contain configuration for any protocols in the stack that is specific to the session. In this case, the transport is always TCP for the service offering, but each session contains transport settings that are unique to that session. In this example, a primary and secondary port are offered for fail-over.</p>
<p>Optionally, security keys may be provided for a session in a <code>&lt;securityKeys&gt;</code> element. It must follow the textual encoding format described in IETF RFC 7468. Optional parts include certificates and private keys.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Concepts-Part4-Actors-And-External-States</title>
		<link>https://www.fixtrading.org/concepts-part4-actors-and-external-states/</link>
		
		<dc:creator><![CDATA[FIXTrading Community]]></dc:creator>
		<pubDate>Thu, 29 Aug 2019 19:50:29 +0000</pubDate>
				<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=54666</guid>

					<description><![CDATA[Orchestra Concepts Part 4: Actors and External States Messages convey information from one participant to another. Their actions and responses also depend upon persistent state information that can be defined...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><em>Orchestra Concepts Part 4:</em></p>
<h1>Actors and External States</h1>
<p><strong>Messages convey information from one participant to another. Their actions and responses also depend upon persistent state information that can be defined in Orchestra.</strong></p>
<h2>Overview</h2>
<p>The participants in a service play different roles. In FIX, the terms Party and PartyRole are very common. With respect to a trade, a party may play the role of executing firm, clearing firm, client, contra firm, and so forth.</p>
<p>In Orchestra, we abstract the role of a party that sends or recieves messages as an <em>actor</em>. As explained in <a href="https://github.com/FIXTradingCommunity/fix-orchestra/wiki/Concepts-Part2-Workflow-and-Scenarios">Part 2: Workflow and Scenarios</a>, actors send and receive messages on flows and the exchange of messages can be defined in Orchestra using workflow features. Specifically, a message may trigger one of several possible responses, and each response can have a conditional expression that tells when that response is fired.</p>
<p>Responses do not depend solely the contents of messages. The response to an order also depends whether the market is open, on other orders resting in a book, and possibly whether a limit price exceeds some daily bracket. The TradeDate field in an ExecutionReport also depends on state information of the market (not always the same as calendar date). Orchestra supports external states in two ways: state variables of actors and state machines.</p>
<h2>State Variables</h2>
<p>State variables are persistent data items associated with an actor that are external to messsages. To be clear, like message structures, Orchestra defines the format of the data, not actual instances of data. It is up to a system implementation to store data in memory or in a persistent database, etc. Orchestra defines interfaces and rules of behavior, not implementation details.</p>
<p>To keep it simple, Orchestra uses the same syntax to define state variables as it does to define the elements of messages. A stand-alone data item is a field, but components and repeating groups are also supported.</p>
<pre><code class="language-xml">&lt;fixr:actor name="Market"&gt;
    &lt;fixr:fieldRef id="75" presence="required" scenario="base"/&gt;
    &lt;fixr:groupRef presence="required" id="2186" scenario="base" implMaxOccurs="unbounded"&gt;
        &lt;fixr:annotation &gt;
            &lt;fixr:documentation &gt;Repeating group of security status by SecurityID&lt;/fixr:documentation&gt;
        &lt;/fixr:annotation&gt;
    &lt;/fixr:groupRef&gt;
&lt;/fixr:actor&gt;</code></pre>
<p>In this example, &#8220;Market&#8221; is the name of an actor that receives orders and sends executions and other messages. Its first state variable is defined as <code>&lt;fixr:fieldRef id="75</code>, the same way a field is referenced in a message or component definition. Tag 75 is the TradeDate field of datatype LocalMktDate. In other words, Market has a persistent value of TradeDate. The state variable can be used to assign a value to TradeDate in outgoing messages. They can it can also be used in message validations through a rule with a conditional expression.</p>
<p>The second state variable is a reference to repeating group <code>&lt;fixr:group category="SecuritiesReferenceData" id="2186" name="SecMassStatGrp" scenario="base"&gt;</code>. Without showing its full definition, understand that each instance of the group tells the current trading status of an instrument. In a live system,this would be held in some kind of database (possibly all cached in memory), but Orchestra provides an abstraction for the data structure with standardized semantics.</p>
<p>So far, the state variables reference an existing FIX field and repeating group. It is also possible to define state elements that don&#8217;t correspond to existing message elements. To do that, define a <code>&lt;field&gt;</code> directly under the <code>&lt;actor&gt;</code> using a user-defined tag.</p>
<p>State variables become useful when a conditional expression depends on their values. Not shown here, but a message response force an update of an actor&#8217;s state variable. Perhaps an order updates the current best bid or offer, for example.</p>
<h2>State Machines</h2>
<p>Many interactions in financial systems are described as transitions between discreet states. A formal model of states and their transitions is called a state machine. A great example of a state machine in FIX is OrdStatus. That field has code set that corresponds to the possible states of an order. Some transitions are valid, such as New (initial state) to Partially Filled, but others are disallowed, such as Canceled to Filled. Canceled is called a terminal state; once an order is canceled, it remains dead forever.</p>
<p>Here&#8217;s an example of a state machine for market phases:</p>
<pre><code class="language-xml">&lt;fixr:states name="MarketPhase"&gt;
    &lt;fixr:initial name="Closed"&gt;
        &lt;fixr:transition name="Reopening" target="Preopen"/&gt;
    &lt;/fixr:initial&gt;
    &lt;fixr:state name="Halted"&gt;
        &lt;fixr:transition name="Resumed" target="Preopen"&gt;
        &lt;/fixr:transition&gt;
    &lt;/fixr:state&gt;
    &lt;fixr:state name="Open"&gt;
        &lt;fixr:transition name="Halting" target="Halted"/&gt;
        &lt;fixr:transition name="Closing" target="Preclose"/&gt;
    &lt;/fixr:state&gt;
    &lt;fixr:state name="Preopen"&gt;
        &lt;fixr:transition name="Opened" target="Open"/&gt;
    &lt;/fixr:state&gt;
    &lt;fixr:state name="Preclose"&gt;
        &lt;fixr:transition name="Closed" target="Closed"/&gt;
    &lt;/fixr:state&gt;
&lt;/fixr:states&gt;</code></pre>
<p>In this example, there is an initial state called Closed. The other states are Halted, Open, Preopen, and Preclose. From Closed, the only valid transition is Reopening, which results in the Preopen state, and so forth. Notice that Open state has two possible transitions; one goes to Halted and the other goes to Preclose.</p>
<p>Here&#8217;s what the state machine looks like in standard UML format:</p>
<p><img decoding="async" src="./media/MarketPhase.png" alt="State Machine"></p>
<p>Other features can be added to a state machine that are not illustrated here for simplicity.</p>
<ul>
<li>A transition can trigger an action such as sending a message. For example, when the market is opened, a session status message can be sent from one actor to another. Conversely, a message response can invoke a state machine transition such as an order state change.</li>
<li>A conditional expression can be used to guard a transition so it is only allowed under certain circumstances.</li>
</ul>
<h3>Next</h3>
<p>to come</p>
<h3>Back</h3>
<p><a href="https://github.com/FIXTradingCommunity/fix-orchestra/wiki/Concepts-Part3-Conditional-Expressions">Orchestra Concepts Part 3: Conditional Expressions</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Concepts-Part2-Workflow-and-Scenarios</title>
		<link>https://www.fixtrading.org/concepts-part2-workflow-and-scenarios-2/</link>
		
		<dc:creator><![CDATA[FIXTrading Community]]></dc:creator>
		<pubDate>Thu, 29 Aug 2019 19:43:17 +0000</pubDate>
				<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=54662</guid>

					<description><![CDATA[Orchestra Concepts Part 2: Workflow and Scenarios In addition to message structures, an Orchestra file can also convey the workflow, or expected message exchange behaviors of a service offering. Scenarios...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><em>Orchestra Concepts Part 2:</em></p>
<h1>Workflow and Scenarios</h1>
<p><strong>In addition to message structures, an Orchestra file can also convey the workflow, or expected message exchange behaviors of a service offering. Scenarios are the key to Orchestra&#8217;s power.</strong></p>
<h2>Overview</h2>
<p>A session in FIX or other financial industry protocol involves an exchange of application messages of various types (aside from the messages of the underlying session and transport protocols). The expected message exchange behaviors are important part of the rules of engagement between counterparties. To use a service offering, a counterparty must send the right kind of message for the circumstances.</p>
<p>Some messages are part of a synchronous request/response pattern while others are asynchronous or unsolicited. Overall, we call these application behavioral patterns <em>workflow</em>. The Orchestra XML schema provides the means to express what kinds of responses are possible to a message, and when each possibility applies.</p>
<p>In FIX, message types are overloaded for meaning. An ExecutionReport is sent when when an order is booked, when it executes immediately— either partially or fully, when it is rejected, and so forth. The message layouts of ExecutionReport events are slightly different for each use case. For instance, an execution conveys a trade quantity and price, while a rejection conveys a reject reason instead. Each use case of a message type is known in Orchestra as a <em>scenario</em>. Unlike legacy data dictionaries, Orchestra provides a way to specify each scenario individually rather than as a conglomeration of all its use cases.</p>
<h3>What&#8217;s it good for?</h3>
<p>Receiving machine-readable definitions of message exchange behaviors can be used for &#8230;</p>
<ul>
<li>Generating stubs of application code</li>
<li>Writing messaging test cases and validations</li>
<li>Generating documentation for humans</li>
</ul>
<h2>Actors and Flows</h2>
<p>An actor plays a role with regard to a system described by an Orchestra file. For example, in an order routing system, one actor would be &#8220;trader&#8221; and another would be &#8220;market&#8221;. An <code>&lt;actor&gt;</code> element is defined for each role in an Orchestra file.</p>
<p>A <code>&lt;flow&gt;</code> element represents a stream of messages from one actor (source) to another (destination). Often, a pair of flows constitute a conversation between actors. For example, orders flow from trader to market while executions flow back from market to trader.</p>
<p>Here&#8217;s an example with three flows between actors. As you can see, flows can have various attributes, but we won&#8217;t dive into those details right now since we want to concentrate on message exchange. (You can refer to the Orchestra specification or XML schema for details.) We&#8217;ll also show in a later tutorial how actors can have state information that influence messaging behaviors.</p>
<pre><code class="language-xml">&lt;fixr:actors&gt;
    &lt;fixr:actor name="BuySide"/&gt;
    &lt;fixr:actor name="Market"/&gt;
    &lt;fixr:flow name="OrderEntry" source="BuySide" destination="Market"
messageCast="unicast" reliability="idempotent"/&gt;
    &lt;fixr:flow name="Executions" source="Market" destination="BuySide"
messageCast="unicast" reliability="recoverable"/&gt;
    &lt;fixr:flow name="MarketData" source="Market" destination="BuySide"
messageCast="multicast" reliability="bestEffort"/&gt;
&lt;/fixr:actors&gt; </code></pre>
<h2>Message Workflows</h2>
<p>Each message defined in an Orchestra file belongs to a flow. From its <code>flow</code> attribute, you can infer the source and destination of the message from the <code>&lt;flow&gt;</code> object of the same name.</p>
<p>Here&#8217;s an example of an order message on an &#8220;OrderEntry&#8221; flow, which is sent from BuySide to Market.</p>
<pre><code class="language-xml">&lt;fixr:message msgType="D" flow="OrderEntry" id="14" name="NewOrderSingle" abbrName="Order"&gt;</code></pre>
<p>In the previous tutorial, we explored message structures. The NewOrderSingle message definition would contain its members within a <code>&lt;structure&gt;</code> element as we showed before, but we&#8217;ll skip that for the moment because now we want to explore behaviors.</p>
<p>A sibling to the <code>&lt;structure&gt;</code> element is the <code>&lt;responses&gt;</code> element where workflow is defined. The <code>&lt;responses&gt;</code> parent element may contain any number of <code>&lt;response&gt;</code> elements.</p>
<p>For now, we&#8217;ll concentrate only on sending message responses, but be aware that Orchestra also can specify triggering of other kinds of events as well, including timers and actor state changes. (See the XML schema for all forms.) Each response that results in sending a message contains a <code>&lt;messageRef&gt;</code> element.</p>
<p>Here&#8217;s a simplified view of the possible message responses to a NewOrderSingle message:</p>
<pre><code class="language-xml">&lt;fixr:responses&gt;
    &lt;fixr:response name="orderAck"&gt;
        &lt;fixr:messageRef name="ExecutionReport" msgType="8" implMinOccurs="0" implMaxOccurs="1" id="9" scenario="base" implMinOccurs="1"&gt;
        &lt;/fixr:messageRef&gt;
        &lt;fixr:when&gt;$Market.SecMassStatGrp[SecurityID==in.SecurityID].SecurityTradingStatus != ^TradingHalt and $Market.Phase == "Open"&lt;/fixr:when&gt;
    &lt;/fixr:response&gt;
    &lt;fixr:response name="invalidStateRejection"&gt;
        &lt;fixr:messageRef name="ExecutionReport" msgType="8" implMinOccurs="0" implMaxOccurs="1" id="9" scenario="rejected" implMinOccurs="1"/&gt;
        &lt;fixr:when&gt;$Market.Phase == "Closed"&lt;/fixr:when&gt;
    &lt;/fixr:response&gt;
    &lt;fixr:response name="badInstrumentRejection"&gt;
        &lt;fixr:messageRef name="BusinessMessageReject" msgType="j" implMinOccurs="0"  implMaxOccurs="1" id="43" scenario="base" implMinOccurs="1"&gt;
        &lt;/fixr:messageRef&gt;
        &lt;fixr:when&gt;!exists $Market.SecMassStatGrp[SecurityID==in.SecurityID]"&lt;/fixr:when&gt;
    &lt;/fixr:response&gt;
    &lt;fixr:response name="orderFilled" sync="asynchronous"&gt;
        &lt;fixr:messageRef name="ExecutionReport" msgType="8" implMinOccurs="0" id="9" scenario="traded" implMinOccurs="1"&gt;
        &lt;/fixr:messageRef&gt;
        &lt;fixr:when&gt;$Market.SecMassStatGrp[SecurityID==in.SecurityID].SecurityTradingStatus != ^TradingHalt and $Market.Phase == "Open"&lt;/fixr:when&gt;
        &lt;fixr:annotation &gt;
            &lt;fixr:documentation &gt;One or more fills may occur; the first one may be synchronous.&lt;/fixr:documentation&gt;
        &lt;/fixr:annotation&gt;
    &lt;/fixr:response&gt;
&lt;/fixr:responses&gt;</code></pre>
<p>Here are some important elements and attributes to notice:</p>
<ul>
<li>Each of the <code>&lt;messageRef&gt;</code> elements contains the identifiers of a message that must be defined elsewhere in the Orchestra file. That is, the <code>id</code> of the messageRef must match the <code>id</code> of a corresponding <code>&lt;message&gt;</code> element. That&#8217;s where you would find the <code>&lt;structure&gt;</code> of the response message.</li>
<li>Every message and messageRef has a <code>scenario</code> attribute. If not provided, its value is &#8220;base&#8221; by default. To restate the point above more precisely, a messageRef matches a message definition by combination of its <code>id</code> and <code>scenario</code> attributes. That combination defines a specific use case of a message type. The structure of ExecutionReport message of scenario <code>rejected</code> is different than scenario <code>traded</code>, and so forth. Not all the responses need be the same message type, as shown by the response of BusinessMessageReject.</li>
<li>Each of the responses shown here also contains a <code>&lt;when&gt;</code> element. That element contains a Score DSL expression that must evaluate to true or false (called a predicate in formal logic). If it evaluates to true, then its response is triggered. If there is no <code>&lt;when&gt;</code> element in a response, then it is triggered unconditionally.</li>
<li>Responses can have other attributes such as a minimum or maximum number of times it can occur. For example, <code>implMinOccurs="0" implMaxOccurs="1"</code> on the acknowledgement response says that it can occur at most once for a given order but may never occur. By default, there is no limit to the number of times a response can trigger.</li>
<li>Also, responses can be specified as synchronous or asynchronous. The fill response is specified as <code>sync="asynchronous"</code> since the timing of a trade is not determined by the time that the order was entered into the market. It could occur seconds, minutes or hours later (if ever).</li>
</ul>
<p>Here&#8217;s how the workflow looks as a UML sequence diagram:</p>
<p><img decoding="async" src="./media/NewOrderSingle-base.png" alt="Sequence Diagram"></p>
<p>Not shown in the example, a response can also tell how the key identifiers of a response message relate to the original message. For example, an ExecutionReport generally carries the ClOrdId of the original order message.</p>
<h2>Message Scenarios</h2>
<p>Let&#8217;s compare to of the responses in the example above but with some details stripped out.</p>
<pre><code class="language-xml">&lt;fixr:response name="orderAck"&gt;
    &lt;fixr:messageRef name="ExecutionReport" msgType="8" id="9" scenario="base"/&gt;
&lt;/fixr:response&gt;
&lt;fixr:response name="orderFilled"&gt;
    &lt;fixr:messageRef name="ExecutionReport" msgType="8" id="9" scenario="traded"/&gt;
&lt;/fixr:response&gt;</code></pre>
<p>The two responses both refer to a response message <code>&lt;messageRef&gt;</code> and both of them are ExecutionReport messages. The events are not the same though, and although both responses have <code>msgType="8"</code>, the messasge layouts are not the same. Both ExecutionReport messages have the usual identifiers, only a trade produces a price and quantity while an order acknowledgement does not. Likewise, and ExecutionReport for order expiration or rejection would contain different fields. Unlike legacy FIX data dictionaries, Orchestra can provide a precise message layout for each event.</p>
<p>Here&#8217;s a simplified view of the &#8220;traded&#8221; scenario message definition:</p>
<pre><code class="language-xml">&lt;fixr:message msgType="8" category="SingleGeneralOrderHandling" flow="Executions" id="9" name="ExecutionReport" abbrName="ExecRpt" scenario="traded"&gt;
    &lt;fixr:structure&gt;
        &lt;fixr:componentRef presence="required" added="FIX.2.7" id="1024"/&gt;
        &lt;fixr:fieldRef id="37" presence="required"/&gt;
        &lt;fixr:fieldRef id="11" implMaxLength="20" scenario="base"&gt;
            &lt;fixr:assign&gt;in.ClOrdID&lt;/fixr:assign&gt;
        &lt;/fixr:fieldRef&gt;
        &lt;fixr:fieldRef id="17" presence="required" scenario="base"/&gt;
        &lt;fixr:fieldRef id="39" presence="required" scenario="base"/&gt;
        &lt;fixr:componentRef presence="required" id="1003" scenario="base"/&gt;
        &lt;fixr:fieldRef id="54" presence="required" scenario="base"&gt;
            &lt;fixr:assign&gt;in.Side&lt;/fixr:assign&gt;
        &lt;/fixr:fieldRef&gt;
        &lt;fixr:fieldRef id="40" scenario="base" presence="optional"&gt;
            &lt;fixr:assign&gt;in.OrdType&lt;/fixr:assign&gt;
        &lt;/fixr:fieldRef&gt;
        &lt;fixr:fieldRef id="59" scenario="base" presence="optional"&gt;
            &lt;fixr:assign&gt;in.TimeInForce&lt;/fixr:assign&gt;
        &lt;/fixr:fieldRef&gt;
        &lt;fixr:fieldRef id="151" presence="required" scenario="base"/&gt;
        &lt;fixr:fieldRef id="14" presence="required" scenario="base"/&gt;
        &lt;fixr:fieldRef id="60" scenario="base" presence="optional"/&gt;
        &lt;fixr:componentRef presence="required" id="1025" scenario="base"/&gt;
    &lt;/fixr:structure&gt;
&lt;/fixr:message&gt;</code></pre>
<p>One of the implications of scenario design is that the multitude of optional fields tends to fall away. Rather, each scenario contains just the required fields for its use case. Message layouts are thus much more deterministic than without scenarios.</p>
<h2>Next</h2>
<p>How to encode conditional expressions using the Score DSL <a href="https://github.com/FIXTradingCommunity/fix-orchestra/wiki/Concepts-Part3-Conditional-Expressions">Orchestra Concepts Part 3: Condtional Expressions</a></p>
<h3>Back</h3>
<p><a href="https://github.com/FIXTradingCommunity/fix-orchestra/wiki/Concepts-Part1-MessageStructures">Orchestra Concepts Part 1: Message Structures</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Concepts-Part3-Conditional-Expressions</title>
		<link>https://www.fixtrading.org/concepts-part3-conditional-expressions/</link>
		
		<dc:creator><![CDATA[FIXTrading Community]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 11:54:03 +0000</pubDate>
				<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=54425</guid>

					<description><![CDATA[Orchestra Concepts Part 3: Conditional Expressions Conditional expressions tell when something should happen or when a rule applies. Orchestra provides a language called Score to form expressions that machines can...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><em>Orchestra Concepts Part 3:</em></p>
<h1>Conditional Expressions</h1>
<p><strong>Conditional expressions tell when something should happen or when a rule applies. Orchestra provides a language called Score to form expressions that machines can read and evaluate.</strong></p>
<h2>Overview</h2>
<p>Rules of engagement between counterparties often depend on the values in a message or external state information. One use case is <em>conditionally required</em> fields—whether a field is required is contingent on the value of another field. In the FIX specifications, this has traditionally been expressed in text comments, often following the phrase &#8220;required if&#8230;&#8221; Another use case for condional expressions is to select when one workflow reponse is triggered among several alternatives. Score expressions can also be used to set field values.</p>
<p>The problem with text narratives is that are designed for human readability. Unfortunately, they are not easily parsed by computer programs, and even to humans, the narrative is often vague or ambiguous. At least in the case of a conditionally required field, the condition is usually next to the field definition. In the case of workflow, the problem is usually worse—either the flow is not explained at all, or the documentation of the flow is disconnected from the message definitions, requiring humans to put it together in their heads.</p>
<p>The goal of Orchestra is to make rules of engagement machine readable, precise, and unambiguous. The rest of this tutorial gives a tutorial for how to form machine readable condtional expressions.</p>
<h3>What&#8217;s it good for?</h3>
<p>Receiving machine-readable expressions can be used for &#8230;</p>
<ul>
<li>Writing messaging test cases and validations</li>
<li>Evaluating conditions at run-time</li>
<li>Populating messages from field assignment expressions</li>
</ul>
<h2>Score DSL</h2>
<p>Score is the part of Orchestra to form expressions. It is what is called a Domain Specific Language (DSL). It was designed to be easy to learn for software developers since it is highly similar to the expression syntax of common programming languages including C, C++, C#, and Java. It should also look familiar to anyone who has written spreadsheet formulas. It was expected that there would be these two groups of users, so the syntax allows some alternatives. For example, an advanced business user can use the word &#8220;or&#8221; to combine logical expressions while a software engineer uses the symbol &#8220;||&#8221; to mean the same thing but using a form common in technical expression syntaxes. The two symbols are interchangeable in Score.</p>
<p>The complete syntax of Score is defined in the Orchestra specification. However, this tutorial should give enough of the gist to get you started.</p>
<h3>Conditionally required field</h3>
<p>Let&#8217;s say that a message definition contains this field reference:</p>
<pre><code class="language-xml">&lt;fixr:fieldRef id="99" scenario="base" presence="optional"&gt;
    &lt;fixr:rule name="StopOrderRequiresStopPx" presence="required"&gt;
        &lt;fixr:when&gt;OrdType == ^Stop || OrdType == ^StopLimit&lt;/fixr:when&gt;
    &lt;/fixr:rule&gt;
    &lt;fixr:annotation&gt;
        &lt;fixr:documentation&gt;
         Required for OrdType = "Stop" or OrdType = "Stop limit".
        &lt;/fixr:documentation&gt;
    &lt;/fixr:annotation&gt;
&lt;/fixr:fieldRef&gt;</code></pre>
<p>It is a reference to the stop price field definition, matching on its <code>id</code> attribute:</p>
<pre><code class="language-xml">&lt;fixr:field type="Price" id="99" name="StopPx" abbrName="StopPx"/&gt;</code></pre>
<p>Before we break down the expression in the <code>&lt;when&gt;</code> element, see if you can guess its meaning without looking at <code>&lt;documentation&gt;</code> that pretty much gives it away.</p>
<p>(waiting&#8230;)</p>
<p>I hope that if you understand FIX, that meaning was apparent, but let&#8217;s analyze it carefully.</p>
<p>The field is by default optional in this message. That is, the field may be present in the message but is not required. However, the contained <code>&lt;rule&gt;</code> named &#8220;StopOrderRequiresStopPx&#8221; overrides the default presence by setting <code>presence="required"</code>.</p>
<p>When is the rule activated? It depends on the <code>&lt;when&gt;</code> element. The content of that element is a Score DSL expression. When the expression evalutes to true, then the rule applies, and consquently, stop price is required in the message.</p>
<p>Let&#8217;s examine the expression. Remember, that the symbol &#8220;||&#8221; is a synonym for the word &#8220;or&#8221;. So there are two logical expressions connected by &#8220;or&#8221;. If either of the parts is true, the whole expression evaluates to true.</p>
<p>There is another non-word symbol in the expression &#8220;==&#8221;, meaning equality. If the two entities on either side of an equality symbol evaluate to the same value, then the expression is true. (If you are not a programmer, I have to explain why it is a double equal sign. The reason is that equal sign actually has two meanings. One is a test of equality as used here. The other meaning is assignment, as when you assign a value to a variable in algebra. Since Score supports both tests of equality and assignment, it has to distinguish the two meanings. Therefore, like many programming languages, it uses a single equal sign for assignment and a double equal for equality.)</p>
<p>What is &#8220;OrdType&#8221; in the expression? It is the value of the OrdType field in the same message. The field has tag 40, but you don&#8217;t have to remeber that to write the expression because the Score implementation can cross-reference the name to its field definition.</p>
<pre><code class="language-xml">&lt;fixr:field id="40" name="OrdType" abbrName="OrdTyp" type="OrdTypeCodeSet"  scenario="base"/&gt;</code></pre>
<p>Score lets you reference other fields in the same message, and even reference an incoming message in an expression pertaining to its response. Since &#8220;OrdType&#8221; is followed by an equality symbol, there is a test to evaluate whether the value of the OrdType field to some other value.</p>
<p>There is one more non-word symbol in the expression: &#8220;^&#8221;. To explain it, let&#8217;s show another piece of the Orchestra file. Notice that the type of the OrdType field above is &#8220;OrdTypeCodeSet&#8221;. That is not the name of a built-in FIX datatype, but rather is the name of a code set, shown below (simplified).</p>
<pre><code class="language-xml">&lt;fixr:codeSet type="char" id="40" name="OrdTypeCodeSet" scenario="base" &gt;
    &lt;fixr:code value="1"id="40001" name="Market"/&gt;
    &lt;fixr:code value="2"id="40002" name="Limit"/&gt;
    &lt;fixr:code value="3" id="40003" name="Stop"/&gt;
    &lt;fixr:code value="4" id="40004" name="StopLimit"/&gt;
&lt;/fixr:codeSet&gt;</code></pre>
<p>As you can see, &#8220;Stop&#8221; and &#8220;StopLimit&#8221; are names of codes in the OrdTypeCodeSet. Again, you don&#8217;t need to know the code values on the wire to write the Score expression, only the names of the codes. So, Score expressions are humanly understandable as well as machine readable.</p>
<p>Let&#8217;s now put together everything we&#8217;ve learned about a Score expression for a conditionally required field and see if your guess was right. The Score expression can be translated to natural language as: &#8220;if the value of the OrdType field in this message is equal to the code Stop or is equal to the code StopLimit&#8221;, then the rule states that the stop price field is required. Not only is the Score expression shorter than the English equivalent, it is unambiguous and can be parsed and evaluated by computer code. The cost to an author is learning a few special symbols, but you already know some of the inportant ones.</p>
<h3>Conditional message responses</h3>
<p>In the previous tutorial, we discussed workflow. A message can have one or more <code>&lt;response&gt;</code> elements. Like a field <code>&lt;rule&gt;</code>, a <code>&lt;response&gt;</code> can have a <code>&lt;when&gt;</code> element containing a Score expression to tell when the response is triggered. The expression syntax is exactly the same as for a conditionally required field. If the expression evaluates to true, the response is fired. Typically, message responses involve external states as well as values in an incoming message, so we&#8217;ll defer a fuller explanation to the next tutorial.</p>
<h3>Field assignment</h3>
<p>A Score expression can be used to assign a field value in a response message, as shown in the example below.</p>
<pre><code class="language-xml">&lt;fixr:fieldRef id="11" implMaxLength="20" scenario="base" presence="optional"&gt;
    &lt;fixr:assign&gt;in.ClOrdID&lt;/fixr:assign&gt;
&lt;/fixr:fieldRef&gt;</code></pre>
<p>Field 11 is ClOrdId. The <code>&lt;assign&gt;</code> element contains a Score expression to assign a value to that field in the response. Unlike the <code>&lt;when&gt;</code> elements above, this Score expression is <em>not</em> a true/false predicate, but rather evaluates to a value in the datatype of ClOrdId. What is that?</p>
<pre><code class="language-xml">&lt;fixr:field type="String" id="11" name="ClOrdID" abbrName="ClOrdID" scenario="base"/&gt;</code></pre>
<p>Answer: datatype String. It is contrained in the definition of the response message by the attribute <code>implMaxLength="20"</code>. In short, the outgoing ClOrdID field must be a String of no more than 20 characters.</p>
<p>The prefix &#8220;in.&#8221; of the assignment expression refers to the incoming message that triggered the response. To put it all together, the Score expression assigns the incoming ClOrdID value to the outgoing ClOrdID field. In other words, it echoes to the input to the output, up to 20 characters.</p>
<h2>Next</h2>
<p>Actors and external states</p>
<h3>Back</h3>
<p><a href="https://www.fixtrading.org/concepts-part2-workflow-and-scenarios/">Orchestra Concepts Part 2: Workflow and Scenarios</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Hands-on-Part1-Accessing-Message-Structures</title>
		<link>https://www.fixtrading.org/hands-on-part1-accessing-message-structures/</link>
		
		<dc:creator><![CDATA[FIXTrading Community]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 11:52:27 +0000</pubDate>
				<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=54426</guid>

					<description><![CDATA[Orchestra Hands-on Tutorial Part 1: Accessing Message Structures An Orchestra file contains message definitions and workflows. When you receive an Orchestra file from a trading counterparty, how do you access...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><em>Orchestra Hands-on Tutorial Part 1:</em></p>
<h1>Accessing Message Structures</h1>
<p><strong>An Orchestra file contains message definitions and workflows. When you receive an Orchestra file from a trading counterparty, how do you access it programmatically to discover its elements?</strong></p>
<p>An Orchestra file is encoded in XML and must conform to the schema published in GitHub project <a href="https://github.com/FIXTradingCommunity/fix-orchestra">FIXTradingCommunity/fix-orchestra</a>. There are actually two XML schemas in Orchestra, in modules <code>repository2016</code> and <code>interfaces2016</code>. The first is for message definitions and workflows, and the latter is for defining service offerings, protocol stacks, and sessions. For this tutorial, we&#8217;ll work with the repository schema, but interfaces access works the same way technologically.</p>
<h2>Prequisites</h2>
<p>For this tutorial, we&#8217;ll work in the Java programming language, using Maven as the build tool. So you&#8217;ll need Java 8 or later and Maven 3 for the steps below. (Of course, XML can be read and manpulated in other programming languages using appropriate tools.)</p>
<h2>Step 1: Create a new project</h2>
<p>Create a new simple Maven project. IDEs such as Eclipse or Intellij IDEA have menus and dialogs for this.</p>
<p>Code to access or update an Orchestra file is available as open source. To make it easy on yourself, let Maven retrieve a pre-built excutable for you. If you&#8217;d rather dive into detail, you can build the dependency yourself from source&#8211;see below.</p>
<h3>Use pre-built XML bindings</h3>
<p>XML bindings relieve you of having to deal with XML details such as elements and attributes. Rather, you just use plain old classes and objects (POJOs).</p>
<p>Orchestra XML bindings generated with Java Architecture for XML Binding (JAXB) are already baked into an open-source project for you to use. Add this snippet to the <code>&lt;dependencies&gt;</code> element of your Maven project file. (Check if there is a later version available in <a href="https://mvnrepository.com/artifact/io.fixprotocol.orchestra/repository2016">Maven Central repository</a>.) When you build your project, Maven will retrieve each dependency in your project automatically.</p>
<pre><code class="language-xml">&lt;dependency&gt;
  &lt;groupId&gt;io.fixprotocol.orchestra&lt;/groupId&gt;
  &lt;artifactId&gt;repository2016&lt;/artifactId&gt;
  &lt;version&gt;1.3.0-RC4&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
<p><em>Note:</em> if you&#8217;re using Java 9 or later, you&#8217;ll have to add dependency for module <code>javax.xml.bind</code> since JAXB has been moved out of the base module.</p>
<h3>Alternative: Generate XML bindings from source</h3>
<p>If you wish to build the XML bindings from scratch, retrieve the source for the module described above from GitHub module <a href="https://github.com/FIXTradingCommunity/fix-orchestra/tree/master/repository2016">repository2016</a>. Tell your IDE to build the project, or issue this command line from the root directory of the dependency project:</p>
<pre><code>mvn install</code></pre>
<p>In the <code>generate-sources</code> phase of the build, JAXB source code is generated to access or update elements of an XML file that conforms to the Orchestra schema. Then the source code is compiled, packed into a .jar file, and stored in you local Maven repository, making it available to your new project.</p>
<h2>Step 2: Create a class to report Orchestra messages</h2>
<p>Let&#8217;s create a class to report the messages contained in an Orchestra file. For this to work, the class has to parse the XML file and convert XML constructs into Java objects. The class will have a method to accept an input stream for the file, and an output stream to send text to. Start with this outline:</p>
<pre><code class="language-java">package com.example.orchestra.sample;

import java.io.InputStream;
import java.io.PrintStream;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import io.fixprotocol._2016.fixrepository.Repository;

public class RepositoryReporter {

  public void report(InputStream is, PrintStream os) {
    try {
      // parse the XML
      Repository repository = unmarshal(is);
      // report messages
      // TODO
    } catch (JAXBException e) {
      // print exception
      os.format("ERROR: %s%n", e.getMessage());
    }
  }

  private Repository unmarshal(InputStream is) throws JAXBException {
    final JAXBContext jaxbContext = JAXBContext.newInstance(Repository.class);
    final Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
    return (Repository) jaxbUnmarshaller.unmarshal(is);
  }

}</code></pre>
<p>To report all the messages in the Orchestra file, insert this snippet into the <code>report()</code> method. It accesses a list of all messages in the repository and invokes a new method to report each message.</p>
<pre><code class="language-java">      List&lt;MessageType&gt; messageList = repository.getMessages().getMessage();
      reportMessages(messageList, os);</code></pre>
<p>The new method is:</p>
<pre><code class="language-java">  void reportMessages(List&lt;MessageType&gt; messageList, PrintStream os) {
    // iterate all messages in the file
    for (MessageType message: messageList) {
      os.format("Message name: %s scenario: %s MsgType: %s%n", 
          message.getName(), message.getScenario(), message.getMsgType());
      // report message members
      // TODO
    }  
  }</code></pre>
<p>To list the members of a message structure, insert this snippet into the <code>reportMessages()</code> method. The structure of a message is mixed collection of field, component, and repeating group references.</p>
<pre><code class="language-java">      List&lt;Object&gt; members = message.getStructure().getComponentRefOrGroupRefOrFieldRef();
      reportMembers(members, os);</code></pre>
<p>Add a new method to report each of the members. It has to check the type of each object in the mixed collection. To keep it simple, we&#8217;ll only report the identifiers of each member, but you can expand the code to report more attributes.</p>
<pre><code class="language-java">  void reportMembers(List&lt;Object&gt; members, PrintStream os) {
    for (Object member : members) {
      if (member instanceof FieldRefType) {
        FieldRefType fieldRef = (FieldRefType)member;
        os.format("tFieldRef id: %d scenario: %s%n", fieldRef.getId(), fieldRef.getScenario());
      } else if (member instanceof ComponentRefType) {
        ComponentRefType componentRef = (ComponentRefType)member;
        os.format("tComponentRef id: %d scenario: %s%n", componentRef.getId(), componentRef.getScenario());
      } else if (member instanceof GroupRefType) {
        GroupRefType groupRef = (GroupRefType)member;
        os.format("tGroupRef id: %d scenario: %s%n", groupRef.getId(), groupRef.getScenario());
      }
    }
  }</code></pre>
<h3>Your homework</h3>
<p>Accessing fields, components, and repeating groups follows the same format, so you can write their accessors by following the style for messages.</p>
<p>This simple tutorial reports on each element as it is accessed. However, a real application would likely need to collect information and cross-reference elements before processing them. For example, a FieldRef member of a message is only identified by its numeric ID (field tag). To get the field name, you have to cross-refernce the Field element with the same ID.</p>
<p><em>Caution:</em> not all XML attributes are required, so some accessors may return <code>null</code>. Be careful to check for nullness before attempting to use a returned object reference.</p>
<h2>Step 3: Create a main and build the application</h2>
<p>Create <code>main()</code> entry point to receive command-line arguments like so:</p>
<pre><code class="language-java">public class RepositoryApp {
  public static void main(String[] args) {
    if (args.length &lt; 1) {
      usage();
    } else {
      RepositoryReporter reporter = new RepositoryReporter();
      InputStream is;
      try {
        // first argument is an Orchestra file name
        is = new FileInputStream(args[0]);
        reporter.report(is, System.out);
      } catch (FileNotFoundException e) {
        System.err.println(e.getMessage());
      }
    }
  }

  public static void usage() {
    System.err.println("Usage: RepositoryApp &lt;xml-file&gt;");
  }
}</code></pre>
<p>Tell your IDE to build the project, or issue this command line from the root directory of the project:</p>
<pre><code>mvn install</code></pre>
<p>Now your first Orchestra application is ready to run! Output should look something like this:</p>
<pre><code>Message name: NewOrderSingle scenario: SecurityType-Future MsgType: D
    ComponentRef id: 1024 scenario: base
    FieldRef id: 11 scenario: base
    FieldRef id: 1 scenario: base
    FieldRef id: 21 scenario: SecurityType-Future
    ComponentRef id: 1003 scenario: SecurityType-Future
    FieldRef id: 54 scenario: SecurityType-Future
    FieldRef id: 60 scenario: base
    ComponentRef id: 1011 scenario: SecurityType-Future
    FieldRef id: 40 scenario: SecurityType-Future
    FieldRef id: 44 scenario: base
    FieldRef id: 59 scenario: SecurityType-Future
    ComponentRef id: 1025 scenario: base</code></pre>
<h4>Copyright 2019 FIX Protocol Ltd.</h4>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Concepts-Part1-MessageStructures</title>
		<link>https://www.fixtrading.org/concepts-part1-messagestructures/</link>
		
		<dc:creator><![CDATA[FIXTrading Community]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 11:49:40 +0000</pubDate>
				<category><![CDATA[Orchestra Tutorials]]></category>
		<guid isPermaLink="false">https://www.fixtrading.org/?p=54422</guid>

					<description><![CDATA[Orchestra Concepts Part 1: Message Structures An Orchestra file contains message definitions and their building blocks, one of the aspects of rules of engagement between counterparties. Overview Orchestra is not...]]></description>
										<content:encoded><![CDATA[<style type="text/css"></style><p><em>Orchestra Concepts Part 1:</em></p>
<h1>Message Structures</h1>
<p><strong>An Orchestra file contains message definitions and their building blocks, one of the aspects of rules of engagement between counterparties.</strong></p>
<h2>Overview</h2>
<p>Orchestra is <em>not</em> a communication protocol in the ususal sense, nor is it an intermediary for messages on the wire. Rather, it describes message structures and behaviors of interacting peers about their communications rules— technically, metadata rather than data. We call these expected behaviors between counterparties <em>rules of engagement</em>. The benefits of receiving such metadata include the ability to accurately prepare for behaviors in advance rather than discovering them at runtime, potentially leading to unexpected errors or breakdowns.</p>
<h3>What&#8217;s it good for?</h3>
<p>Receiving machine-readable definitions of message structures can be used for &#8230;</p>
<ul>
<li>Developing message encoders and decoders and configuring them in a FIX engine or other communications gateway</li>
<li>Specifying and developing message validators and translators</li>
<li>Writing messaging test cases</li>
<li>Generating documentation for humans</li>
</ul>
<h3>At the Application Layer</h3>
<p>Orchestra defines messages and behaviors as viewed by the application layer, not bits and bytes as viewed from lower technical protocol layers. Another way to say it is that Orchestra deals with <em>semantics</em>.</p>
<p>Orchestra was designed to work for practically any interactive message protocol, not just for FIX. Even within the family of FIX protcols, there are multiple message encodings— including the traditional TagValue format, FIXML, and binary encodings such as SBE— but they can all have the same business semantics.</p>
<h3>A Standard File Format</h3>
<p>The Orchestra standard has two file schemas, one for message structures and workflows of messages, and the other describes protocol stacks and session configurations. In this tutorial, we&#8217;ll cover the first one, which is historically a successor to FIX Repository. Therefore, another name for it is Repository 2016 Edition.</p>
<p>To ensure that an Orchestra file is interoperable, it must conform to an XML schema that is published as part of the Orchestra standard. See the repository2016 XSD files <a href="https://github.com/FIXTradingCommunity/fix-orchestra/tree/master/repository2016/src/main/resources/xsd">here</a> in GitHub.</p>
<h2>Message Structures</h2>
<p>Orchestra is not a communications protocol, so it does not deal with instances of messages on the wire, but rather with templates for formation of messages. A message is a complete unit of data sent on the wire. It is composed of fields, components, and repeating groups. Let&#8217;s dive into these concepts and how Orchestra represents them.</p>
<h3>Field</h3>
<p>A field is the smallest unit of business semantics. A field always has the same meaning wherever it used. For example, the Price field is used in many message types, but it always means &#8220;price per unit of quantity&#8221;.</p>
<p>A field has an identifier called a tag. In FIX, tags are numeric, and FIX experts know common tags by heart, e.g. tag 44 is the identifier of the Price field. Tags are persistent— they remain the same forever for a given field and can never change or be reused. Only new field tags can be added.</p>
<p>How the Symbol (55) field is represented in Orchestra (simplified):</p>
<pre><code class="language-xml">&lt;fixr:field type="String" id="55" name="Symbol" abbrName="Sym" scenario="base"&gt;
    &lt;fixr:annotation&gt;
    &lt;fixr:documentation purpose="SYNOPSIS"&gt;
         Ticker symbol. Common, "human understood" representation of the security.
    &lt;/fixr:documentation&gt;
    &lt;/fixr:annotation&gt;
&lt;/fixr:field&gt;</code></pre>
<p>Key parts of a field definition:</p>
<ul>
<li>The prefix &#8220;fixr:&#8221; in front of all elements refers to the Orchestra XML namespace. We&#8217;ll say no more about underlying XML technology, but it will appear in all tutorials.</li>
<li>The <code>name</code> attribute gives a humanly understood name. Typically, this name is not sent on the wire by message processors; it&#8217;s metadata to aid humans.</li>
<li>The <code>id</code> attribute, commonly known as tag, is a numeric identifier of a field. In FIX TagValue encoding, the tag is sent on the wire.</li>
<li>The <code>abbrName</code> is an abbreviated name, which is used as a shorter tag in FIXML elements since field names can be very long.</li>
<li>The <code>type</code> attribute tells the name of the datatype of a field (explained below).</li>
<li>The <code>scenario</code> attribute gives a particular useage of a field. We&#8217;ll explain scenarios when we get to message definitions.</li>
<li>Every message element in an Orchestra file can have humanly readable documentation as shown.</li>
</ul>
<p>Also, message elements can be documented with <em>pedigree</em>, the version history of the element, not shown here for simplicity.</p>
<p>All <code>&lt;field&gt;</code> XML elements are contained by their parent element <code>&lt;fields&gt;</code> in an Orchestra file.</p>
<h3>Datatype</h3>
<p>FIX has about 20 predefined datatypes. A datatype is a <em>value space</em>, that is, the range of possible values that a field can convey. In the example above, the Symbol field is of datatype <code>String</code>, a sequence of characters. There are other datatypes for numeric values, dates, times, and so forth.</p>
<p>For each datatype, mappings can be defined for multiple message encodings, such as XML, SBE, and so forth. Technically, the rules for encoding a datatype is called its <em>lexical space</em>. Usually, you won&#8217;t need to deal with that unless you are describing a new, non-FIX protocol, so we won&#8217;t go into that in this tutorial. You can read about it in the Orchestra specification if you need to.</p>
<h3>Code set</h3>
<p>There is a special kind of datatype that you probably do need to know about, however. A code set describes a finite set of valid values of a field called codes, as opposed to a continuous range of values. A code set is also known as an <em>enumeration</em>.</p>
<p>A code set has an underlying datatype for all its code values. In FIX, codes may be of <code>String</code>, <code>int</code>, or <code>char</code> datatypes. Lately, new code sets have all been numeric.</p>
<p>Here&#8217;s an example of a code set of <code>char</code> type that enumerates order types (simplified):</p>
<pre><code class="language-xml">&lt;fixr:codeSet type="char" id="40" name="OrdTypeCodeSet" scenario="base"&gt;
    &lt;fixr:code value="1" id="40001" name="Market"/&gt;
    &lt;fixr:code value="2" id="40002" name="Limit"/&gt; 
    &lt;fixr:code value="3" id="40003" name="Stop"/&gt;
    &lt;fixr:code value="4" id="40004" name="StopLimit"/&gt;
    &lt;fixr:code value="A" id="40010" name="OnClose"/&gt;            
&lt;/fixr:codeSet&gt;</code></pre>
<p>Like a field, a code set and the codes that it contains have a humanly understood <code>name</code> attribute, and a numeric <code>id</code>.</p>
<p>Each code has a <code>value</code>, the value sent on the wire. In the example, many of the code values look like numbers, but they are actually characters, as shown by code value &#8220;A&#8221;.</p>
<p>A code set may be used as a datatype by one or more fields. In FIX Latest, more than 20 fields share <code>SecurityIDSourceCodeSet</code>, but its codes only need to be defined once in an Orchestra file.</p>
<p>All <code>&lt;codeSet&gt;</code> XML elements are contained by their parent element <code>&lt;codeSets&gt;</code> in an Orchestra file.</p>
<p>Here&#8217;s how the code set above is assigned as the datatype of a field:</p>
<pre><code class="language-xml">&lt;fixr:field type="OrdTypeCodeSet" id="40" name="OrdType" abbrName="OrdTyp"/&gt;</code></pre>
<p>In a message, when OrdType field (tag 40) is sent on the wire, the character value of the field signifies one order type from the code set.</p>
<h3>Component Block</h3>
<p>A component block is a collection of fields that can be reused in multiple message types. The FIX standard defines many components. Instrument block is one of the most common ones; it is used in over half of FIX message types.</p>
<p>A simplified definition of Instrument block:</p>
<pre><code class="language-xml">&lt;fixr:component id="1003" name="Instrument" abbrName="Instrmt"&gt;
    &lt;fixr:fieldRef id="55" scenario="base" presence="optional"/&gt;
    &lt;fixr:fieldRef id="48" scenario="base" presence="optional"/&gt;
    &lt;fixr:fieldRef id="22" scenario="base" presence="optional"/&gt;
    &lt;fixr:groupRef id="2071" scenario="base" presence="optional"/&gt;
    &lt;fixr:componentRef id="1060" scenario="base" presence="optional"/&gt;
    &lt;fixr:annotation &gt;
    &lt;fixr:documentation purpose="SYNOPSIS" &gt;
         The Instrument component block contains all the fields commonly used to describe a security or instrument. Typically the data elements in this component block are considered the static data of a security, data that may be commonly found in a security master database. The Instrument component block can be used to describe any asset type supported by FIX.
    &lt;/fixr:documentation&gt;
    &lt;/fixr:annotation&gt;
&lt;/fixr:component&gt;</code></pre>
<p>The elements of a component may be any combination of the following:</p>
<ul>
<li>A <code>&lt;fieldRef&gt;</code> is a reference to a defined <code>&lt;field&gt;</code> within the <code>&lt;fields&gt;</code> container. The <code>id</code> attribute is the key for matching the reference to the field. So, <code>&lt;fixr:fieldRef id="55"</code> matches the Symbol field as defined above. The point is, you only have to define a field once with its name, datatype, documentation, and so forth, but you can reuse that definition as many times as needed.</li>
<li>Components may be nested. A <code>&lt;componentRef&gt;</code> is a reference to a contained component. Like a fieldRef, the <code>id</code> attribute is the key for matching. In this example, the component with <code>id="1060"</code> is called <code>SecurityXML</code>. All of the fields defined for that component are nested within the Instrument block.</li>
<li>Suffice it say that a <code>&lt;groupRef&gt;</code> is a reference to a <code>&lt;group&gt;</code> repeating group that we&#8217;ll talk about next. Like components, repeating groups can be nested within components or other repeating groups.</li>
</ul>
<p>We&#8217;ll explain the <code>presence</code> attribute in depth when we get to message, but for now just know that &#8220;optional&#8221; means that field need not be sent on every message.</p>
<p>All <code>&lt;component&gt;</code> XML elements are contained by their parent element <code>&lt;components&gt;</code> in an Orchestra file.</p>
<h3>Repeating Group</h3>
<p>A repeating group is like a component, but a repeating group can have multiple instances when sent on the wire. For example, the <code>Parties</code> group can carry data for multiple parties to a transaction. (Most repeating group names end in &#8220;Grp&#8221; but this one is an exception.)</p>
<p>When sent on the wire in TagValue encoding, the instances of a repeating group are preceeded by a counter to inform a message decoder how many instances to parse. The counter is a field of a special datatype called <code>NumInGroup</code>, in essence a cardinal number. The only difference between a repeating group definition and a component is the addition of <code>&lt;numInGroup&gt;</code> element to specify the tag of the group counter. Otherwise, it contains the same field, component and nested group reference formats.</p>
<p>Here&#8217;s a simplified definition of the Parties group with its NumInGroup tag.</p>
<pre><code class="language-xml">&lt;fixr:group id="1012" name="Parties" abbrName="Pty" scenario="base"&gt;
    &lt;fixr:numInGroup id="453"/&gt;
    &lt;fixr:fieldRef id="448" scenario="base" presence="optional"/&gt;
    &lt;fixr:fieldRef id="447" scenario="base" presence="optional"/&gt;
    &lt;fixr:fieldRef id="452" scenario="base" presence="optional"/&gt;
&lt;/fixr:group&gt;</code></pre>
<p>All <code>&lt;group&gt;</code> XML elements are contained by their parent element <code>&lt;groups&gt;</code> in an Orchestra file.</p>
<h3>Message</h3>
<p>Now that we have defined the building blocks of a message, we can define a message. Like a component definition, its structure also contains field, component and group references. However, a message has some extra parts.</p>
<p>First, <code>&lt;message&gt;</code> has an extra identifier, namely attribute <code>msgType</code>, the traditional FIX protocol message identifier.</p>
<p>Another difference between the format of a message and component is that the structure of a message resides under a <code>&lt;structure&gt;</code> element. The reason for it is that A message can also have workflow aside from structure. That&#8217;s what the <code>flow</code> attribute is about, too. We&#8217;ll cover workflow in a later tutorial.</p>
<p>Here&#8217;s a simplified definition of an ExecutionReport message that is sent when a trade occurs:</p>
<pre><code class="language-xml">&lt;fixr:message msgType="8" flow="Executions" id="9" name="ExecutionReport" abbrName="ExecRpt" scenario="traded"&gt;
    &lt;fixr:structure&gt;
        &lt;fixr:componentRef presence="required" id="1024"/&gt;
        &lt;fixr:fieldRef id="37" presence="required" scenario="base"/&gt;
        &lt;fixr:fieldRef added="FIX.5.0SP2" id="2422" scenario="base" presence="optional"/&gt;
        &lt;fixr:fieldRef id="11" implMaxLength="20" scenario="base" presence="optional"&gt;
            &lt;fixr:assign&gt;in.ClOrdID&lt;/fixr:assign&gt;
        &lt;/fixr:fieldRef&gt;
        &lt;fixr:groupRef id="1012" scenario="base" presence="optional"&gt;
            &lt;fixr:annotation&gt;
            &lt;fixr:documentation&gt;
         Specifies party information related to the submitter.
            &lt;/fixr:documentation&gt;
            &lt;/fixr:annotation&gt;
        &lt;/fixr:groupRef&gt;
        &lt;fixr:componentRef presence="required" id="1025"/&gt;
    &lt;/fixr:structure&gt;
&lt;/fixr:message&gt;</code></pre>
<p>Message structure definitions have many optional XML attributes. One in the example, <code>implMaxLength</code> informs users that ClOrdID (tag 11) is limited to 20 characters.</p>
<p>In the message definition above, the first element in the structure, <code>&lt;fixr:componentRef id="1024"</code> refers to the StandardHeader component, and the last one with <code>id="1025"</code> refers to StandardTrailer. These are required by TagValue encoding.</p>
<p>All <code>&lt;message&gt;</code> XML elements are contained by their parent element <code>&lt;messages&gt;</code> in an Orchestra file.</p>
<h3>Presence</h3>
<p>Orchestra provides these possible values of <code>presence</code>:</p>
<ul>
<li><strong>required</strong> — the field or component MUST be present.</li>
<li><strong>optional</strong> — the field or component MAY be present; it may be conditionally required based on a rule.</li>
<li><strong>forbidden</strong> — The field or component MUST NOT be present.</li>
<li><strong>ignored</strong> — the field or component MAY be present but is not validated.</li>
<li><strong>constant</strong> — the field has a constant value. (In some encodings, contants need not be sent on the wire.)</li>
</ul>
<p>In the above example, fieldRef with <code>id="37"</code>, the OrderID, field has attribute <code>presence="required"</code>. This means that the rules of engagement state that in this message type, OrderID is a required field— it must be included in every instance of the message to be valid.</p>
<p>Frequently in FIX, fields are conditionally required, that is, it is required when some condition about the message is true. For example, StopPx field is required <em>when</em> the value of the OrdType field is Stop or StopLimit. Fortunately, Orchestra has syntax to express such rules — Orchestra&#8217;s <strong>Score</strong> Domain Specific Lanaguage (DSL). Score can also used to express assignment of field values. In the example, the ClOrdId field (tag 11) in the ExecutionReport is assigned the value from the incoming order message. We&#8217;ll leave the syntax of that language for an advanced tutorial, but you should get the gist of the example.</p>
<h3>Scenarios</h3>
<p>In FIX, message types are often overloaded for many different meanings. We call each specialization or use case of a message a <em>scenario</em>. For example, there may be scenarios of ExecutionReport message type for when an order is booked, when it trades, when it is rejected, or when an order is replaced.</p>
<p>Another reason to use scenarios is that different security types need different sets of fields to describe them. So an option order requires slightly different fields, like MaturityMonthYear (tag 200), that is not required for an equity order. An interesting thing here is that MaturityMonthYear is not directly included in the definition of NewOrderSingle (msgtype=&#8221;D&#8221;), but rather is included in the Instrument component.</p>
<p>To deal with different views of the Instrument block, we could define scenarios for it, one for equities, one for options, and so forth. Each is distinguished by its <code>scenario</code> name. An equity order only requires a Symbol or SecurityID, but an option also need MaturityMonthYear, StrikePrice, and put or call classification.</p>
<pre><code class="language-xml">&lt;fixr:component id="1003" name="Instrument" abbrName="Instrmt" scenario="equity"&gt;
    &lt;fixr:fieldRef id="55" scenario="base" presence="requried"/&gt;
    &lt;fixr:fieldRef id="48" scenario="base" presence="optional"/&gt;
    &lt;fixr:fieldRef id="22" scenario="base" presence="optional"/&gt;
&lt;/fixr:component&gt;

&lt;fixr:component id="1003" name="Instrument" abbrName="Instrmt" scenario="option"&gt;
    &lt;fixr:fieldRef id="55" scenario="base" presence="required"/&gt;
    &lt;fixr:fieldRef id="48" scenario="base" presence="optional"/&gt;
    &lt;fixr:fieldRef id="22" scenario="base" presence="optional"/&gt;
    &lt;fixr:fieldRef id="200" scenario="base" presence="required"/&gt;
    &lt;fixr:fieldRef id="201" scenario="base" presence="required"/&gt;
    &lt;fixr:fieldRef id="202" scenario="base" presence="required"/&gt;
&lt;/fixr:component&gt;</code></pre>
<p>Another common reason to use scenarios is to have different views of code sets. Inbound orders may use one scenario of PartyRole while outbound execution reports use a more enriched version with more codes in the code set.</p>
<h2>Next</h2>
<p>In subsequent tutorials, we explain concepts of workflow, conditional expressions, and other details of Orchestra. The next concept tutorial is <a href="https://www.fixtrading.org/concepts-part2-workflow-and-scenarios/">Orchestra Concepts Part 2: Workflow and Scenarios</a>.</p>
<p>To learn how to access message structures programmatically, see <a href="https://www.fixtrading.org/hands-on-part1-accessing-message-structures/">Orchestra Hands-on Tutorial Part 1: Accessing Message Structures</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: cdnws.fixtrading.org
Lazy Loading (feed)

Served from: www.fixtrading.org @ 2026-03-26 16:45:23 by W3 Total Cache
-->