Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-10460

Fix operation registration when replacing an existing one

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6
    • Fix Version/s: 5.6.0-HF04, 5.7.1
    • Component/s: Automation

      Description

      Registering an operation with an existing ID fails because the attribute replace is not taken into account. For instance, this contribution

      <extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="operations">
          <operation class="org.nuxeo.sample.operation.CreateDocument" replace="true"/>
      </extension>
      

      will raise an error:

      ERROR [org.nuxeo.runtime.model.impl.RegistrationInfoImpl] Failed to register extension to: service:org.nuxeo.ecm.core.operation.OperationServiceComponent, xpoint: operations in component: service:xxx.automationService
      org.nuxeo.ecm.automation.OperationException: An operation is already bound to: Document.Create. Use 'replace=true' to replace an existing operation
              at org.nuxeo.ecm.automation.core.impl.OperationTypeRegistry.addContribution(OperationTypeRegistry.java:53)
              at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.putOperation(OperationServiceImpl.java:172)
              at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.putOperation(OperationServiceImpl.java:167)
              at org.nuxeo.ecm.automation.core.AutomationComponent.registerContribution(AutomationComponent.java:222)
              at org.nuxeo.runtime.model.DefaultComponent.registerExtension(DefaultComponent.java:47)
      

        Attachments

          Activity

            People

            • Assignee:
              tmartins Thierry Martins
              Reporter:
              tmartins Thierry Martins
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: