|
|
Re: enriching code with ocl [message #975660 is a reply to message #975382] |
Thu, 08 November 2012 02:08 |
Jeni Martin Messages: 42 Registered: November 2012 |
Member |
|
|
Thank you so much for your reply. I have noticed that only the codes for invariants are created and no where in the generated code it has been used. So, I think I need to call the validate function manually myself. I have no clue what should I pass for the parameter, any helps? here the piece of code for the constraints:
public boolean validateTask_C2(Task task, DiagnosticChain diagnostics, Map<Object, Object> context) {
return
validate
(TmsPackage.Literals.TASK,
task,
diagnostics,
context,
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
"C2",
TASK__C2__EEXPRESSION,
Diagnostic.ERROR,
DIAGNOSTIC_SOURCE,
0);
}
Best
|
|
|
Re: enriching code with ocl [message #975865 is a reply to message #975660] |
Thu, 08 November 2012 06:03 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
HI
The validation code is invoked by the standard EMF validation framework,
so the call-path is obscured by the EValidator regustration.
You have probably neglected to register the validation delegates as
described in the standalone setup documentation, but since you provide
no details I can only guess.
Regards
Ed Willink
On 08/11/2012 02:08, Jeni Martin wrote:
> Thank you so much for your reply. I have noticed that only the codes
> for invariants are created and no where in the generated code it has
> been used. So, I think I need to call the validate function manually
> myself. I have no clue what should I pass for the parameter, any
> helps? here the piece of code for the constraints:
>
>
> public boolean validateTask_C2(Task task, DiagnosticChain diagnostics,
> Map<Object, Object> context) {
> return
> validate
> (TmsPackage.Literals.TASK,
> task,
> diagnostics,
> context,
> "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
> "C2",
> TASK__C2__EEXPRESSION,
> Diagnostic.ERROR,
> DIAGNOSTIC_SOURCE,
> 0);
> }
> Best
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03333 seconds