...
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 Name | SffMsgFacet |
---|
Language Support | FacetScript |
---|
Transports | HttpServerExtensionArgs WsServerExtensionArgWsServerExtensionArgs |
---|
Usage | Facet Types are used in <NewFacetInstance> when creating a Package (Deployment) definition for your models. Code Block |
---|
language | xml |
---|
title | SffMsgFacet Example |
---|
linenumbers | true |
---|
| <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 Names | SffTcpFacet |
---|
Use Cases | - Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
- Can be used to create a proxy to other facet types (like SffTqlFacet).
|
---|
...
Facet Type Name | SffNetworkFacet |
---|
Language Support | Network 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 |
---|
language | xml |
---|
title | SffMsgFacet SffNetworkFacet Example |
---|
linenumbers | true |
---|
| <!-- 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 |
---|
language | xml |
---|
title | SffMsgFacet ExampleSffNetworkFacet Associated within SffTqlFacet |
---|
linenumbers | true |
---|
| <!-- Cluster specific replication -->
<NewFacetInstance fid="SmartParking" Name="TQL" Type="SffTqlFacet">
<OnActivate>
<!-- Associating Instance of Network facet -->
<NetworkFacet>cluster</NetworkFacet>
</NewFacetInstance> |
|
---|
Use Cases | - Replicate data between different instances of TQLEngine.
|
---|
...
- 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.
Facet Type Name | SffMsgFacetSffTqlFacet |
---|
Language Support | FacetScriptThing 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 |
---|
language | xml |
---|
title | SffMsgFacet SffTqlFacet Example |
---|
linenumbers | true |
---|
| <!-- 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 Names | SffTcpFacetAssociating 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 | - Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
- 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 Name | SffMsgFacetSffWdlFacet |
---|
Language Support | FacetScriptWorkflow 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 |
---|
language | xml |
---|
title | SffMsgFacet SffWdlFacet Example |
---|
linenumbers | true |
---|
| <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 Names | SffTcpFacet |
---|
Associated within other Facet Types | Private instances are associated within TQL Facet Types |
---|
Use Cases | - Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
- Can be used to create a proxy to other facet types (like SffTqlFacet)Implement complex business logic either (Thing or App) using Workflows.
- 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 Name | SffMsgFacetSffBdlFacet |
---|
Language Support | FacetScriptBehavior Definition Lanauge (BDL) |
---|
Transports | HttpServerExtensionArgs WsServerExtensionArg |
---|
Usage | Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models. Code Block |
---|
language | xml |
---|
title | SffMsgFacet Example |
---|
linenumbers | true |
---|
| <NewFacetInstance fid="smartparkingbdl" name="SmartParkingbdl" type="SffMsgFacetSffBdlFacet">
<OnOpen ModifyPipeline="HttpServerExtensionArgsWsServerExtensionArgs" />
<OnRequest>
<!-- Handle Request -->
<!-- Any FacetScript Code can go in here... -</NewFacetInstance> |
|
---|
Use Cases | - 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.
Facet Type Name | SffTopicFacet |
---|
Language Support | Subscribe and Notification Code Block |
---|
language | xml |
---|
title | Subscribe Example |
---|
linenumbers | true |
---|
| <Subscribe sid="test" topic="test.ws.*">
|
| <DoResponse> | Send | the | response back.. | DoResponse>
</OnRequest>
</NewFacetInstance>
---|
Other Names | SffTcpFacet |
---|
Use Cases | - Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
- 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.
Facet Type Name | SffMsgFacet |
---|
Language Support | FacetScript |
---|
Transports | HttpServerExtensionArgs WsServerExtensionArg |
---|
Usage | Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models. Code Block |
---|
language | xml |
---|
title | SffMsgFacet SffTopicFacet Example |
---|
linenumbers | true |
---|
| <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 | SffTcpFacetFacet Types | Public instances are associated within TQL Facet Types |
---|
Use Cases | - Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
- Can be used to create a proxy to other facet types (like SffTqlFacet)Allows Model to model and external Subscription and Notifications.
- 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.
Facet Type Name | SffMsgFacetSffSeqeunceFacet |
---|
Language Support | FacetScript | Sequence Language Code Block |
---|
language | xml |
---|
title | Sequence Language Example |
---|
linenumbers | true |
---|
| <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 |
---|
language | xml |
---|
title | SffMsgFacet SffSequenceFacet Example |
---|
linenumbers | true |
---|
| <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 Names | SffTcpFacet |
---|
Use Cases | - Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
- 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 Name | SffMsgFacetSffStaticFileFacet |
---|
Language Support | FacetScript |
---|
Transports | HttpServerExtensionArgs WsServerExtensionArg |
---|
Usage | Facet Types are used using <NewFacetInstance> when creating a Package (Deployment) definition for your models. Code Block |
---|
language | xml |
---|
title | SffMsgFacet SffStaticFileFacet Example |
---|
linenumbers | true |
---|
| <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 Names | SffTcpFacet |
---|
Use Cases | - Publish HTTP or WebSocket Endpoint served by TQLEngine to process any request and send response.
- 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!
|
---|