TaskBuilder¶
dotflow.core.task.TaskBuilder
¶
Import
You can import the Task class with:
from dotflow.core.task import TaskBuilder
Example
class dotflow.core.task.TaskBuilder
from uuid import uuid4
build = TaskBuilder(
config=config
workflow_id=uuid4()
)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Config
|
Configuration class. |
required |
workflow_id
|
UUID
|
Workflow ID. |
None
|
Source code in dotflow/core/task.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | |
add(step, callback=basic_callback, initial_context=None, group_name='default')
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
Callable
|
A argument that receives an object of the callable type, which is basically a function. You can see in this example. |
required |
callback
|
Callable
|
Any callable object that receives args or kwargs, which is basically a function. You can see in this example. |
basic_callback
|
initial_context
|
Context
|
The argument exists to include initial data in the execution of the workflow within the function context. This parameter can be accessed internally, for example: initial_context, to retrieve this information and manipulate it if necessary, according to the objective of the workflow. |
None
|
group_name
|
str
|
Group name of tasks. |
'default'
|
Source code in dotflow/core/task.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
count()
¶
Source code in dotflow/core/task.py
378 379 | |
clear()
¶
Source code in dotflow/core/task.py
381 382 | |
reverse()
¶
Source code in dotflow/core/task.py
384 385 | |
schema()
¶
Source code in dotflow/core/task.py
387 388 389 390 391 392 | |
result()
¶
Source code in dotflow/core/task.py
394 395 396 | |