final ResourceTransformationDescriptionBuilder subsystemRoot200 = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
//Versions < 3.0.0 is not able to handle commit-markable-resource
subsystemRoot200.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE);
final ModelVersion version200 = ModelVersion.create(2, 0, 0);
final TransformationDescription description200 = subsystemRoot200.build();
TransformationDescription.Tools.register(description200, subsystem, version200);
final ResourceTransformationDescriptionBuilder subsystemRoot = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
//Versions < 1.3.0 assume 'true' for the hornetq-store-enable-async-io attribute (in which case it will look for the native libs
//and enable async io if found. The default value if not defined is 'false' though. This should only be rejected if use-hornetq-store is not false.
subsystemRoot.getAttributeBuilder()
.setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)),
TransactionSubsystemRootResourceDefinition.HORNETQ_STORE_ENABLE_ASYNC_IO)
.addRejectCheck(RejectHornetQStoreAsyncIOChecker.INSTANCE, TransactionSubsystemRootResourceDefinition.HORNETQ_STORE_ENABLE_ASYNC_IO)
// Legacy name for enabling/disabling statistics
.addRename(TransactionSubsystemRootResourceDefinition.STATISTICS_ENABLED, CommonAttributes.ENABLE_STATISTICS)
//Before 2.0.0 this value was not nillable in practise. Set it to 'false' if undefined.
.setValueConverter(ProcessIdUuidConverter.INSTANCE, TransactionSubsystemRootResourceDefinition.PROCESS_ID_UUID);
subsystemRoot.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE);
final ModelVersion version120 = ModelVersion.create(1, 2, 0);
final TransformationDescription description120 = subsystemRoot.build();
TransformationDescription.Tools.register(description120, subsystem, version120);
subsystemRoot.getAttributeBuilder()
.setDiscard(UnneededJDBCStoreChecker.INSTANCE, TransactionSubsystemRootResourceDefinition.attributes_1_2)
.addRejectCheck(RejectAttributeChecker.DEFINED, TransactionSubsystemRootResourceDefinition.attributes_1_2);
// Transformations to the 1.1.1 Model:
// 1) Remove JDBC store attributes if not used
// 2) Fail if new attributes are set (and not removed by step 1)
// Reuse the builder and add reject expression for 1.1.1
subsystemRoot.getAttributeBuilder()
.addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, TransactionSubsystemRootResourceDefinition.ATTRIBUTES_WITH_EXPRESSIONS_AFTER_1_1_1);
subsystemRoot.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE);
final ModelVersion version111 = ModelVersion.create(1, 1, 1);
final TransformationDescription description111 = subsystemRoot.build();
TransformationDescription.Tools.register(description111, subsystem, version111);
// Transformations to the 1.1.0 Model:
// 1) Remove JDBC store attributes if not used
// 2) Fail if new attributes are set (and not removed by step 1)
// 3) Reject expressions
final ModelVersion version110 = ModelVersion.create(1, 1, 0);
subsystemRoot.getAttributeBuilder()
.addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, TransactionSubsystemRootResourceDefinition.ATTRIBUTES_WITH_EXPRESSIONS_AFTER_1_1_0);
final TransformationDescription description110 = subsystemRoot.build();