pyzeebe
pyzeebe copied to clipboard
Make Job safe
Is your feature request related to a problem? Please describe.
In #176 we added functionality to access the job and its parameters inside of a task. This gives the task the ability to change certain parameters of the job (key for example) which could cause pyzeebe to send a wrong request to the zeebe gateway.
Describe the solution you'd like
Split the functionality of the Job class into two classes:
1 Job: would contain access to the same parameters as the current class, but without the ZeebeAdapter and the ability to send the job status to zeebe. It would also be read-only (like dataclasses's frozen).
2 JobController: would inherit from Job but add the missing capabilities from the previous Job class (set_success_status, set_failure_status and set_error_status)