...
- Internal Variables - These are variables that are created and populated by PhixFlow when certain actions happen. E.g. _fileName is populated by PhixFlow and is available in the definition of Stream attribute, when the streamset has data that is coming from a fileCollector. A full list of Internal Variables, and how they are populated can be found here.
- User Defined Variables - These are variables that are defined by the user, and can be used to hold data required for complex calculations in attributes or other expressions.
- Attribute Names - These are the attribute names that are defined as part of a Stream which are subsequently available for use in other attributes or expressions. Attributes can referred to in File Collectors, and implicit attribute names come from database collectors as a special case where these are the names of the fields returned by the DB Collector query. Attribute names can be qualified with pipe names e.g. pipename.recordID.
Defining a Variable
A User Defined Variable must start with the $ character. By convention, Camel case naming convention is used (Camel case is a convention where names are made up of multiple words, with no spaces and the first letter of each word is capitalised. e.g. ThisIsCamelCase) when giving a variable a name, and variables that are local to the current function or expression should start with a lower case letter after the initial $ character. Variables whose scope extends beyond the current attribute expressions should start with an upper case letter after the initial $ character.
...
A further discussion of type assignments and full list of types is available in the Parameter Types section on the help page for Scripting Basics and a discussion on how complex expressions can be defined for attributes is available here.
Anchor | ||||
---|---|---|---|---|
|
...
Note : Attributes are evaluated in order, so Variables defined in an Attribute (or the attribute name itself) can be referenced in a later Attribute Expression, or in a dependent Expression that is referenced after that Attribute is evaluated.
E.g. you can refer in a pipe index Expression to a $variable if you have done a "lookup($variable)" in the Stream before that pipe reference (or in an Output Multiplier, or an Output Filter), but otherwise you can’t.
The following tables gives some guidelines for the availability of Variables, based on the PhixFlow Timing Cycle for evaluating Models.
Location of Expression | Available Variables |
---|---|
Input Multiplier | Some Internal Variables (e.g. _toDate) User Defined Variables (i.e. variables declared locally in the Input Multiplier) |
Database Collector SQL script | _inputMultiplier %USERNAME%, %PASSWORD% User Defined Variables |
Output Multiplier | Internal Variables (e.g. _toDate) User Defined Variables |
Attribute Expression | Internal Variables (e.g. _toDate) All <pipeName> values (e.g. inpipe.accountVal All _out.value where value is the name of the attribute and it is before the current attribute in the Stream All user defined variables created in a prior Attribute expression |
Output Filter Expression | Internal Variables (e.g. _toDate) All _out.attribute values All user defined variables created in any Attribute expression |
Pipe Index Expression on a Lookup pipe | Internal Variables <pipename>.attribute - the name on an input pipe All _out.value where value is the name of the attribute and it is before the current attribute in the Stream |
<pipename>.attribute - the name on an input pipe