title: Drupal 8 / Maestro Module : How to assign task to supervisor?
body: <p>For my need to implement a vacation request validation workflow, I tried the Drupal Maestro workflow manager.</p>
  
  <p>The need being to allow users to create their own requests and assign them to the direct supervisor. this is where I am blocked.</p>
  
  <p>I created a specific module to load the supervisor object and I associated the function to the variable at the assignment task level, but in vain. An error occurs at MaestroEngine when trying to assign the task !</p>
  
  <p>Would you have a complete workflow example which implements this kind of solution ? (assign the task to the initiator's supervisor).</p>
  
  <p><strong>The variable assignment and the function definition :</strong></p>
  
  <pre><code>    &lt;?php
  
      use Drupal\maestro\Engine\MaestroEngine;
      use Drupal\Core\Entity\EntityInterface;
  
      function test_module_get_current_user_supervisor( $currentUser ) {
  
        //$user_n_1 = \Drupal\user\Entity\User::load(\Drupal::currentUser()-&gt;field_n_1());
        $user_n_1 = \Drupal\user\Entity\User::load($currentUser-&gt;field_n_1());
  
        return $user_n_1;
      }
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/CzMsR.png" rel="nofollow noreferrer">Process variable</a></p>
  
  <p>PS: The supervisor is an "Entity Reference" attribute</p>
  
  <p>Thanks in advance,</p>