Load a UML schema with its operations and constraints into our library. E.g. consider the following operations, over the playlist schema persisted in some MySQL database.
Invoke your defined operations using our library. For example, call artistselected(Queen) and buildplaylist().
Our library checks if executing the operation satisfies the constraints, and, if so, it executes its changes in the database. E.g. artistselected(Queen) is executed, but buildplaylist() is not since it violates the constraint stating that each playlist needs at least one track.
We are happy to announce that a new release capable of repairing violations rather than checking them is ready for downloading
The library is able to check any first-order logic constraint when executing of some operation.
Only the constraints that might be violated by the executed operation are examined, and only for the data related to the update.
If two operations might violate a constraint when executed concurrently, their execution is automatically serialized.
The library is capable of executing activities with the goal of repairing constraints
To follow this short demo you only need to install Java, a MySQL database, and download our library and demo project
First, build a SQL schema to persist our playlist conceptual schema. To do so, execute the playlist-demo.sql into your database, and configure the file playlist-db-connection.txt according to your database connection.
//Files storing the schemas, and the database where to store the data of the process File umlSchema = new File("playlist.db"); File behaviourSchema = new File("playlist-behaviour.db"); File dbConnection = new File("connection.txt"); File umlSchemaToDataMap = new File("map.txt"); //Implementing the method to initialize the data DataInitializerFinalizer initFin = new DataInitializerFinalizer(){ @Override public void initData() throws Exception { String sqlStatement=""; sqlStatement+="INSERT INTO `album` VALUES ('Jazz','2015-10-10','Queen'),('A Night At The Opera','2015-10-10','Queen');"; sqlStatement+="INSERT INTO `artist` VALUES ('Queen',1);"; sqlStatement+="INSERT INTO `track` VALUES (1,'Do not stop me now',2,'Jazz',NULL), (1,'Bohemian Rhapsody',2,'A Night At The Opera',NULL),(2,'Bicycle Race',2,'Jazz',NULL);"; SQLDataController sqlDataController = new SQLDataController(dbConnection); sqlDataController.establishConnection(); sqlDataController.executeStatement(sqlStatement); sqlDataController.closeConnection(); } }; //Creating the controller. This method initializes the data according to the previous method Controller controller = new Controller(umlSchema, behaviourSchema, dbConnection, umlSchemaToDataMap, initFin); //Creating the process executor. This method creates the artifact in the database ProcessExecutor processExecutor = controller.createProcessExecutor();
To instantiate the ProcessExecutor class you need to provide 4 files: the UML Schema containing the class diagram and its constraints, the behavioural schema containing the operations, a map between the UML class diagram and the SQL schema, and the DB connection info. In the current version, the first two schemas should be written in logics similarly as defined in [1,2]. In addition, you need to implement the DataInitializer interface to specify how the data in the database should be initialized.
//Invoking the operations throught the process executor. String opName; Object[] arguments; opName = "artistselected"; arguments = new String[]{"Queen"}; processExecutor.executeOperation(opName, arguments); opName = "buildplaylist"; arguments = new String[]{}; processExecutor.executeOperation(opName, arguments);
If your operations satisfy the integrity constraints, they will be persisted in the Database. Otherwise, a ViolationFoundException is thrown.
With the new release, you can instantiate RGDs, i.e., repair-generating dependencies. You can download a code example together all the necessari files here
String operationName; ListparametersMap; operationName = "repairDelManages"; parametersMap = new ArrayList(); parametersMap.add(0); parametersMap.add(1); RGD rgd2 = new NamedBasedRGD(instance, sqlDataController, "rgd2", parametersMap, operationName, null); operationName = "repairInsManages"; parametersMap = new ArrayList(); parametersMap.add(null); parametersMap.add(0); String selectingEmployee = "SELECT id FROM employee WHERE id NOT IN (SELECT id_employee FROM del_Manages)"; RGD rgd6 = new NamedBasedRGD(instance, sqlDataController, "rgd6", parametersMap, operationName, selectingEmployee); rgd2.addPotentialViolator(rgd6); rgd2.execute(); //it executes the changes specified in RGD2, and then, executes the changes specified in RGD6, if needed.
[1] Giuseppe De Giacomo, Xavier Oriol, Montserrat EstaƱol, and Ernest Teniente. "Linking Data and BPMN Processes to Achieve Executable Models." 29th International Conference on Advanced Information Systems Engineering (CAiSE), pp 612-628 (2017)
[2] Queralt, Anna, and Ernest Teniente. "Verification and validation of UML conceptual schemas with OCL constraints." ACM Transactions on Software Engineering and Methodology (TOSEM) 21.2 (2012)
Theme created by BLACKTIE.CO