How to set a value to a variable in a sequencer from sequence's task body()

Hi everyone! I’m a beginner in UVM. Googled to find the solution for my question but still finding difficult to understand the concept. So finally am here to seek the help…
And here is the question:

I had encountered a question very recently that how to set a value to a variable in sequencer, from Sequence’s task body(). The hierarchy of the components in a test is fine for me ie; setting a value to a variable in driver from test goes like this env.agent.driver.variable = “value” and that can be done by uvm_config_db#()::set and get methods as well…
How is the sequence_item, sequence, sequencer hierarchy ? and reverse too…

In reply to Zara:

The correct answer is that you don’t set any variables in a sequencer from anywhere. A sequencer is designed to be used as is with no user modifications.

A sequence is used to generate sequence_items and not do any configuration of the environment. Everything that a sequence needs to generate sequence_items should be set by the test when the sequence is created.

In reply to cgales:

In reply to Zara:
The correct answer is that you don’t set any variables in a sequencer from anywhere. A sequencer is designed to be used as is with no user modifications.
A sequence is used to generate sequence_items and not do any configuration of the environment. Everything that a sequence needs to generate sequence_items should be set by the test when the sequence is created.

Thank you @cgales… And that was a question asked for an exam I recently appeared & I got to know that its someway through m_sequencer, but wasn’t clear with the concept…As you said we won’t usually configure or set variables in any of the test environment from a sequence class but this might be a logical question to find any possible ways are there to do the same…

Similarly another question from my side: Is there any possible way to get the sequencer type (sequencer class name) of a sequence from sequence. I know that sequencer for a particular sequence will be defined in the test, then what’s these methods get_sequencer, get_parent_sequence are used for?

Regards