Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2865

AttributeTransformationRule "ignored" if op is discarded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.0.0.Final
    • 8.0.0.CR1
    • Management
    • None

      Imagine a scenario like the following:

      ```
      parent.addChildResource(RemotingEndpointResource.ENDPOINT_PATH)
      .getAttributeBuilder()
      .setDiscard(DiscardAttributeChecker.UNDEFINED, RemotingEndpointResource.ATTRIBUTES)
      .addRejectCheck(RejectAttributeChecker.DEFINED, RemotingEndpointResource.ATTRIBUTES.toArray(new AttributeDefinition[RemotingEndpointResource.ATTRIBUTES.size()]))
      .end() .addOperationTransformationOverride(ModelDescriptionConstants.ADD)
      .inheritResourceAttributeDefinitions() .setCustomOperationTransformer(OperationTransformer.DISCARD)
      .end()
      ```

      The idea is to discard "add" if any parameter is defined, reject otherwise. The legacy slave can ignore the whole resource if it isn't really configured by the user, but any detail config by the user must result in failure.

      Problem is AttributeTransformationRule will do a "reject" when it gets a prepared response from the slave, but using setCustomOperationTransformer(OperationTransformer.DISCARD) means the op will be discarded, so there will be no prepared response and thus no rejection.

      Solution is to have AttributeTransformationRule register a OperationResultTransformer that deals with this situation.

              bstansbe@redhat.com Brian Stansberry
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: