Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364902 - Generate EGL code for validating an entity.
Summary: Generate EGL code for validating an entity.
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-26 18:03 EST by Marcel Groeneweg CLA
Modified: 2017-02-23 14:19 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Groeneweg CLA 2011-11-26 18:03:03 EST
Build Identifier: 20110916-0149

Will Smythe knows about this one. We discussed this a while ago in Amsterdam.

At a customer project, we found out that some entities require complex validations, where some validations can only run when another validation succeeded.
Also, some validations may not run at all depending on the source of the data...
This can consume quite a lot of effort to get it right.

So I wrote a little generator. As a developer:
- You can specify which validation rules exist for a given entity.
- For each rule, whether you want simple checks (required and nothing entered, range and length checks, etc.), evaluate an expression or you want to have some function called to do the work.
- Rules can depend on each other: don’t run a given rule if some other check already failed.
- You also specify which actions can occur on the entity, normally only create/update/delete, a few additional actions for some records.
- For each action you specify which rules are applicable.
The generator generates a function for each action. For update functions, it will do the validation only if the relevant attribute(s) were changed. (Unless you force the rule to be called at all times.)

We're using this now to great succes at the customer project (using RBD8012)

We use MVC and a custom validator to display the error messages on the widgets.

As others may very well be struggling with similar issues, this could find a place in EDT.
Currently, it is a Rich UI application which generates EGL code and an XML containing the definitions. 
The new functions in EDT may very well allow other ways to implement this.

Reproducible: Always
Comment 1 Matt Heitz CLA 2013-01-03 14:43:16 EST
Setting the target milestone to Future for bugs that won't be addressed in 0.8.2.