Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 2.54 KB

aware-interfaces.md

File metadata and controls

56 lines (38 loc) · 2.54 KB

*Aware interfaces

When a job execution starts, a JobExecution is created for it. This object contains information about the current execution.

You will often want to access this object or one of its child to :

  • access provided user parameters in your components
  • leave some information on the job execution: logs, summary, warning...

To do that, your component will need to implement an interface, telling the library that you need something.

What is JobExecutionAwareInterface ?

The JobExecutionAwareInterface will allow you to gain access to the current JobExecution.

note: this interface is covered by JobExecutionAwareTrait for a default implementation that is most of the time sufficient.

What is JobParametersAwareInterface ?

The JobParametersAwareInterface will allow you to gain access to the JobParameters of the current execution.

note: this interface is covered by JobParametersAwareTrait for a default implementation that is most of the time sufficient.

What is SummaryAwareInterface ?

The SummaryAwareInterface will allow you to gain access to the Summary of the current execution.

note: this interface is covered by SummaryAwareTrait for a default implementation that is most of the time sufficient.

How does that work exactly ?

There is no magic involved here, every component is responsible for propagating the context through these interfaces.

In the library, you will find that :

You can add this interface to any class, but you are responsible for the context propagation.

On the same subject