Variables
Introductionβ
Variables are used within the language to represent some data, this could simply be a number or it could be a more complex object such as a TimeSeries.
Variables in OpenDataDSL are typeless, meaning you don't need to initialise a variable of a certain type although it is implied by the value you give it or the way you construct it, e.g.
// This creates a String or rather a Scalar variable of type String
myvar = "Hello World"
// This creates a Date variable (initialised as now) using a constructor
mydate = Date()
Naming Conventionsβ
In OpenDataDSL, you can have both public and private data and objects, so it is important to understand how you reference these in your scripts and objects.
If an id is prefixed with a '#' character denotes that an object is public - which is available to everyone. If not, then the object is private - which is visible only to users within your own tenancy.
Below is an example of how this works with types and objects
// private type
pritype = ${type:"Person"}
// public type
pubtype = ${type:"#Location"}
// private object
johndoe = ${object:"JohnDoe"}
// public object
gb = ${object:"#LOC_GBR"}
Built-in Variable Typesβ
Scalarβ
A scalar is a single value of either string, boolean (true/false) or numeric
Dateβ
A date variable is a representation of a Date or a Date and Time in the UTC timezone
Durationβ
A duration variable represents a period of time such as 3 days or 4 and a half minutes in ISO 8601 duration format
Objectβ
An object is a very versatile variable type that allows you to add any other variables to it including Object variable types. This creates a dynamic JSON type structure
Secretβ
A secret is a scalar whose value cannot be printed or logged, it only really is useful when used with the Secret Service where secrets can be stored and then retrieved by scripts or workflows. Usually secrets are used to store passwords and database connection information etc.
Calendarβ
A calendar variable type represents an ODSL Calendar. It is used with timeseries, curves and other time-bound resources
Expiry Calendar Variableβ
An expiry calendar variable type represents an Expiry Calendar which is a special type of calendar that uses rules to calculate when trading stops for a future price for a particular commodity
Transformerβ
A wrapper for a data transformer, used with the transformer service
Extractorβ
A wrapper for an extractor, used by the extractor service
Linkβ
A wrapper variable for creating links or relationships between objects
DeclaredTypeβ
A DeclaredType variable is a wrapper for a type and is used by the type service and creating objects
Executableβ
An executable wrapper variable holds either an expression of a method
Voidβ
This is an empty variable used for methods that donβt return a specific variable
Nullβ
Null represents an empty or no value variable
MissingValueβ
A MissingValue is a real variable but it doesnβt have a value yet, it is usually used in TimeSeries to represent a TimeValue in a calendar that has no value
Listβ
A list represents a list of other variables
VirtualList A VirtualList is a list that is paged to improve performance and is used with the find command when listing resources from services
TimeSeriesβ
A timeseries is a list of values which are indexed by dates. A timeseries could be the price of a particular stock recorded at a certain time of each day (say the time that the stock exchange closes)
Smart TimeSeriesβ
A Smart TimeSeries is an expression that is used to build TimeSeries on demand
TimeValueβ
A TimeValue represents a single observed value in a timeseries
Curveβ
A curve is a structure that represents a set of values with a time index sometime in the future. It can be used for commodity and financial forward curves, yield curves and forecasts (weather, prices etc.)
EventCurveβ
A curve that is dynamically built from events
SmartCurveβ
A Smart Curve is an expression that is used to build curves on demand
CurveDateβ
A CurveDate is used as the valuation date of a curve. It is a date with an expiry calendar
Contractsβ
Contracts are used on a curve as a set of contract objects that represent the future periods and values
Contractβ
A contract is a single future period in time that represents a tradable future contract or a forecasted value on a curve
Spreadsheetβ
A spreadsheet represents a set of cells within a row and column bound matrix
Cellβ
A cell represents a single location-aware cell within a spreadsheet
Tableβ
A table is a set of rows within a column oriented matrix
Rowβ
A row represents a single row of data usually associated with a row in a relational database table. A row is similar to an object in that it has dynamic properties except that you can only add Scalars or Dates as elements to a row
Matrixβ
A matrix represents a 2-dimensional array of numeric values
Workflowβ
A workflow represents a set of actions and transitions that form an executable flow diagram
Actionβ
An action variable is the definition of an action that can be used in a workflow
Argβ
An arg variable is a configuration of an input or output argument of a workflow action
Transitionβ
A transition variable is the definition of a transition that is used in a workflow
Processβ
A process variable contains all the information to configure and run a process
Batchβ
A batch variable is a custom list variable that contains variables and supplemental information needed to update into the object repository
Scriptβ
A script variable is a wrapper for an ODSL script. It is used by the script service and can also run the script
Taskβ
A task is a physical task assigned to a user from either a user or the system
Reportβ
A report is a configuration containing an expression that can be run to produce a user definable report
Policyβ
A policy variable allows you to restrict access to data within any service