Tasks get created when scenarios or pipelines are created. Please refer to the Entities' creation section for more details.
In this section, it is assumed that
module contains a Taipy configuration already implemented.
Now that we know how to create a new
Task, this section focuses on describing the task's attributes and
Task entity is identified by a unique identifier
id Taipy generates.
A task also holds various properties accessible as an attribute of the task:
- config_id is the id of the scenario configuration.
- input is the list of input data nodes.
- output is the list of output data nodes.
- function is the Python function associated with the Task config.
The function takes as many parameters as there are data nodes in the input attribute. Each parameter corresponds to the return value of an input data node
The function returns as many parameters as there are data nodes in the output attribute. Each function's returned value corresponds to the parameter of an output data node
- version: The string indicates the application version of the task to instantiate. If not provided, the current version is used. Refer to the version management page for more details.
- skippable: Boolean attribute indicating if a task execution can be skipped when all output data nodes are up-to-date (see the validity_period attribute in the Data node management page for more detail). The default value of skippable is False.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Taipy exposes multiple methods to manage the various tasks.
The first method to access a job is from its id by using the
1 2 3 4 5 6 7
Here, the two variables
task_retrieved are equal.
All the jobs can be retrieved using the method
Get tasks by config id¶
A task can be retrieved from a scenario or a pipeline, by accessing the task config_id attribute.
1 2 3 4
Tasks can also be retrieved using
get_entities_by_config_id() providing the config_id.
This method returns the list of all existing tasks instantiated from the config_id provided as a parameter.
1 2 3 4 5 6 7 8 9 10
Get parent scenarios and pipelines¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16