}
@SuppressWarnings("unchecked")
public boolean evaluate(String expression) {
// Create security model
SecurityModel model = uamFactory.createSecurityModel();
model.setName("com_security");
// Create permission with region attribute
Permission permission = uamFactory.createPermission();
permission.setName("TestPermission");
EAttribute permRegionAttr = getRegionAttr();
permission.getEStructuralFeatures().add(permRegionAttr);
Constraint constraint = uamFactory.createConstraint();
permission.setConstraint(constraint);
constraint.setExpession(expression);
model.getEClassifiers().add(permission);
// Create protected object with region attribute
PObject pObject = uamFactory.createPObject();
pObject.setName("TestProtectedObject");
EAttribute pObjectRegionAttr = getRegionAttr();
pObject.getEStructuralFeatures().add(pObjectRegionAttr);
pObject.getPermission().add(permission);
// permission.setPObject(pObject);
// EMFUtil.addPobject(permission, pObject);
model.getEClassifiers().add(pObject);
// create operation
POperation operation = UamFactory.eINSTANCE.createPOperation();
operation.setName("TestOperation");
pObject.getEOperations().add(operation);
// Create role
Role role = uamFactory.createRole();
role.setName("TestRole");
EReference permissionRef = EMFUtil.addPermission(role, permission);
model.getEClassifiers().add(role);
// get factory to create instances
EFactory instanceFactory = model.getEFactoryInstance();
// Create PObject instance
EObject pObjectInstance = instanceFactory.create(pObject);
pObjectInstance.eSet(pObjectRegionAttr, "EU");