Constructor
new Builder(processes, parentnullable, id)
Creates a Builder instance.
Each process passed to the constructor is made available as object method.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
processes |
Array.<Process> | Processes | ProcessRegistry | Either an array containing processes or an object compatible with |
||
parent |
Builder |
<nullable> |
null | The parent builder, usually only used by the Builder itself. |
id |
string | A unique identifier for the process. |
- Source:
Members
id :string
A unique identifier for the process.
Type:
- string
- Source:
(nullable) parent :Builder
The parent builder.
Type:
- Source:
(nullable) parentNode :BuilderNode
The parent node.
Type:
- Source:
(nullable) parentParameter :string
The parent parameter name.
Type:
- string
- Source:
processes :ProcessRegistry
List of all non-namespaced process specifications.
Type:
- ProcessRegistry
- Source:
Methods
(async, static) fromURL(url) → {Promise.<Builder>}
Creates a Builder instance that can be used without connecting to a back-end.
It requests the processes for the version specified from the given URL. CORS needs to be implemented on the server-side for the URL given.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | null |
- Source:
Throws:
Returns:
- Type
- Promise.<Builder>
(async, static) fromVersion(versionopt, nullable) → {Promise.<Builder>}
Creates a Builder instance that can be used without connecting to a back-end.
It requests the processes for the version specified from processes.openeo.org. Requests the latest version if no version number is passed.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
version |
string |
<optional> <nullable> |
null |
- Source:
Throws:
Returns:
- Type
- Promise.<Builder>
[undefined](…args) → {BuilderNode}
Implicitly calls the process with the given name on the back-end by adding it to the process.
This is a shortcut for Builder#process.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
* |
<repeatable> |
The arguments for the process. |
- Source:
- See:
Returns:
- Type
- BuilderNode
addParameter(parameter, rootopt)
Adds a parameter to the list of process parameters.
Doesn't add the parameter if it has the same name as a callback parameter.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
parameter |
object.<string, *> | The parameter spec to add, must comply to the API. |
||
root |
boolean |
<optional> |
true | Adds the parameter to the root process if set to |
- Source:
addProcessSpec(process, namespaceopt, nullable)
Adds a process specification to the builder so that it can be used to create a process graph.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
process |
Process | Process specification compliant to openEO API |
||
namespace |
string |
<optional> <nullable> |
null | Namespace of the process (default to |
- Source:
Throws:
(protected) createCallbackParameter(parameterName) → {Proxy.<Parameter>}
Creates a callback parameter with the given name.
Parameters:
Name | Type | Description |
---|---|---|
parameterName |
string |
- Source:
Returns:
- Type
- Proxy.<Parameter>
createFunction(process)
Creates a callable function on the builder object for a process.
Parameters:
Name | Type | Description |
---|---|---|
process |
Process |
- Source:
Throws:
generateId(prefixopt) → {string}
Generates a unique identifier for the process nodes.
A prefix can be given to make the identifiers more human-readable. If the given name is empty, the id is simply an incrementing number.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
prefix |
string |
<optional> |
"" |
- Source:
Returns:
- Type
- string
getParentCallbackParameters() → {Array}
Gets the callback parameter specifics from the parent process.
- Source:
- To Do:
-
- Should this also pass callback parameters from parents until root is reached?
Returns:
- Type
- Array
math(formula) → {BuilderNode}
Adds a mathematical formula to the process.
See the Formula class for more information.
Parameters:
Name | Type | Description |
---|---|---|
formula |
string |
- Source:
- See:
Throws:
Returns:
- Type
- BuilderNode
process(processId, argsopt, descriptionopt, nullable) → {BuilderNode}
Adds another process call to the process chain.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
processId |
string | The id of the process to call. To access a namespaced process, use the |
||
args |
object.<string, *> | Array |
<optional> |
{} | The arguments as key-value pairs or as array. For objects, they keys must be the parameter names and the values must be the arguments. For arrays, arguments must be specified in the same order as in the corresponding process. |
description |
string |
<optional> <nullable> |
null | An optional description for the process call. |
- Source:
Returns:
- Type
- BuilderNode
setParent(node, parameterName)
Sets the parent for this Builder.
Parameters:
Name | Type | Description |
---|---|---|
node |
BuilderNode | |
parameterName |
string |
- Source:
spec(id, namespaceopt, nullable) → {Process|null}
Returns the process specification for the given process identifier and namespace (or null
).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | Process identifier |
||
namespace |
string |
<optional> <nullable> |
null | Namespace of the process (default to |
- Source:
Returns:
- Type
- Process | null
supports(processId, namespaceopt, nullable) → {boolean}
Checks whether a process with the given id and namespace is supported by the back-end.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
processId |
string | The id of the process. |
||
namespace |
string |
<optional> <nullable> |
null | Namespace of the process (default to |
- Source:
Returns:
- Type
- boolean
toJSON() → {Process}
Returns a JSON serializable representation of the data that is API compliant.
- Source:
Returns:
- Type
- Process