In order to perform the test for the instructions, we use the next input metamodel
Also we use the next input model
In the execution of the next assistance script:
import library.attributeServices.AddAttribute; evolution myEvolutionProgram{ fromMM:"./models/mm3.ecore" toMM:"mm3_evolved1.ecore" "http://uniandes.edu.co/exampleMM3_evolved1" toM:"m3_coevolved1.xmi" instruction{ addAttribute attD3{ className=D type=EInt } [EAttributeImpl theAttribute, EClassImpl theClass, EDataTypeImpl theType, ArrayList modelClassInstances] comments{ "Test for adding int attribute" } assistance{ comments{ "Attribute initialization with int value" } AddAttribute.initializeIntValue(theAttribute,modelClassInstances); } assistance{ comments{ "Addition of the other int attributes" } AddAttribute.additionIntValue(theAttribute,theClass,theType,modelClassInstances); } assistance{ comments{ "Multiplication of the other int attributes" } AddAttribute.multiplicationIntValue(theAttribute,theClass,theType,modelClassInstances); } } instruction{ addAttribute attG2{ className=G type=EString } [EAttributeImpl theAttribute, EClassImpl theClass, EDataTypeImpl theType, ArrayList modelClassInstances] comments{ "Test for adding String attribute" } assistance{ comments{ "Attribute initialization with String value" } AddAttribute.initializeStringValue(theAttribute,modelClassInstances); } assistance{ comments{ "Attribute initialization with String default value" } AddAttribute.initializeStringDefaultValue(theAttribute,modelClassInstances); } } }
For the first instruction ASIMOV presents the next wizard. With this wizard, the modeler can select one assistance to apply on several selected instances.
Once the assistance has been processed, the selected instance are removed from the wizard. Once all instances have been removed from the wizard, the modeler can finish the process.
For the second instruction ASIMOV presents the next wizard.
In the execution of the next assistance script:
import library.attributeServices.ModifyTypeOfAttribute; evolution myEvolutionProgram{ fromMM:"./models/mm3.ecore" toMM:"mm3_evolved1.ecore" "http://uniandes.edu.co/exampleMM3_evolved1" toM:"m3_coevolved1.xmi" instruction{ modifyTypeOfAttribute B.attB2{ type=EString } [EAttributeImpl theAttribute, EClassImpl theClass, EDataTypeImpl theType, ArrayList modelClassInstances, ArrayList previousVersionAttributeValues] comments{ "Test for modifying type of attribute" } assistance{ comments{ "Attribute initialization with String value" } ModifyTypeOfAttribute.initializeStringValue(theAttribute,modelClassInstances); } assistance{ comments{ "Attribute initialization with String default value" } ModifyTypeOfAttribute.initializeStringDefaultValue(theAttribute,modelClassInstances); } assistance{ comments{ "Casting the attribute value" } ModifyTypeOfAttribute.castingAttributeValue(theAttribute,modelClassInstances,previousVersionAttributeValues); } } instruction{ modifyTypeOfAttribute H.attH2{ type=EInt } [EAttributeImpl theAttribute, EClassImpl theClass, EDataTypeImpl theType, ArrayList modelClassInstances, ArrayList previousVersionAttributeValues] comments{ "Test for modifying type of attribute" } assistance{ comments{ "Attribute initialization with int value" } ModifyTypeOfAttribute.initializeIntValue(theAttribute,modelClassInstances); } assistance{ comments{ "Attribute initialization with int default value" } ModifyTypeOfAttribute.initializeIntDefaultValue(theAttribute,modelClassInstances); } } }
For the first instruction ASIMOV presents the next wizard. With this wizard, the modeler can select one assistance to apply on several selected instances.
Once the assistance has been processed, the selected instance are removed from the wizard. Once all instances have been removed from the wizard, the modeler can finish the process.
For the second instruction ASIMOV presents the next wizard.
An EnAr-ASIMOV Execution could generate the following controlled errors: