Introduction
The Pipeline API has been designed to be easy to use, adding IDE auto-complete support where possible. However, one of our key design goals was to allow new properties to be added without the API software needing to be updated. These goals are often in conflict and lead to the creation of several possible mechanisms to retrieve property values.
See the Specification for more technical details.
Detail
The precise nature of the available accessors depend on the language being used but we have aimed to support the following use cases:
- Accessing properties without any 'magic strings' and with IDE auto-complete support.
- Accessing a property that has been returned by the data source but that did not exist when the current version of the flow element was built.
- Accessing a property without first accessing the associated aspect data.
If you have an instance of the element that you want to get data for, this can also be used to get the data populated by that instance:
After you have the specific element data instance, the individual properties can be accessed as normal using strongly typed property accessors. For example, accessing the IsMobile
property looks like this:
Where a new property is present in the data source that did not exist when the code was compiled, a string-based accessor can be used instead. As long as you know the string name of the property you can access it, even if it does not exist in the interface. The downside is that this is not strongly-typed so you will need to deal with casting. For example, accessing the IsMobile
property in this way can be done like this:
The GetAs
variation can be used if you know the type of the property:
In addition, a shortcut can be used to access the property without specifying the associated flow element/engine at all. However, this has the downside that you will need to know the type of the property you are accessing. For example, the IsMobile
property can be accessed like this:
If you have an instance of the element that you want to get data for, this can also be used to get the data populated by that instance:
After you have the specific element data instance, the individual properties can be accessed as normal using strongly typed property getters. For example, accessing the IsMobile
property looks like this:
Where a new property is present in the data source that did not exist when the code was compiled, a string-based accessor can be used instead. As long as you know the string name of the property you can access it, even if it does not exist in the interface. The downside is that this is not strongly-typed so you will need to deal with casting. For example, accessing the IsMobile
property in this way can be done like this:
In addition, a shortcut can be used to access the property without specifying the associated flow element/engine at all. However, this has the downside that you will need to know the type of the property you are accessing. For example, the IsMobile
property can be accessed like this:
If you have an instance of the element that you want to get data for, this can also be used to get the data populated by that instance without having to know the associated name:
After you have the specific element data instance, the individual properties can be accessed using normal property accessors. Node's weakly typed nature means that the scenario where a new property is available in the data source is not a problem. Wherever it's come from, you just need to know the name of the property you want to retrieve. For example, accessing the IsMobile
property looks like this:
If you have an instance of the element that you want to get data for, this can also be used to get the data populated by that instance without having to know the associated name:
After you have the specific element data instance, the individual properties can be accessed using normal property accessors. PHP's weakly typed nature means that the scenario where a new property is available in the data source is not a problem. Wherever it's come from, you just need to know the name of the property you want to retrieve. For example, accessing the IsMobile
property looks like this:
If you have an instance of the element that you want to get data for, this can also be used to get the data populated by that instance without having to know the associated name:
After you have the specific element data instance, the individual properties can be accessed using normal property accessors. Python's weakly typed nature means that the scenario where a new property is available in the data source is not a problem. Wherever it's come from, you just need to know the name of the property you want to retrieve. For example, accessing the IsMobile
property looks like this: