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! ;-)

37 comments:

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

    ReplyDelete
  2. Thx Ben!

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

    ReplyDelete
  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!

    Michael

    ReplyDelete
  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.

    ReplyDelete
  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

    ReplyDelete
  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
    at org.eclipse.emf.cdo.common.id.CDOIDUtil.getLong(CDOIDUtil.java:84)

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


    Stefan

    ReplyDelete
  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?

    Cheers
    /Eike

    ReplyDelete
  8. Hallo Eike,

    thanks for the fast solution.

    ReplyDelete
  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(CDODBUtil.java:140)

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

    ReplyDelete
  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?

    Cheers
    /Eike

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

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

    ReplyDelete
  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...

    ReplyDelete
  14. Eike,
    on Babel I selected:
    Language=Italian
    Project=modeling.emf (didn't find CDO nor Net4j)
    Version=2.5.0
    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.

    ReplyDelete
  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...

    Cheers
    /Eike

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

    /\/ikolaj

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

    http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.cdo/deprecated/develop/setup/psf/pserver/cdo-gastro-example.psf?root=Modeling_Project&view=log

    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...

    /\/

    ReplyDelete
  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:

    http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.cdo/releng/org.eclipse.emf.cdo.releng/?root=Modeling_Project

    Have fun ;-)

    Cheers
    /Eike

    ReplyDelete
  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 !

    ReplyDelete
  20. Hi Cristiano,

    Buckminster has left the train. I've updated our source setup instructions accordingly: http://wiki.eclipse.org/CDO_Source_Installation#Prepare_the_IDE

    Cheers
    /Eike

    ReplyDelete
  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

    Regards
    Aryan

    ReplyDelete
  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.

    Cheers
    /Eike

    ReplyDelete
  23. This comment has been removed by the author.

    ReplyDelete
  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

    Vincenzo

    ReplyDelete
  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 !

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

    ReplyDelete
  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: http://www.eclipse.org/resources/resource.php?id=510

    Buon Appetito
    /Eike

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

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

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

    ReplyDelete
  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...

    ReplyDelete
  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.

    Thanks,

    Appasamy

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

    ReplyDelete
  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)

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

    ReplyDelete
  36. Think i found the issue.
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=353628

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

    ReplyDelete