Source:
private void registerTransformers(SubsystemRegistration subsystem) { ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance(); builder.getAttributeBuilder() .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), WeldResourceDefinition.NON_PORTABLE_MODE_ATTRIBUTE, WeldResourceDefinition.REQUIRE_BEAN_DESCRIPTOR_ATTRIBUTE) .addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() { @Override public String getRejectionLogMessage(Map<String, ModelNode> attributes) { return WeldLogger.ROOT_LOGGER.rejectAttributesMustBeTrue(attributes.keySet()); } @Override protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return !attributeValue.isDefined() || !attributeValue.asString().equals("true"); } }, WeldResourceDefinition.NON_PORTABLE_MODE_ATTRIBUTE, WeldResourceDefinition.REQUIRE_BEAN_DESCRIPTOR_ATTRIBUTE) .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), WeldResourceDefinition.DEVELOPMENT_MODE_ATTRIBUTE) .addRejectCheck(RejectAttributeChecker.DEFINED, WeldResourceDefinition.DEVELOPMENT_MODE_ATTRIBUTE) .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(WeldExecutorServices.DEFAULT_BOUND)), WeldResourceDefinition.THREAD_POOL_SIZE_ATTRIBUTE) .addRejectCheck(RejectAttributeChecker.DEFINED, WeldResourceDefinition.THREAD_POOL_SIZE_ATTRIBUTE) .end(); TransformationDescription.Tools.register(builder.build(), subsystem, ModelVersion.create(1, 0, 0)); }

Target:
private void registerTransformers(SubsystemRegistration subsystem) { ModelVersion version1_0_0 = ModelVersion.create(1, 0, 0); ModelVersion version3_0_0 = ModelVersion.create(3, 0, 0); ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory .createChainedSubystemInstance(subsystem.getSubsystemVersion()); ResourceTransformationDescriptionBuilder builder300 = chainedBuilder.createBuilder(subsystem.getSubsystemVersion(), version3_0_0); builder300.getAttributeBuilder().setDiscard(DiscardAttributeChecker.UNDEFINED, WeldResourceDefinition.THREAD_POOL_SIZE_ATTRIBUTE) .addRejectCheck(RejectAttributeChecker.DEFINED, WeldResourceDefinition.THREAD_POOL_SIZE_ATTRIBUTE).end(); ResourceTransformationDescriptionBuilder builder100 = chainedBuilder.createBuilder(version3_0_0, version1_0_0); builder100.getAttributeBuilder() .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)), WeldResourceDefinition.NON_PORTABLE_MODE_ATTRIBUTE, WeldResourceDefinition.REQUIRE_BEAN_DESCRIPTOR_ATTRIBUTE) .addRejectCheck(new RejectAttributeChecker.DefaultRejectAttributeChecker() { @Override public String getRejectionLogMessage(Map<String, ModelNode> attributes) { return WeldLogger.ROOT_LOGGER.rejectAttributesMustBeTrue(attributes.keySet()); } @Override protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return !attributeValue.isDefined() || !attributeValue.asString().equals("true"); } }, WeldResourceDefinition.NON_PORTABLE_MODE_ATTRIBUTE, WeldResourceDefinition.REQUIRE_BEAN_DESCRIPTOR_ATTRIBUTE) .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), WeldResourceDefinition.DEVELOPMENT_MODE_ATTRIBUTE) .addRejectCheck(RejectAttributeChecker.DEFINED, WeldResourceDefinition.DEVELOPMENT_MODE_ATTRIBUTE).end(); chainedBuilder.buildAndRegister(subsystem, new ModelVersion[] { version1_0_0, version3_0_0 }); }