This module contains a helper class for associating job state within a particular session. The JobState class holds references to a JobDefinition and JobResult as well as a list of inhibitors that prevent the job from being runnable in a particular session.
Class representing the cause of a job not being ready to execute.
It is intended to be consumed by UI layers and to provide them with enough information to render informative error messages or other visual feedback that will aid the user in understanding why a job cannot be started.
There are four possible not ready causes:
- UNDESIRED:
- This job was not selected to run in this session
- PENDING_DEP:
- This job depends on another job which was not started yet
- FAILED_DEP:
- This job depends on another job which was started and failed
- PENDING_RESOURCE:
- This job has a resource requirement expression that uses a resource produced by another job which was not started yet
- FAILED_RESOURCE:
- This job has a resource requirement that evaluated to a false value
All causes apart from UNDESIRED use the related_job property to encode a job that is related to the problem. The PENDING_RESOURCE and FAILED_RESOURCE causes also store related_expression that describes the relevant requirement expression.
There are three attributes that can be accessed:
- cause:
- Encodes the reason why a job is not ready, see above.
- related_job:
- Provides additional context for the problem. This is not the job that is affected, rather, the job that is causing the problem.
- related_expression:
- Provides additional context for the problem caused by a failing resource expression.
Class representing the state of a job in a session.
Contains two basic properties of each job:
- the readiness_inhibitor_list that prevent the job form starting
- the result (outcome) of the run (IJobResult)
For convenience (to SessionState implementation) it also has a reference to the job itself. This class is a pure state holder an will typically collaborate with the SessionState class and the UI layer.
Get a human readable description of the current readiness state
the list of readiness inhibitors of the associated job
the result of running the associated job