Class BmCompoundTask

    • Constructor Detail

      • 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 Detail

      • 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