Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Change Description/Change Summary Example
Change Description/Change Summary Example [message #415507] Wed, 19 December 2007 03:55 Go to next message
Eclipse UserFriend
Originally posted by: mduduzi.keswa.isizwe.com

Hi All,
I have been reading on SDO and EMF and how they both handle "audit
trail" of an object. I have decided follow the EMF(T) roadmap and SDO
seems to have branched off a bit.
I'm currently playing with Teneo-Hibernate and would like to incorporate
"Change Description" API of EMF to do the following:

1. Generate a "Change Description"/"audit trail" to attach a changed
object.
2. I'd be nice if "Change Description"'s can be associated with some user
session ID or transaction (is this what SDO calls objectGraph?)
3. Define a metamodel/Epackage for "Change Description" so that it can be
stored via Teneo-Hibernate
4. Be able to Redo/Undo
5. Would something like EMF Compare help out here - I'm not familiar with
it?

If someone out there can provide an example of playing with any of the
above wishlist capability, I'd appreciate it.

Thanks in advance,
-Mdu
Re: Change Description/Change Summary Example [message #415508 is a reply to message #415507] Wed, 19 December 2007 06:48 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Mdu,

CDO is a (EMFT) technology that has built-in support for auditing/audit
trails.
I probably can't help you to connect the technological snippets that you
listed but if you give a bit more background about your requirements we
could see if CDO is a possible solution.

Usually a CDO client opens a session to a CDO model repository. Then it
uses this session to open a *transaction* :

CDOSession session = CDOUtil.openSession(connector, "repoName");
CDOTransaction transaction = session.openTransaction();
Resource resource = transaction.createResource("...");
//
// Navigate and modify EObjects, just work normally with them....
//
transaction.commit();

If this CDO model repository was configured to support auditing you can
also open an *audit view* instead of a transaction:

long oneHourAgo = System.currentTimeMillis() - 60L * 60L* 1000L;
CDOSession session = CDOUtil.openSession(connector, "repoName");
CDOAudit audit = session.openAudit(oneHourAgo);
Resource resource = audit.getResource("...");
//
// Navigate EObjects, work normally with them, just don't modify
them....
//

Regards,
Eike Stepper
----
http://wiki.eclipse.org/CDO
http://wiki.eclipse.org/Net4j




Mdu schrieb:
> Hi All,
> I have been reading on SDO and EMF and how they both handle "audit
> trail" of an object. I have decided follow the EMF(T) roadmap and SDO
> seems to have branched off a bit.
> I'm currently playing with Teneo-Hibernate and would like to
> incorporate "Change Description" API of EMF to do the following:
>
> 1. Generate a "Change Description"/"audit trail" to attach a changed
> object.
> 2. I'd be nice if "Change Description"'s can be associated with some
> user session ID or transaction (is this what SDO calls objectGraph?)
> 3. Define a metamodel/Epackage for "Change Description" so that it can
> be stored via Teneo-Hibernate
> 4. Be able to Redo/Undo
> 5. Would something like EMF Compare help out here - I'm not familiar
> with it?
>
> If someone out there can provide an example of playing with any of the
> above wishlist capability, I'd appreciate it.
>
> Thanks in advance,
> -Mdu


Re: Change Description/Change Summary Example [message #415513 is a reply to message #415507] Wed, 19 December 2007 13:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Mdu,

Comments below.

Mdu wrote:
> Hi All,
> I have been reading on SDO and EMF and how they both handle "audit
> trail" of an object. I have decided follow the EMF(T) roadmap and SDO
> seems to have branched off a bit.
> I'm currently playing with Teneo-Hibernate and would like to
> incorporate "Change Description" API of EMF to do the following:
>
> 1. Generate a "Change Description"/"audit trail" to attach a changed
> object.
A ChangeRecorder can be attached to any EObject; by default it will
attaches itself to all contained children as well, but I suppose you
could specialize the behavior.
> 2. I'd be nice if "Change Description"'s can be associated with some
> user session ID or transaction (is this what SDO calls objectGraph?)
How you use the ChangeDescription is really up to you. It's just a
model object that can be serialized like any other.
> 3. Define a metamodel/Epackage for "Change Description" so that it can
> be stored via Teneo-Hibernate
It already has one so you should be able to define a mapping for it.
> 4. Be able to Redo/Undo
The ChangeCommand shows how it can be used to implement undo and redo.
> 5. Would something like EMF Compare help out here - I'm not familiar
> with it?
That's more finding out about changes after the fact. It's certainly
easier to know what's changed by watching the changes happen.
>
> If someone out there can provide an example of playing with any of the
> above wishlist capability, I'd appreciate it.
Have a look at the JUnit tests, i.e., ChangeRecordTest in particular.
>
> Thanks in advance,
> -Mdu


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Change Description/Change Summary Example [message #415616 is a reply to message #415508] Sat, 22 December 2007 01:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mduduzi.keswa.isizwe.com

Eike,
Thanks for insightful response on CDO. The web application framework
requirements of what I'm trying to build are as follows:

1) Be based on MDA and SOA
2) Be able to use metamodel to automagically do the following:
2.1) A FormsBuilder that behaves like MS InfoPath (w/ DataSources onto
which form fields can be bound at design time). This has to be web based
using Ajax along the way.
...etc
3) Ability to configure (via web app UI) any class/entity within a
metamodel to turn off/on audit trails and support ff. queries on audit
trails:
3.1) Show all models/resources that we changed by user U during session
S.
3.2) Show all models/resources that were read by user U during session
S.
...etc
4) Automagically generate all artifacts of a web based application to
support serialization of models to be manipulated by a web client (via
Ajax or other)
5) Support for electronic signatures around signed forms in 2.1 - long
shot here.
5.1) Support for attaching electronic signatures around 'Object
Changes'. e.g. If a user submits a form to change certain sensitive
models, they'll be asked sign (maybe re-enter user/pwd) and have that
signature linked to all affected changes and be made immutabe.
6) Ability to support "change management" better by allowing changing of
metamodels and then automagically re-generate artifacts thus shortening
time-2-market on any app customization
7) Seamless integration with workflow tools such as jBPM by using 2.1

Ok, I can settle for the ff.:

2008 Wishlist to Santa: 1,2,3; others can follow long after this

Practical Questions:
1. What are fundamental differences between CDO and Teneo?
2. Can I embed CDO within app server like JBoss/Liferay(Portal) to simply
use it for services such a audit trails?


Thanks again,
-Mdu
Re: Change Description/Change Summary Example [message #415622 is a reply to message #415616] Sat, 22 December 2007 12:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Mdu,

Comments below.

Mdu wrote:
> Eike,
> Thanks for insightful response on CDO. The web application framework
> requirements of what I'm trying to build are as follows:
>
> 1) Be based on MDA and SOA
You forgot the "TM" (trademark) on MDA. :-P Isn't everything SOA these
days? It seems more of a state of mind than a thing of substance, but
that's just my personal opinion...
> 2) Be able to use metamodel to automagically do the following:
> 2.1) A FormsBuilder that behaves like MS InfoPath (w/ DataSources
> onto which form fields can be bound at design time). This has to be
> web based using Ajax along the way.
The properties view is very much like a form and with the new data
binding framework support in EMF 2.4 you can easily bind EMF objects to
views. Also, with the RAP project, you can build GUIs using Eclipse
that are rendered using AJAX.
> ...etc
> 3) Ability to configure (via web app UI) any class/entity within a
> metamodel to turn off/on audit trails and support ff. queries on audit
> trails:
You can certain turn off change recording or ignore the changes (though
I'm not sure what's the implication of ignoring changes).
> 3.1) Show all models/resources that we changed by user U during
> session S.
The change recorder does that.
> 3.2) Show all models/resources that were read by user U during
> session S.
The resources that are demand loaded into the resource set will be the
ones the user read.
> ...etc 4) Automagically generate all artifacts of a web based
> application to support serialization of models to be manipulated by a
> web client (via Ajax or other)
We don't have any existing code to generate a web application, but it's
certainly possible to extend the templates to generate such things;
org.eclipse.emf.examples.generator.validator shows how to add templates
to generate additional things.
> 5) Support for electronic signatures around signed forms in 2.1 - long
> shot here.
> 5.1) Support for attaching electronic signatures around 'Object
> Changes'. e.g. If a user submits a form to change certain sensitive
> models, they'll be asked sign (maybe re-enter user/pwd) and have that
> signature linked to all affected changes and be made immutabe.
That's part of the web application itself. I'm not sure how to support
that...
> 6) Ability to support "change management" better by allowing changing
> of metamodels and then automagically re-generate artifacts thus
> shortening time-2-market on any app customization
EMF's generator supports merging (at least for .java and .properties
files) so this is generally possible. The serialization support even
supports things like OPTION_RECORD_UNKNOWN_FEATURES to support forward
(limited) forward compatibility, i.e., the ability to read a newer
serialization with an older application and preserve the newer data.
> 7) Seamless integration with workflow tools such as jBPM by using 2.1
The STP has BPMN support, buty I know nothing about it nor now it
relates to jBPM.
>
> Ok, I can settle for the ff.:
>
> 2008 Wishlist to Santa: 1,2,3; others can follow long after this
>
> Practical Questions:
> 1. What are fundamental differences between CDO and Teneo? 2. Can I
> embed CDO within app server like JBoss/Liferay(Portal) to simply use
> it for services such a audit trails?
Good questions. I have some idea, but it's best for Eike to answer this
and expand on my answers above. His stuff is really cool. He'll be
giving a long talk about it at EclipseCon.
>
> Thanks again,
> -Mdu
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problem markers from the genmodel editor
Next Topic:Upper Bound = -2: ECore validator seems to accept this, and ECore model generated from Birt produce
Goto Forum:
  


Current Time: Tue Apr 23 09:30:32 GMT 2024

Powered by FUDForum. Page generated in 0.03241 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top