Operations

An operation reflects a step on an import command like the add-update and combines the necessary functionality like a container.

It allows you to add a custom configuration for an existing operation or to add a new one.

When do I need an operation?

You will need an operation if you want to integrate your custom implementation e.g., based on a plugin, subjects, or observers. A process allows you to combine these classes based on your needs.

In general, you will need an operation when you want to create a new functionality combined out of plugins, subjects, and observers.

How to implement an operation?

An operation can not be implemented as it is a set of plugins that will be executed in the configured order.

Up since version 3.8.0, most operations only have one plugin, as the chaining of operations and the order in which they have to be executed can be defined in the shortcuts.

In general, you can configure a process that matches your requirements, like:

{
  "operations" : {
    "general": {
      "catalog_product": {
        "my-operation": {
          "plugins" : [
            {
              "id": "import.plugin.subject",
              "subjects" : [
                {
                  "id": "my.subject.id",
                  "file-resolver": {
                    "prefix": "my-prefix"
                  }
                }
              ]
            }
          ]
        }
      }
    }
  }
}

The operations have to be defined under the Magento Edition they should be available and the entity type they are dedicated to.

If the Magento Edition is irrelevant, you can use general, otherwise, ce (for the community) or ee (for commerce) are supported values.