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
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 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 |
|
add(step, callback=basic_callback, initial_context=None)
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
|
Source code in dotflow/core/task.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 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 |
|
count()
Source code in dotflow/core/task.py
319 320 |
|
clear()
Source code in dotflow/core/task.py
322 323 |
|
reverse()
Source code in dotflow/core/task.py
325 326 |
|