...
The FacetScript Language is one of the Atomic Domain Languages (ADLs). It is a low level high performance scripting language natively executed by the TQLEngine A-Stack without any additional compilation besides initial parsing.
...
FacetScript language as well as other domain-specific languages used in Atomiton TQLEngine A-Stack stack is not bound to a specific syntax. Any syntax capable of expressing structure can be used to represent language constructs. Out of the box, both XML and JSON can be used.
...
How is FacetScript Implemented
FacetScript implementation within A-Stack is best understood if we understand the message processing flow within A-Stack.
Message Processing Flow
The Atomiton TQLEngine A-Stack architecture is a Scalable Event-Driven Architecture which uses a high performance NIO-based communication framework that provide low level asynchronous socket communications. Message processing flow steps are:
- A data structure called Facet Instance is associated with each incoming request. Each facet instance is identified by its facet ID and represents a capability to perform certain actions on the engine.
- Incoming requests without valid facet IDs are rejected. Each facet instance is also associated with its Facet Type which is a piece of executable code (a Java class) intended to actually process the request
...
- Once request legitimacy is established by successful resolution of its facet ID, a processing
...
- pipeline is created for low level request processing. This includes protocol handling, data decoding/encoding and initial data transformation and normalization.
- Once request data is presented in a universal fashion (as an instance of ListMap data structure), engine invokes appropriate facet type method using current connection context and facet instance information as arguments.
When to use FacetScript
Using FacetScript is optional and completely dependent on the developer role. For example, if you are a business analyst responsible for only writing simple TQL queries then using FacetScript is optional.
FacetScript Support in FacetTypes
FacetType | FacetScript Supported | Required | Examples | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SffMsgFacet | Yes | Optional | Note that SffMsgFacet does not expose any specific language constructs. FacetScript is the only option to use when using SffMsgFacet at that time of the package definition.
| |||||||||||
SffTqlFacet | Yes | Optional | Here we use FacetScript to loop through the Find Result and Update the VendorTitle value.
| |||||||||||
SffWdlFacet | Yes, when wrapped within Workflow Task's Invoke | Optional |
|
Mandatory within Package Definition
Using FacetScript is mandatory when defining a new package. New package definition contains the list of FacetTypes that the developer intends to deploy in TQLEngineA-Stack. Note that NewPackage itself is part of FacetScript.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<NewPackage> <!-- ======================================================================= --> <NewFacetInstance fid="test" name="static" type="SffHttpStaticFileFacet"> <OnActivate> <Process> <Resource>res</Resource> </Process> </OnActivate> </NewFacetInstance> <!-- ======================================================================= --> <NewFacetInstance fid="wstest" name="wstest" type="SffTcpFacet" context="keep"> <OnOpen ModifyPipeline="WebSocketServerExtensionArgs"/> <OnRequest> <DoResponse target="wstest:*" process="wstest.$Request"/> </OnRequest> </NewFacetInstance> <!-- ======================================================================= --> </NewPackage> |
...