private static CommandContext modifyContextForIntenralJob(
     CommandContext returnedContext, EngineLock lock) {
   return returnedContext
       .withExecutionContext(createMonitoredExecutionContext())
       .withLock(lock)
       .withoutCompensationContext();
 }
 public static void setExecutionContextForTasks(
     CommandContext commandContext, ExecutionContext executionContext, EngineLock lock) {
   commandContext
       .withExecutionContext(createDefaultContextForTasksImpl(executionContext))
       .withLock(lock);
 }
 /**
  * Creates a default execution context for an inner command which creates VDSM tasks so the tasks
  * will be monitored under the parent {@code StepEnum.EXECUTING} step. If the parent command is an
  * internal command, its parent task step is passed to its internal command.
  *
  * @param parentExecutionContext The context of the parent command
  * @param lock The lock which should be released at child command
  * @return A context by which the internal command should be monitored.
  */
 public static CommandContext createDefaultContextForTasks(
     CommandContext commandContext, EngineLock lock) {
   CommandContext result = commandContext.clone().withLock(lock).withoutCompensationContext();
   return result.withExecutionContext(
       createDefaultContextForTasksImpl(result.getExecutionContext()));
 }