Hi Thomas.

First, you have to know that the OCL checker integrated in Topcased uses 
the MDT-OCL API.
Now, I will tend to say to wait the next Topcased release (on friday) 
that will bring plenty of news concerning OCL Tools : new checker UI, 
batch mode and other nice features.....

One way to process programmatically is the following (true for the 
future 2.1.0 version) :
       
// Call the OCL Checker provided by the bus
 IService checkerService = 
ServicesManager.getInstance().getService("org.topcased.ocl.checker.checkservice");
if (checkerService != null) // the service is found
{
            Map<String, Object> parameters = new HashMap<String, Object>();
            parameters.put("Model", model);
            parameters.put("OCLFile", oclFile);
            Object result = checkerService.serviceRun(parameters);
            if (result instanceof ResultModel)
            {
                resultModel = (ResultModel) result;
            }
}

So, to give you more information :
model : must be the EObject corresponding to the root model (imply that 
the model to check is already loaded).
oclFile : the absolute path to the OCL file (use the Topcased OCL editor 
to define your rules)

This service provided by the Topcased Bus returns a result model (typed 
ResultModel). Of course, you need to browse this result model to exploit 
the results you want.

Hope that all these explanations will help you.

Regards,

Sebastien


Thomas Winkler a écrit :
> Hello,
>
> I created a new Ecore metamodel based on UML and now I want to validate 
> models against that metamodel.
> So I am evaluating MDT OCL, oaW Check and Topcased OCL Model Checker.
>
> How can I invoke OCL Model Checker programmatically ?
>
> I saw the interface "org.topcased.validation.core.validators". But there 
> won't go any OCL constraints, am I right ?
>
> Regards,
>
>
> Thomas
>
>
>
>
>   


-- 
Sébastien GABEL
Software Engineer
Conseil & Services Midi-Pyrénées
Communication & Systèmes
+33 (0)5.61.39.46.16  
  


_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

Reply via email to