We need to get some information about workflow state such as the current interactive task that waits for user input out of Maestro.

We propose to introduce a new hook hook_maestro_pre_task() into MaestroEngineVersion1. The best place to fire this new hook seems to be right at the end of the nextStep() method. Not sure if there might be a better spot somewhere in cleanQueue() but it seems like at that stage tasks already get processed.

The hook would take the Maestro engine and, if set, the next queue record (which contains the "current" task's queue id).

Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larskleiner’s picture

Status: Active » Needs review
FileSize
473 bytes

Patch attached.

_randy’s picture

Looks OK overall. Just a small issue with the name of the hook.

The task in this case has been created in the queue, so it is in fact a post-task-creation hook.

I suggest we call it maestro_post_task_creation

larskleiner’s picture

Agreed, seems like a better name.

_randy’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 87fdcd1 on master, 8.x-1.x authored by larskleiner, committed by _randy:
    Update for Issue #2077089. Adding hook for post task creation.