Sunday, April 26, 2009

Modeling goes Enterprise

I just finished the second part of my article "Modeling goes Enterprise - About EMF and CDO". It will be published in the Eclipse Magazin next month. Thanks to Sebastian Meyen and Hartmut Schlosser I'm allowed to make the example application, discussed in the article, available in the Eclipse CVS!

The splash picture was taken in my kitchen

The example is a set of applications (IDE, headless, 3x RCP, Servlet) used to support the business of the electronic restaurant "eDine", where they have touch computers at all the tables and at the bar and in the kitchen. Special RCP applications operate on a distributed shared EMF model which is provided by a headless CDO repository server.

Running the Example

1) Install the example
2) Start the server process
  • Start the "GastroServer" launch config. It creates a Derby database at "/gastro".
  • Watch the console output.

3) Populate the repository
  • Start the "GastroTestClient1" launch config. It opens a runtime IDE with generic CDO support.
  • Open the "CDO Sessions" view.
  • Add a new session (green plus button). Enter "tcp://localhost" and "gastro".
  • Open a new transaction (right-click on the session).
  • Import the /org.gastro.testclient/inventory.xml resource into "/eDine/inventory".
  • Commit the transaction (right-click on the transaction or just save the editor).

4) Start the RCP application for table 1 (and optionally for table 2)
  • Start the "GastroTable1" launch config. It opens an RCP application.
  • Browse through the menu card and select some offerings here and there.

5) Start the RCP application for the bar
  • Start the "GastroDepartment1" launch config. It opens an RCP application for the barkeeper.
  • Watch orders coming in.
  • Eventually click on order details to mark them SERVED and watch the order disappearing when completed.

6) Start the RCP application for the kitchen
  • Start the "GastroDepartment2" launch config. It opens an RCP application for the cook.
  • Eventually click on order details to mark them SERVED and watch the order disappearing when completed.

7) Send an order (if the RCP applications are all started, see steps 4-6)
  • In the table application open the second shelf pane and send the order.
  • Watch how the relevant order details "arrive" in the bar and kitchen applications...

8) Browse the menu card via Web
  • Start a web browser and point it to "http://localhost:9090/gastro"

Enjoy your meal! ;-)


  1. Cool stuff :)
    But shame on you that the web interface is not based on RAP ;-)

  2. Thx Ben!

    If you want to contribute RAP support to the demo I'd appreciate to make it available with the other plugins!! ;-)

  3. That is funny! On the plane I just read the first part of your article in Eclipse Magazin. I really like it. In fact, after reading the article I am thinking about using CDO for the application I am working on right now...

    Continue the great work!


  4. Michael,

    Thank you, good to know that all the effort is not for the bin :P

    And hopefully the article and the example app make some of the benefits of modeling clear as well:

    If you look into the code you'll notice that the whole system is mainly generated with EMF's default templates or "painted" with SWT Designer. The presentation logic is coded in a few lines against the business model or standard EMF APIs.

  5. Excellent work Eike!!
    One of the most interesting works I've ever seen around. We certainly will adopt the CDO architecture and this approach in our projects.
    A note: we prefer the RCP interface

  6. Hallo Eike,

    I have a problem with your example. If I click send order I have an exception like this:

    org.eclipse.net4j.util.transaction.TransactionException: Rollback in DBStore: org.eclipse.net4j.util.ImplementationError

    I'm newbie at CDO! Do you have an idea?


  7. Stefan,

    According to your stack trace the CDO version you're working with is not the latest one. In HEAD there's an IllegalArgumentException telling about llegal use of external references. Can you check again with the HEAD version of CDO and report the complete stack trace via Bugzilla or the EMF newsgroup?


  8. Hallo Eike,

    thanks for the fast solution.

  9. Hi Eike,
    I receive an error similar to that of Stefan, but not the same:

    ReceiveSerializer-Channel[1, CLIENT] [debug.signal] Received buffer for correlation -36
    [ERROR] Rollback in DBStore: java.lang.IllegalArgumentException: DBStore does not support external references: oidcdo://gastro/eDine/inventory#1/41
    at org.eclipse.emf.cdo.server.db.CDODBUtil.getLong(

    it seems that I have the latest CDO, at least I see the IllegalArgumentException you mentioned, what then can be wrong?

  10. Vincenzo,

    I tend to think that we broke something with one of the most recent changes. Can you file a bugzilla with the logs attached?


  11. Excellent, absolutely excellent. I love modelling and you have made really strong additions to the community.

  12. Eike,
    sorry, it was my fault. Now I have checked out all projects about CDO and eDine it's working perfectly!

  13. Thx N. ;-)

    Vincenzo, No worries: Getting it up and running for the first time is often hard. Btw. Wasn't it you being interested in translating CDO to Italian? Vik just registered CDO and Net4j with the Babel translation server...

  14. Eike,
    on Babel I selected:
    Project=modeling.emf (didn't find CDO nor Net4j)
    Files= ? (hoped to find CDO or Net4j here, but nothing)
    What I am doing wrong?

    Another thing: it's ok for us to translate language packs files, but we would be much more interested (if it can help) into translating tutorials and documentation.
    Here we usually see people using the IDE and tools in English, while tutorials and documentation are usually asked in italian.

  15. Vincenzo,

    The upcoming CDO version is 2.0 ;-)

    Translating the documentation is interesting,too! But I've just begun to fill the manual. As you can see with the "Expand All" button there's lots of work left. The web manual is generated out of DITA sources stored in CVS. I've yet not thought about how to make this multi-lingual...


  16. Eike, where has the project set moved? The URL in your blog has become invalid.


  17. found it -- no googling available, but some browsing in CVS did it:

    of course, the 'deprecated' part makes me wish to know if there is a more current version, but that may be obvious to me in a while...


  18. Hi Nikolaj,

    There is a brand new mechanism to setup a developer workspace,i.e. checkout the sources and provision the target platform. I haven't found the time to document it properly, but here is a short README:

    Have fun ;-)


  19. Hi Eike.

    This project exists on any scm? I can't find information about how to download it.
    I can't even find buckminster at new eclipse 3.7/4.1 M5 repository...

    thank you very much !

  20. Hi Cristiano,

    Buckminster has left the train. I've updated our source setup instructions accordingly:


  21. Hi Eike

    I'm tryin to run the example for the first time but as I run the org.gastro.server I got the error : "Cannot locate JRE definition : jdk1.5.0_22. Launch aborted" , then I've tried to change the GastroServer.launch manually and change the jdk to my version but I got the same error , so please help me to fix it


  22. Hi Aryan,

    I'm afraid that I can not help with this kind of "environmental" problem unless sitting in front of it. By "manually" you don't mean with a text editor, eh? I'm sure that, if you use the JDT/PDE/OSGi tools of Eclipse, you should be able to launch with your JRE.


  23. This comment has been removed by the author.

  24. Hi Aryan,
    did you tried the following?
    Run, Run Configurations..., select your Launch, in Main tab click Installed JREs...
    check the path of your JVM


  25. thx Vincenzo , ja I've tried it but now the problem is something else and I think I've checked out the wrong version of this example so can anyone tell me exactly where can I find the right version ? because I could just find it in "org.eclipse.emf.cdo.deprecated" and nowhere else , I've also tried to download cdo-gastro-example.psf and import it but it doesn't work .I'm new to this , therefor I ask this kind of basic questions !

  26. I would be interested in reading the article and translate it in Italian. Let's try to write to the pubblisher...

  27. Moonbiter, a nice idea!

    In case they don't have these old issues or you can't wait for them, here are the online links:

    Buon Appetito

  28. " Team Project Set" plugins are not available?

  29. Uma, I don't understand your question ;-(

  30. This Link "Team Project Set" is empty.

  31. Ah, if you tell me where you're seeing this link I can remove it. We don't work with PSFs anymore since we've migrated to Git. I'm currently updating the CDO Source Installation page...

  32. Hi Eike,

    Is there any way API of CDO can help me to generate Hibernate artifacts(HBM file) from an input of ECORE model instead of using Eclipse plugin?

    We want the code generation to be programatic.



  33. Hi Appasamy, you've already asked this question on the official support forum, the EMF newsgroup and it's been answered there.

  34. Hi Eike,

    The orders did not come through to the "bar" and "kitchen" even after i sent the orders from the tables. Blank grey screen.

    Version: Juno Release
    Build id: 20120620-1657
    Macbook Air (64-bit)

  35. Unknown, please ask for support on the EMF forum/newsgroup. And please describe in more detail what s "blank grey screen" is.

  36. Think i found the issue.

  37. I have the same problem of "Unknown".
    When i send the orders i don't see them in bar and kitchen