Bridging Microsoft Oslo and Eclipse EMF

Last semester we held a seminar about Model-Driven Software Development. One of the topics was the bridging of Microsoft Oslo and the Eclipse Modeling Framework. You can read a solution of this bridging problem in Stanley’s seminar paper which I have supervised. A further bridging approach between Oslo and EMF is described in an article from the AtlanMod research group.

GODYO P/4plus im Integrationslabor

Durch die Kooperation mit der Godyo Business Solutions AG steht das ERP-/PPS System Godyo P/4 plus für Untersuchungen im Integrationslabor zur Verfügung. Das ERP-System ist fast vollständig Oracle basiert. Der Anwendungskern besteht bis auf den Client vollständig aus Stored Procedures. Im Rahmen von EFIE wird ein Integrationsszenario mit einem E-Procurement System untersucht. Dabei kommt Apache OfBiz zum Einsatz. Es ist geplant verschiedene Integrationsmethoden mit verschiedenen Integrationshilfsmitteln auszuprobieren. Neben einer einfachen Punkt zu Punkt Verbindung werden auch andere Topologien (Hub-and-Spoke) erprobt, die mit Hilfe eines Enterprise Service Bus und Middleware-Produkten umgesetzt werden.

Nähere Informationen zu den Systemen finden Sie hier: ERP System, Apache Of Biz

From MetaEdit+ to Microsoft Visio via Eclipse EMF

This article is the counterpart of the article “From Microsoft Visio to MetaEdit+ via Eclipse EMF” and shows the export of MetaEdit+ models into Microsoft Visio. Our solution components are the same as in the first article. We use the MetaEdit-EMF-Bridge and the Visio-EMF-Bridge in order to transform the two language definitions into Ecore models (metaedit_epc.ecore and visio_epc.ecore). Based on these Ecore models, we can define a migration that transforms metaedit_epc.ecore into visio_epc.ecore. Afterwards, we can import with the MetaEdit-EMF-Bridge a MetaEdit model (metaedit_epc_model.xmi). This MetaEdit-EMF model is the input of the migration that creates a Visio-EMF model (visio_epc_model.xmi). Finally, we can import this Visio-EMF model with the Visio-EMF-Bridge into Visio (see screencast: From MetaEdit+ to Visio).

Language Migration

We use ETL/EOL from Epsilon as transformation language. The script can also be divided into two parts. The first part contains language-independent rules that transform a MetaEdit project into a Visio document and a MetaEdit graph into a Visio page. The operation sets the position of a Visio shape and the post processing step transforms the different coordinate systems.

rule Project2Document
	transform project : MetaEdit!Me_Project
  	to document : Visio!EVisioDocument
  	{
  		document.visioPages := project.me_containGraphs.equivalent();
  	}
 
@abstract
rule Graph2Page
	transform graph : MetaEdit!Me_Graph
	to page : Visio!EVisioPage
	{
		page.visioContainedShapes := graph.me_referenceObjects.equivalent();
		page.visioContainedShapes.addAll(graph.me_referenceRelationships.equivalent());
	}
 
@abstract
rule Shape
	transform object : MetaEdit!Me_Object
	to shape : Visio!EVisioShape
	{
		var position := MetaEdit!Me_Symbol.allInstances()
		.select(e | e.me_refObject = object).first().me_position;
		shape.setPosition(position);
	}
 
operation Visio!EVisioShape setPosition(position : String) : Integer {
 
	var x := position.split(",").first();
	var y := position.split(",").last();
 
	var shapeSheet := new Visio!EVisioShapeSheet;
	var section := new Visio!EVisioSection;
	section.visioName := 'visSectionObject';
	var row := new Visio!EVisioRow;
	row.visioName := '1';
	var xCell := new Visio!EVisioCell;
	xCell.visioName := 'PinX';
	xCell.visioValue := x;
	var yCell := new Visio!EVisioCell;
	yCell.visioName := 'PinY';
	yCell.visioValue := y;
 
	self.visioShapeSheet := shapeSheet;
	shapeSheet.visioSections.add(section);
	section.visioRows.add(row);
	row.visioCells.add(xCell);
	row.visioCells.add(yCell);
}
 
post CoordinateTransformation {
 
	for (pinY : Visio!EVisioCell in Visio!EVisioCell.allInstances.select(e | e.visioName = 'PinY'))
	{
		var y : Real := pinY.visioValue.asReal();
		y := (1150-y)/100;
		pinY.visioValue := y+'';
	}
 
	for (pinX : Visio!EVisioCell in Visio!EVisioCell.allInstances.select(e | e.visioName = 'PinX'))
	{
		var x : Real := pinX.visioValue.asReal();
		x := x/100;
		pinX.visioValue := x+'';
	}
}

The second part of the script is the language-dependent part that maps the different language types. For instance, we map MetaEditEvent to VisioEvent, MetaEditFunction to VisioFunction and so on.

---------------------
-- EPC-Transformation
---------------------
rule MetaEditEpc2VisioEpc
	transform graph : MetaEdit!Event_Driven_Process_Chain_3395083925
	to page : Visio!EVisioPage
	extends Graph2Page
	{
		page.visioName := graph.Name;
	}
 
rule EditEvent2VisioEvent
	transform object : MetaEdit!Event_3395083771
	to shape : Visio!Ereignis
	extends Shape
	{
		shape.visioText := object.Name;
	}
 
rule EditFunction2VisioFunction
	transform object : MetaEdit!Function_3395083784
	to shape : Visio!Funktion
	extends Shape
	{
		shape.visioText := object.Name;
	}
 
rule EditXOR2VisioXOR
	transform object : MetaEdit!XOR_3395083733
	to shape : Visio!XOR
	extends Shape
	{
	}
 
rule EditOR2VisioOR
	transform object : MetaEdit!OR_3395083742
	to shape : Visio!OR
	extends Shape
	{
	} 
 
rule EditAND2VisioAND
	transform object : MetaEdit!AND_3395083748
	to shape : Visio!AND
	extends Shape
	{
	}	
 
rule MetaEditArc2VisioConnection
	transform relation : MetaEdit!Arc_3395083800
	to shape : Visio!Dynamischer_Verbinder
	{
		for(role : MetaEdit!Me_Role in relation.me_role) {
			if(role.isTypeOf(MetaEdit!To_3395083810))
				shape.visioTargetShape := role.me_object.equivalent();
			if(role.isTypeOf(MetaEdit!From_3395083804))
				shape.visioSourceShape := role.me_object.equivalent();
		}
	}

Download

From Microsoft Visio to MetaEdit+ via Eclipse EMF

The approach of M3-Level-based Bridges (M3B) is very powerful to achieve interoperability between modeling tools.  In this article we want present a further interesting M3B application that allows the import of Visio models into MetaEdit+.

Our solution uses the following tools/components:

The import of Visio models works as follows. First, we need corresponding language definitions in both tools. In this article, we use as example the EPC language that is already available in Visio (as a default stencil) and MetaEdit+ (see this article “Processing of MetaEdit+ Models with oAW“). These two language definitions are transformed with the help of the two M3Bs into Ecore models (visio_epc.ecore and metaedit_epc.ecore). Based on these Ecore models, we can define a migration (model-to-model transformation) that transforms visio_epc.ecore into metaedit_epc.ecore. Now, we can import with the Visio-EMF-Bridge a Visio model (visio_epc_model.xmi). This Visio-EMF model is the input of the migration that creates a MetaEdit-EMF model (metaedit_epc_model.xmi). Finally, we can import this MetaEdit-EMF model with the MetaEdit-EMF-Bridge into MetaEdit+. The complete process is shown in the following screencast: From Visio to MetaEdit+.

Language Migration

The actual work to import Visio models lies in the definition of the transformation between visio_epc.ecore and metaedit_epc.ecore. Hence, we want to talk about this transformation.  We use as transformation language ETL/EOL from Epsilon (Other EMF-based transformation tools, such as ATL or oAW, are also possible.) The script can be divided into two parts. The first part contains language-independent rules that transform a Visio document into a MetaEdit project and a Visio page into a MetaEdit graph with corresponding diagram. The both operations select the position of a Visio shape and the post processing step transforms the different coordinate systems.

rule Document2Project
	transform document : Visio!EVisioDocument
  	to project : MetaEdit!Me_Project
  	{
  		project.me_containGraphs := document.visioPages.equivalent();
  		project.me_containObjects := MetaEdit!Me_Object.allInstances();
  		project.me_containRelationships := MetaEdit!Me_Relationship.allInstances();
  		project.me_containRoles := MetaEdit!Me_Role.allInstances();
  	}
 
@abstract
rule Page2Graph
	transform page : Visio!EVisioPage
	to graph : MetaEdit!Me_Graph
	{
		var diagram := new MetaEdit!Me_Diagram;
		graph.me_containDiagrams.add(diagram);
 
		var simpleShapes := page.visioContainedShapes->select(e | not e.isKindOf(Visio!EVisioConnectionShape));
		graph.me_referenceObjects := simpleShapes.equivalent();
		for (shape : Visio!EVisioShape in simpleShapes) {
			var symbol := new MetaEdit!Me_Symbol;
			diagram.me_containSymbols.add(symbol);
			symbol.me_refObject := shape.equivalent();
			symbol.me_position := shape.getPinX()+','+shape.getPinY();
		}
 
		var conShapes := page.visioContainedShapes->select(e | e.isKindOf(Visio!EVisioConnectionShape));
		graph.me_referenceRelationships := conShapes.equivalent().select(e | e.isKindOf(MetaEdit!Me_Relationship));
		graph.me_referenceRoles := conShapes.equivalent().select(e | e.isKindOf(MetaEdit!Me_Role));
 
	}	
 
operation Visio!EVisioShape getPinX() : Integer {
	return self.visioShapeSheet
		.visioSections.select(e | e.visioName = 'visSectionObject').first()
		.visioRows.select(e | e.visioName = '1').first()
		.visioCells.select(e | e.visioName = 'PinX').first()
		.visioValue.asReal();
}
 
operation Visio!EVisioShape getPinY() : Integer {
	return self.visioShapeSheet
		.visioSections.select(e | e.visioName = 'visSectionObject').first()
		.visioRows.select(e | e.visioName = '1').first()
		.visioCells.select(e | e.visioName = 'PinY').first()
		.visioValue.asReal();
}
 
post CoordinateTransformation {
 
	var ymax : Real := MetaEdit!Me_Symbol.allInstances.sortBy(e|e.me_position.split(',').last())
		.last().me_position.split(',').last().asReal();
 
	for (symbol : MetaEdit!Me_Symbol in MetaEdit!Me_Symbol.allInstances) {
		var x : Real := symbol.me_position.split(',').first().asReal();
		var y : Real := symbol.me_position.split(',').last().asReal();
 
		x := x*100;
		y := (ymax*120+20)-y*100;
 
		symbol.me_position := x.asInteger() + ',' + y.asInteger();
	}
}

The second part of the script is more interesting than the first one, because this is the language-dependent part that maps the different language types. For instance, we map VisioEvent to MetaEditEvent, VisioFunction to MetaEditFunction and so on. These rules are very easy and that is what we want. We hide the complexity of tool interfaces, thus, we are able to concentrate on the language migration.

---------------------
-- EPC-Transformation
---------------------
rule VisioEpc2MetaEditEpc
	transform page : Visio!EVisioPage
	to graph : MetaEdit!Event_Driven_Process_Chain_3395083925
	extends Page2Graph
	{
		graph.Name := page.visioName;
	}
 
rule VisioEvent2MetaEditEvent
	transform shape : Visio!Ereignis
	to object : MetaEdit!Event_3395083771
	{
		object.Name := shape.visioText;
	}
 
rule VisioFunction2MetaEditFunction
	transform shape : Visio!Funktion
	to object : MetaEdit!Function_3395083784
	{
		object.Name := shape.visioText;
	}
 
rule VisioXOR2MetaEditXOR
	transform shape : Visio!XOR
	to object : MetaEdit!XOR_3395083733 {}
 
rule VisioOR2MetaEditOR
	transform shape : Visio!OR
	to object : MetaEdit!OR_3395083742 {}
 
rule VisioAND2MetaEditAND
	transform shape : Visio!AND
	to object : MetaEdit!AND_3395083748 {}
 
rule VisioConnection2MetaEditArc
	transform shape : Visio!Dynamischer_Verbinder
	to relation : MetaEdit!Arc_3395083800,
	fromRole : MetaEdit!From_3395083804,
	toRole : MetaEdit!To_3395083810
	{
		relation.me_role.add(fromRole);
		relation.me_role.add(toRole);
		fromRole.me_object := shape.visioSourceShape.equivalent();
		toRole.me_object := shape.visioTargetShape.equivalent();
	}

Download

bflow* Toolbox 1.0.0

Recently, we released a new version of our bflow* toolbox on Sourceforge. This new version of our Business Process Modeling tool offers many improvements and novel features in relation to the old version. In this article, we will present some of these functions.

Live Validation

A special feature in bflow* is the support of validation during the modeling. Through this approach, the models achieve a high quality because the modeler can see errors immediately and also  correct these errors immediately.  The extension of the rule set is very easy. You can write your own rules in oAW XCheck or Eclipse Epsilon. Furthermore, you can select rules that should be validated during modeling. An illustration of this feature, you see in, the following screenshot, an oEPC model with an error that was detected by validation rule. The dialog shows the selection possibility of rules.

Validation of an oEPC in bflow

Validation of an oEPC in bflow

Selection of Validation Rules in bflow

Selection of Validation Rules in bflow

Transformation: oEPCs-to-UML Class Diagrams

Bflow* supports the modeling language Object-Oriented Event-Driven Process Chains (oEPC). This modeling language allows a very compact and understandable presentation of administration processes. The central concept of oEPC is the Business Object that equals a form with corresponding form data and tasks. Based on these oEPCs, we can generate UML Class Diagrams that allows a more technical view of this process. These UML Class Diagrams can be a starting point for code generation. The following screenshot shows a UML Class Diagram that was transformed from the oEPC model (screenshot above). As transformation system, we use oAW XTend.

UML Class Diagram

UML Class Diagram

Import and Export of Models

From our point of view, the interoperability with other tools is an important requirement. A high degree of interoperability with other tools has some advantages such as: the (re-)use of already existing functionality, the building of tool chains, or the export of models in other tools as backup. Currently, we support the following formats:

  • Export of EPCs: SemTalk-EPML, EPC Tools-EPML, Oryx-EPML, Oryx-RDF, Prolog, AML, YAWL, Microsoft Visio (EPC stencil)
  • Export of oEPCs: oEPML, Microsoft Visio (oEPC stencil)
  • Import of oEPCs: Microsoft Visio (oEPC stencil)
bflow-oEPC in Microsoft Visio

bflow-oEPC in Microsoft Visio

Acknowledgment

Finally, we want to thank our students who supported us with the development of bflow*. Thanks to Jörg Hartman, who mainly worked on the oEPC editor, the validation approach, and the UML transformation. Thanks to Christian Böhme who mainly worked on the import and export of oEPCs. — Stefan Kühne and Heiko Kern