private void countDownChildren(RootProcedureState<TEnvironment> procStack,
    Procedure<TEnvironment> procedure) {
    Procedure<TEnvironment> parent = procedures.get(procedure.getParentProcId());
    if (parent == null) {
      assert procStack.isRollingback();
      return;
    }

    // If this procedure is the last child awake the parent procedure
    if (parent.tryRunnable()) {
      // If we succeeded in making the parent runnable -- i.e. all of its
      // children have completed, move parent to front of the queue.
      store.update(parent);
      scheduler.addFront(parent);
      LOG.info("Finished subprocedure pid={}, resume processing ppid={}", procedure.getProcId(),
        parent.getProcId());
      return;
    }
  }
Executes <code>procedure</code>
<ul>
<li>Calls the doExecute() of the procedure
<li>If the procedure execution didn't fail (i.e. valid user input)
<ul>
<li>...and returned subprocedures
<ul>
<li>The subprocedures are initialized.
<li>The subprocedures are added to the store
<li>The subprocedures are added to the runnable queue
<li>The procedure is now in a WAITING state, waiting for the subprocedures to complete
</ul>
</li>
<li>...if there are no subprocedure
<ul>
<li>the procedure completed successfully
<li>if there is a parent (WAITING)
<li>the parent state will be set to RUNNABLE
</ul>
</li>
</ul>
</li>
<li>In case of failure
<ul>
<li>The store is updated with the new state</li>
<li>The executor (caller of this method) will start the rollback of the procedure</li>
</ul>
</li>
</ul>
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java