Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A Facet Type is a unit of capability (or method) represented by a piece of executable code (a Java class) intended to process a request. The facet type’s method selection is based on the facet lifecycle event model. In short, the TQLEngine invokes the appropriate facet type method using the current facet pipeline connection context and facet instance information as argument.

Facet Types in the TQLEngine

...

Facet Type NameSffMsgFacet
Language SupportFacetScript
Transports

HttpServerExtensionArgs

WsServerExtensionArgWsServerExtensionArgs

Usage

 Facet Types are used in <NewFacetInstance> when creating a Package (Deployment) definition for your models.

Code Block
languagexml
titleSffMsgFacet Example
linenumberstrue
<NewFacetInstance fid="smartparking" name="SmartParking" type="SffMsgFacet">
  <OnOpen ModifyPipeline="HttpServerExtensionArgs" />
  <OnRequest>
    <!-- Handle Request -->
    <!-- Any FacetScript Code can go in here... ->
    <DoResponse>
       <!-- Send the response back.. ->
    </DoResponse>
  </OnRequest>
</NewFacetInstance>
Other NamesSffTcpFacet
Use Cases
  1. Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
  2. Can be used to create a proxy to other facet types (like SffTqlFacet).

...

Facet Type Name
SffNetworkFacet
Language SupportNetwork Definition using <Network> Tag.
Transports

WsServerExtensionArgWsServerExtensionArgs

Usage

 Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models. Network defintion

is created at the time of OnActivate Facet Instance Lifecycle.

Code Block
languagexml
titleSffMsgFacet SffNetworkFacet Example
linenumberstrue
<!-- Define Cluster / Network -->
<NewFacetInstance fid="cluster" name="cluster" type="SffNetworkFacet">
		<OnActivate>
			<Process>
				<Network>
					<Group name="FarmGatewayGroup" />
					<TqlEngine name="Cloud0" url="ws://10.0.1.4:8080/fid-cluster"
						group="FarmGatewayGroup" replicateTo="FarmCloudGroup"
						documentation="Cloud Summary Holder" />
					<Group name="FarmCloudGroup" />
					<TqlEngine name="Cloud1"
						url="ws://farm.atomiton.com:8080/fid-cluster" group="FarmCloudGroup"
						replicateTo="FarmCloudGroup" documentation="Cloud Summary Holder" />
				</Network>
			</Process>
		</OnActivate>
		<OnOpen ModifyPipeline="WsServerExtensionArgs" />
</NewFacetInstance>

Associating withAssociated within

other FacetTypes

Instances of Network Facet Types are normally associated with the TQL Facet types so that the data can be replicated. Association

can be done as follows:

Code Block
languagexml
titleSffMsgFacet ExampleSffNetworkFacet Associated within SffTqlFacet
linenumberstrue
 <!-- Cluster specific replication -->
 <NewFacetInstance fid="SmartParking" Name="TQL" Type="SffTqlFacet">
 <OnActivate>
<!-- Associating Instance of Network facet -->
 <NetworkFacet>cluster</NetworkFacet>
</NewFacetInstance>
Use Cases
  1. Replicate data between different instances of TQLEngine.

...

  1. Broadcast messages to TQEngine(s)


TQL

Message Facet Type is a generic Message processing over any given specified transport. Message Facet Type does not support any specific payload to process unlike other Facet types. Message Facet Type can be used process any payload that is passed to it. 

SffTcpFacet
Facet Type NameSffMsgFacetSffTqlFacet
Language SupportFacetScriptThing Interaction Language (TIL) - TQL CRUD Queries requested via <Query> tag.
Transports

HttpServerExtensionArgs

WsServerExtensionArgWsServerExtensionArgs

Usage

 Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models.

Code Block
languagexml
titleSffMsgFacet SffTqlFacet Example
linenumberstrue
<!-- Typical TQL Facet Definition -->
	<NewFacetInstance fid="smartparking[:RuntimeParams.WSFacetIDName:]Cluster"
name		Name="SmartParkingTQL" typeType="SffMsgFacet">
  <OnOpen ModifyPipeline="HttpServerExtensionArgs" />
  <OnRequest>
    <!-- Handle Request -->SffTqlFacet">
		<OnActivate>
            <!-- Associate other facet types; Either Private or Public Instances -->
			<NewFacetInstance name="tqlwfws" type="SffWdlFacet" /> <!-- Private Instance of wdl facet -->
			<NetworkFacet>?cluster</NetworkFacet> <!-- Public Instance of Network Facet -->
			<TopicFacet>?TQLGenericTopic</TopicFacet> <!-- Public Instance of Topic Facet -->
			<ImportFacet>[:RuntimeParams.MacroFacetID:]</ImportFacet> <!-- Private Instance of Msg facet -->
			<Process>
                <!-- AnyDefine FacetScriptTQL CodeStorage canScheme go in here... ->
    <DoResponse>
       <!-- Send the response back.. ->
    </DoResponse>
  -->
				<Storage Name="[:RuntimeParams.TQLCacheName:]" Type="SqlSff"
					Comment="[:RuntimeParams.TQLCacheName:] Database SFF Unstructured SQL database" />
                <!-- Specify the Model Definition file (TDL). Normally consists of Model definitions -->
				<Namespace>
					<Include>cloud.dbm.xml</Include>
				</Namespace>
			</Process>
		</OnActivate>
		<OnOpen ModifyPipeline="WsServerExtensionArgs" />
		<OnRequest>
			<DoRequest> <!-- HandOff the request to Facet -->
				<Process Return="CMD_NOP">
					<Message>
						<Value>
							<Include>$Request.Message.Value</Include>
						</Value>
					</Message>
				</Process>
			</DoRequest>
			<DoResponse> <!-- Process the response from Facet or send it straight through -->
				<Process>
					<Message type="[:RuntimeParams.TQLOutputFormat:]">
						<Value>
							<Include>$Response.Message.Value</Include>
						</Value>
					</Message>
				</Process>
			</DoResponse>
		</OnRequest>
</NewFacetInstance>
Other NamesAssociating Other Facet Types

TQL Facet normally associates other facet types that are either private or public Instances. Private Instances are those that are defined internal with the

TQL Facet Instance definition.

Use Cases
  1. Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
  2. Can be used to create a proxy to other facet types (like SffTqlFacetHandle TQL Query request from external users over a given transport (Http or WS).

 

Workflow

Message Facet Type is a generic Message processing over any given specified transport. Message Facet Type does not support any specific payload to process unlike other Facet types. Message Facet Type can be used process any payload that is passed to it. Workflow facet types allows users to install workflow definitions that can be called from other models.

Facet Type NameSffMsgFacetSffWdlFacet
Language SupportFacetScriptWorkflow Definition Language (WDL)
Transports

HttpServerExtensionArgs

WsServerExtensionArg

Usage

 Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models. Workflows are

typically installed at the time of <OnActivate> Life cycle. Note that Workflows are not a request / response style or external transport.

Code Block
languagexml
titleSffMsgFacet SffWdlFacet Example
linenumberstrue
<NewFacetInstance fid="smartparking[:RuntimeParams.WdlFacetIDName:]" nameName="SmartParkingwdl" typeType="SffMsgFacetSffWdlFacet">
  <OnOpen ModifyPipeline="HttpServerExtensionArgs" /> <OnActivate>
  <OnRequest>    <Include></Include> <!-- HandleSpecify RequestWorkflow -->
    <!-- Any FacetScript Code can go in here... ->
    <DoResponse>
  defintion files -->
    <!--/OnActivate>
Send the response back.. ->
    </DoResponse>
  </OnRequest><OnOpen ModifyPipeline="HttpServerExtensionArgs"/>
  </NewFacetInstance>
Other NamesSffTcpFacet

Associated within

other Facet Types

Private instances are associated within TQL Facet Types
Use Cases
  1. Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
  2. Can be used to create a proxy to other facet types (like SffTqlFacet)Implement complex business logic either (Thing or App) using Workflows.
  3. Private instance of Workflow Facet is a requirement for Thing and App Facets to function correctly as part of Tql Facet types.

 

Behavior

...

Tree

Message Facet Type is a generic Message processing over any given specified transport. Message Facet Type does not support any specific payload to process unlike other Facet types. Message Facet Type can be used process any payload that is passed to it. Behavior Tree Facet implements Behavior Trees

Facet Type NameSffMsgFacetSffBdlFacet
Language SupportFacetScriptBehavior Definition Lanauge (BDL)
Transports

HttpServerExtensionArgs

WsServerExtensionArg

Usage

 Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models.

Code Block
languagexml
titleSffMsgFacet Example
linenumberstrue
<NewFacetInstance fid="smartparkingbdl" name="SmartParkingbdl" type="SffMsgFacetSffBdlFacet">
      <OnOpen ModifyPipeline="HttpServerExtensionArgsWsServerExtensionArgs" />
  <OnRequest>
    <!-- Handle Request -->
    <!-- Any FacetScript Code can go in here... -</NewFacetInstance>
Use Cases
  1. Implement complex business logic either (Thing or App) using Behavior trees.

 

Topic

Topic Facet implements Subscription and Notification both at Model - to - model and external over a websocket interface.

<DoResponse>Sendtheresponse back.. DoResponse> </OnRequest> </NewFacetInstance>
Facet Type NameSffTopicFacet
Language Support

Subscribe and Notification

Code Block
languagexml
titleSubscribe Example
linenumberstrue
<Subscribe sid="test" topic="test.ws.*">
    
<Action>
       <!-- 
Take 
Some 
Action -->
    </
Other NamesSffTcpFacet
Use Cases
  1. Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
  2. Can be used to create a proxy to other facet types (like SffTqlFacet).

 

Topic

Message Facet Type is a generic Message processing over any given specified transport. Message Facet Type does not support any specific payload to process unlike other Facet types. Message Facet Type can be used process any payload that is passed to it. 

SffTcpFacet
Facet Type NameSffMsgFacet
Language SupportFacetScript
Action>
</Subscribe>
Transports

HttpServerExtensionArgs

WsServerExtensionArg

Usage

 Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models.

Code Block
languagexml
titleSffMsgFacet SffTopicFacet Example
linenumberstrue
<NewFacetInstance fid="smartparkingtopic" name="SmartParkingtopic" type="SffMsgFacetSffTopicFacet">
      <OnActivate>
       </OnActivate>
      <OnOpen ModifyPipeline="HttpServerExtensionArgs" />
  <OnRequest>WsServerExtensionArgs"/>
      <OnError>
        <DoResponse>
          <Process>
            <Message type="xml">
              <Value>
                <!-- Handle Request --><Error>[:$Error:]</Error>
                <!-- Any FacetScript Code can go in here... -><ErrorRequest>[:$Request:]</ErrorRequest>
              </Value>
    <DoResponse>        <!-- Send the response back.. ->/Message>
          </Process>
        </DoResponse>
      </OnRequest>OnError>
 </NewFacetInstance>

Associated within

Other

Names

Facet Types

Public instances are associated within TQL Facet Types
Use Cases
  1. Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
  2. Can be used to create a proxy to other facet types (like SffTqlFacet)Allows Model to model and external Subscription and Notifications.
  3. Private instance of Topic Facet is a requirement for Model subscription to function correctly as part of Tql Facet types.

 

Scheduling

Message Facet Type is a generic Message processing over any given specified transport. Message Facet Type does not support any specific payload to process unlike other Facet types. Message Facet Type can be used process any payload that is passed to it. Sequence Facet supports scheduling of tasks at given time and frequency.

FacetScript
Facet Type NameSffMsgFacetSffSeqeunceFacet
Language Support

Sequence Language

Code Block
languagexml
titleSequence Language Example
linenumberstrue
<Execute eid="test" schedule="[30../10sec]" limit="15">
      <Action>
         <JavaScript>
           sffLog.info("Doing something...");
         </JavaScript>
      </Action>
</Execute>
Transports

HttpServerExtensionArgs

WsServerExtensionArg

Usage

 Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models.

Code Block
languagexml
titleSffMsgFacet SffSequenceFacet Example
linenumberstrue
<NewFacetInstance fid="smartparkingseq" name="SmartParkingseq" type="SffMsgFacetSffSequenceFacet">
 
<OnOpen ModifyPipeline="HttpServerExtensionArgs" />   <OnRequest> <OnActivate>
   <!-- Handle Request -->     <!-- AnySchedule FacetScriptsomething Codeat canthe gotime in here... ->
    <DoResponse>
of activation -->
      <!-- Send the response back.. ->/OnActivate>
        </DoResponse>
  </OnRequest><OnOpen ModifyPipeline="WsServerExtensionArgs"/>
 </NewFacetInstance>
Other NamesSffTcpFacet
Use Cases
  1. Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
  2. Can be used to create a proxy to other facet types (like SffTqlFacet)Scheduling of tasks at given interval and frequency.

 

Static Files

Message Facet Type is a generic Message processing over any given specified transport. Message Facet Type does not support any specific payload to process unlike other Facet types. Message Facet Type can be used process any payload that is passed to it. Static Files Facet Types allows users to serve static files using TQLEngine

Facet Type NameSffMsgFacet
SffStaticFileFacet
Language SupportFacetScript
Transports

HttpServerExtensionArgs

WsServerExtensionArg

Usage

 Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models.

Code Block
languagexml
titleSffMsgFacet SffStaticFileFacet Example
linenumberstrue
<NewFacetInstance fid="smartparkingfile" name="SmartParkingFile" type="SffMsgFacetSffStaticFileFacet">
 
<OnOpen ModifyPipeline="HttpServerExtensionArgs" />   <OnRequest>   <OnActivate>
 <!-- Handle Request -->     <!-- Any FacetScript Code can go in here... ->
    <DoResponse>
       <!-- Send the response back.. -><Process BasePath="web" Resource="res"/>
     </DoResponse>   </OnRequest>OnActivate>
</NewFacetInstance>
Other NamesSffTcpFacet
Use Cases
  1. Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
  2. Can be used to create a proxy to other facet types (like SffTqlFacet).Handy to serve your html5 Javascript Application using TQLEngine. Avoid overhead of spinning yet another http file server!