Class BmCompoundTask

java.lang.Object
com._1c.g5.v8.bm.integration.AbstractBmTask<List<Object>>
com._1c.g5.v8.bm.integration.BmCompoundTask
All Implemented Interfaces:
IBmTask<List<Object>>

public class BmCompoundTask extends AbstractBmTask<List<Object>>
A task that comprises a sequence of subtasks.
  • Constructor Details

    • BmCompoundTask

      public BmCompoundTask(List<IBmTask<?>> children)
      Craetes a new compound task without task name, task name is null
      Parameters:
      children - a sequence of subtasks
    • BmCompoundTask

      public BmCompoundTask(String name)
      Creates a new compound task with name
      Parameters:
      name - name of task
    • BmCompoundTask

      public BmCompoundTask(String name, List<IBmTask<?>> children)
      Creates a new compound task
      Parameters:
      name - name of task
      children - a sequence of subtasks
  • Method Details

    • getName

      public String getName()
      Description copied from interface: IBmTask
      Gets the localized name of the task to be displayed on the UI, logs, etc.
      Specified by:
      getName in interface IBmTask<List<Object>>
      Overrides:
      getName in class AbstractBmTask<List<Object>>
      Returns:
      the name of the task, never null.
    • execute

      public List<Object> execute(IBmTransaction transaction, org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from interface: IBmTask

      The method called by the task executor with an active transaction. The method code must not commit or rollback the transaction.

      If the task is not supposed to return a result, then it may be parameterized with Void and return null.

      Parameters:
      transaction - The active transaction. May not be null.
      monitor - The monitor to indicate the progress. May not be null.
      Returns:
      execution result, may be null.
    • append

      public void append(IBmTask<?> child)
      Adds a task to this compound task's list of tasks.
      Parameters:
      child - the bm task to append.
    • size

      public int size()
      Queries the number of child tasks that contain in this object.
      Returns:
      the size of children tasks
    • unwrap

      public IBmTask<?> unwrap()
      Returns one of two things: the one task, if there is exactly one task or this if there are multiple command.
      Returns:
      the unwrapped task.
    • getSubTasks

      public List<IBmTask<?>> getSubTasks()
      Gets subtasks of this task
      Returns:
      collection of the subtasks, never null