Class AbstractMdObjectCollectionTask<P1 extends MdObject,P2 extends MdObject>

java.lang.Object
com._1c.g5.v8.bm.integration.AbstractBmTask<org.eclipse.core.runtime.IStatus>
com._1c.g5.v8.bm.integration.BmBasicTask
com._1c.g5.v8.bm.integration.BmBasicTask2Collection<P1,P2>
com._1c.g5.v8.dt.md.api.AbstractMdObjectCollectionTask<P1,P2>
All Implemented Interfaces:
IBmTask<org.eclipse.core.runtime.IStatus>
Direct Known Subclasses:
BasicDbObjectBasedOnTask, DocumentInJournalsTask, DocumentInSequncesTask, DocumentJournalRegisteredDocumentsTask, DocumentRegisterRecordsTask

public abstract class AbstractMdObjectCollectionTask<P1 extends MdObject,P2 extends MdObject> extends BmBasicTask2Collection<P1,P2>
An IBmTask abstract implementation for working with MdObject collections.
  • Constructor Details

    • AbstractMdObjectCollectionTask

      protected AbstractMdObjectCollectionTask(P1 object, Collection<P2> objects, String template)
      Instantiates a new IBmTask successor. Builds name of the task using {@linkplain AbstractMdObjectCollectionTask# getName(MdObject, Collection, String) getName()} method and the given template.
      Parameters:
      object - is the object
      objects - is the collection of objects
      template - is the template message. It can include "{0}" and "{1}" symbols to insert object and objects string representation respectively
  • Method Details

    • execute

      public org.eclipse.core.runtime.IStatus execute(P1 object, Collection<P2> objects, org.eclipse.core.runtime.IProgressMonitor monitor)
      Encapsulates custom action declared in doExecute() with right way error handling.
      Specified by:
      execute in class BmBasicTask2Collection<P1 extends MdObject,P2 extends MdObject>
      Parameters:
      object - is the object
      objects - is the collection of objects
      monitor - is the progress monitor
      Returns:
      the status of the task
    • doExecute

      protected abstract void doExecute(P1 object, Collection<P2> objects)
      Performs custom action. E.g. addition to collection. Override in successors.
      Parameters:
      object - is the object
      objects - is the collection of objects
    • getName

      protected static String getName(MdObject object, Collection<? extends MdObject> objects, String messageTemplate)
      Returns the name of the task. The name is generated by the given template and MdObjects.
      Parameters:
      object - is the object
      objects - is the collection of objects
      messageTemplate - is the template for name
      Returns:
      task name