Search code examples
breezeopenedge

Breeze save bundle format


I am using Breeze JS and would like to implement a server with full CRUD functionality using Progress Openedge. The Breeze website talks a lot about being able to write your own server implementation but I can find no information describing the format of a save bundle that Breeze sends to the server. Does anyone know of any documentation or schema?


Solution

  • The SaveBundle is not documented for a very good reason: it has no definition in BreezeJS!

    It could be any serialized object that your server requires to satisfy yoursaveChanges work flow. You can see that this is true by examining the a60_abstractDataServiceAdapter.js source in github:

    proto._prepareSaveBundle = function (/*saveContext, saveBundle*/) {
      ...
      throw new Error("Need a concrete implementation of _prepareSaveBundle");
    };
    

    Breeze does ship with an implementation b00_breeze.dataService.webApi that satisfies the expectations of the companion Breeze ASP.NET Web API helper classes such as ContextProvider. This implementation is worth studying if you decide to write your own server support code.

    But it is only one of many possible implementations. An OData web server, for example, requires an entirely different package and format for "$batch" change-set saves. Only you know what's right for your "Progress Openedge" server.

    All that said, we do delve into some critical aspects of the SaveBundle destined for Breeze Web API services in the documentation for "ContextProvider".

    Feel free to follow-up with more specific questions after you've read that.