IPreparedExecution
Prepared execution already knows what data to calculate and allows to specify how the data should be sorted and shaped into dimensions.
export interface IPreparedExecution extends ICancelable<IPreparedExecution>
Extends: ICancelable<IPreparedExecution>
Remarks
To this end, it provides several functions to customize sort items and dimensions. The prepared execution is immutable and so all the customization functions WILL result in a new instance of prepared execution.
The contract for creating these new instances is that the new prepared execution MUST be created using the execution factory that created current execution.
Note that even though the prepared executions are immutable, the abort signal itself is stateful and is always propagated through the whole immutable chain. If you don’t want to cancel multiple executions simultaneously via single abort signal, you need to set it on the outermost execution only, just before calling the execute method.
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| (Optional) Arbitrary execution metadata provided by the caller. | ||
| Definition of the execution accumulated to so far. | ||
| AbortSignal | (Optional) Abort signal to cancel the execution or its result. |
Methods
Method | Description |
|---|---|
Tests whether this execution and the other execution are the same. | |
Starts the execution. | |
Fingerprint of this prepared execution. | |
Attaches custom execution context metadata. | |
Adds the desired date format to the postProcessing of an IPreparedExecution. | |
Configures dimensions of the resulting data. Any dimension settings accumulated so far WILL be wiped out. | |
Additional execution configuration | |
Changes sorting of the resulting data. Any sorting settings accumulated so far WILL be wiped out. |
Property details
IPreparedExecution.contextproperty
Arbitrary execution metadata provided by the caller.
readonly context?: IExecutionContext;
IPreparedExecution.definitionproperty
Definition of the execution accumulated to so far.
readonly definition: IExecutionDefinition;
IPreparedExecution.signalproperty
Abort signal to cancel the execution or its result.
readonly signal?: AbortSignal;
Method details
IPreparedExecution.equals()method
Tests whether this execution and the other execution are the same.
equals(other: IPreparedExecution): boolean;
Parameters
Parameter | Type | Description |
|---|---|---|
other | another execution |
Returns
boolean
Remarks
This effectively means that their definitions are deeply equal.
If you are only concerned with the equality from the result calculation point of view, consider comparing fingerprints instead.
IPreparedExecution.execute()method
Starts the execution.
execute(): Promise<IExecutionResult>;
Returns
Promise<IExecutionResult>
IPreparedExecution.fingerprint()method
Fingerprint of this prepared execution.
fingerprint(): string;
Returns
string
Remarks
This is effectively the fingerprint of the execution definition underlying this instance of Prepared Execution.
IPreparedExecution.withContext()method
Attaches custom execution context metadata.
withContext(context: IExecutionContext): IPreparedExecution;
Parameters
Parameter | Type | Description |
|---|---|---|
context | metadata to associate with this execution |
Returns
new execution containing the provided context
IPreparedExecution.withDateFormat()method
Adds the desired date format to the postProcessing of an IPreparedExecution.
withDateFormat(dateFormat: string): IPreparedExecution;
Parameters
Parameter | Type | Description |
|---|---|---|
dateFormat | string | Format to be applied to the dates in an AFM execution response. |
Returns
new execution with the updated postProcessing
IPreparedExecution.withDimensions()method
Configures dimensions of the resulting data. Any dimension settings accumulated so far WILL be wiped out.
withDimensions(...dim: Array<IDimension | DimensionGenerator>): IPreparedExecution;
Parameters
Parameter | Type | Description |
|---|---|---|
dim | Array<IDimension | DimensionGenerator> | dimensions to set |
Returns
new execution with the updated dimensions
Remarks
The realizations of analytical backend MAY impose constraints on the minimum and maximum number of dimensions. This call WILL fail if the input dimensions do not match constraints imposed by the backend.
IPreparedExecution.withExecConfig()method
Additional execution configuration
withExecConfig(config: IExecutionConfig): IPreparedExecution;
Parameters
Parameter | Type | Description |
|---|---|---|
config |
Returns
IPreparedExecution.withSorting()method
Changes sorting of the resulting data. Any sorting settings accumulated so far WILL be wiped out.
withSorting(...items: ISortItem[]): IPreparedExecution;
Parameters
Parameter | Type | Description |
|---|---|---|
items | items to sort by |
Returns
new execution with the updated sorts