You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When #176 was introduced, it also introduced some expected behaviour (to me at least ;-)). I expected when using the pyzeebe.Job for a parameter on a task, all variables would be replaced by the job (since it contains a variables dictionary). Therefore, I tried to do something like the following:
@worker.task('create_organisation')defcreate_organisation(job: pyzeebe.Job):
"""Create organisation from job.variables"""organisation=job.variables["organisation"]
# do something with organisationjob.variables['new_var'] =new_varreturnjob.variables
However, this doesn't work, since the job.variables dict doesn't actually contain the variables, but it recursively contains the job.
Describe the solution you'd like
I think it would be best to have access to the actual variables through job.variables, if possible. Else, the variables should be removed of this 'kind of Job' (maybe related to #179). But at the very least, I think it should be clearly stated in the docs if this behaviour is kept.
Describe alternatives you've considered
You can still get the variables the regular way.
E.g. this does work:
@worker.task('create_organisation')defcreate_organisation(job: pyzeebe.Job, organisation):
"""Create organisation from job's variables"""# do something with organisationreturn {'new_var': new_var}
Additional context
Version used: v3.0.0rc3
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When #176 was introduced, it also introduced some expected behaviour (to me at least ;-)). I expected when using the
pyzeebe.Job
for a parameter on a task, all variables would be replaced by the job (since it contains a variables dictionary). Therefore, I tried to do something like the following:However, this doesn't work, since the
job.variables
dict doesn't actually contain the variables, but it recursively contains the job.Describe the solution you'd like
I think it would be best to have access to the actual variables through
job.variables
, if possible. Else, the variables should be removed of this 'kind of Job' (maybe related to #179). But at the very least, I think it should be clearly stated in the docs if this behaviour is kept.Describe alternatives you've considered
You can still get the variables the regular way.
E.g. this does work:
Additional context
Version used: v3.0.0rc3
The text was updated successfully, but these errors were encountered: