Community
Participate
Working Groups
I'm opening this "bug" to track the implementation of BPMN validation. The BPMN specification mentions additional constraints besides the abstract syntax provided by the metamodel. These constraints should be implemented for our metamodel, so that models can be checked for validity. The constraints are scattered across the specification and provided in prose ("no Sequence Flow can connect to a Start Event"). Therefore, the implementation will require collecting and formalizing the constraints. I propose that we use EMF's validation delegates to implement the validation (see my next comment).
Created attachment 173761 [details] This patch is a short example of how validation with EMF's new ValidationDelegate concept can be implemented for BPMN. ValidationDelegates were introduced by the Helios release of EMF (see http://wiki.eclipse.org/EMF/New_and_Noteworthy/Helios#Milestone_2) and allow the definition of constraints as annotations directly in Ecore files. No manual implementation is necessary when using the delegates provided by the OCL project. After code regeneration, the validation logic is availabe in generated editors and via the Diagnostician class for standalone usage. An Ecore-Annotation on the BPMN package registers the validation delegate provided by the OCL project. An Ecore-annotation on individual classifiers (here: StartEvent) lists the constraints for that classifier, which are supplied in OCL as details of an OCL-annotation (here: 10_4_2_noSequenceFlowToStartEvent, mentioned in chapter 10.4.2).
So validation is directly part of the ecore ? Interesting.
I think it would be a good idea, to gathered the scattered constraints on a wiki page first. Then, after consensus about those constraints is achieved, they can be implemented using ValidationDelegates. Otherwise we can never be sure that everything is implemented according to the spec.
Hi Benedikt, I agree - we need some intermediate step as the specification does not specify contraints in a formal manner. Using the wiki is probably a good idea. Please note that some discussion regarding validation took place on our mailing list in 2010: http://dev.eclipse.org/mhonarc/lists/mdt-bpmn2.dev/msg00132.html Antoine mentioned back then that the list of constraints might be compiled externally (see http://dev.eclipse.org/mhonarc/lists/mdt-bpmn2.dev/msg00134.html), but I don't think that anything has happened in that direction. Anyway, it might be worth looking for open source implementations of BPMN2 that include the constraints. Perhaps we could be able to reuse them, IP permitting.
Okay, so let's just create a wiki page (I think I don't have enough karma do to that), and start gathering any information that may be useful.
OK, I've created http://wiki.eclipse.org/MDT/BPMN2/Validation It might make sense to use a specific structure, so that the results (=constraints) are available in a consistent manner. I'll have a look if Wiki templates can be useful in that regard.