on
aisShell
The Initial Release of aisShell
can now be downloaded from Github.
It can be used to test Form Requests
, Stack Form Applications
and Data Service Requests
.
The pace of AIS evolution is nothing short of staggering, or even bewildering. Gone are the days of steady-as-she-goes releases and subsequent major upgrades. A tools upgrade from 9.1.x to 9.2.x might not seem much on the surface, but the accompanying version 2 of AIS is quite something.
One area where E1’s development tools have been lacking is exposure of the underlying database SQL functionality. Like grouping and aggregate for example. Some of it has been buried in the API layer for years, struggling for a daylight conduit – until now!
The Data Service Request
can be called with an aggregation
property with SQL-like column functions and grouping. For example, a Data Service Request
to total open purchase orders by supplier can be as easy as:
[:] $ dt -c ag d -n f4311 -st aggregation
New Data Definition? [y/N] y
[:] dt:ag $ qry cn f4311.nxtr equal literal 400
[:] dt:ag $ gr f4311.an8
[:] dt:ag $ ag -a sum f4311.aexp
After creating Data Context
for table F4311 with service type AGGREGATION
, we add a query to select records with Next Status 400, group them by AN8 and sum AEXP.
The request looks like this:
[:] dt:ag $ exp
{
"dataServiceType": "AGGREGATION",
"targetName": "F4311",
"targetType": "table",
"aggregation": {
"aggregations": [
{
"aggregation": "SUM",
"column": "F4311.AEXP"
}
],
"groupBy": [
{
"column": "F4311.AN8"
}
],
"orderBy": []
},
"findOnEntry": "TRUE",
"maxPageSize": "10",
"query": {
"condition": [
{
"value": [
{
"content": "400",
"specialValueId": "LITERAL"
}
],
"controlId": "F4311.NXTR",
"operator": "EQUAL"
}
]
}
}
The response will be something like this:
{
"ds_F4311": {
"output": [
{
"groupBy": {
"F4311.AN8": 2000
},
"F4311.AEXP_SUM": 7324.0
},
{
"groupBy": {
"F4311.AN8": 7500
},
"F4311.AEXP_SUM": 1480.0
},
...
Traditionally, the only way to achieve this with E1 development tools without any trickery, was to write an UBE. But with AIS it’s almost trivial.
The picture following this post is of Garðakirkja in Iceland.