foreign [Music] session and the topic of for today is what's new in the about restful application programming model shortly wrap my name is Andre Fisher I'm product manager in the above group development group and yeah I would like to show you some of the latest features we have added to the Rock framework so what will I talk about so first I will show you the sap Theory element feature showcase app that has been built with rock so there is a new version out now with the release 2308 and so that's for the beginning the to show what what features can now be built using packet annotations and then we will switch to the control sub LED so The Logical unit of work and what we have added here so that you can make use of these features that we have developed for the Run framework then the another topic will be the background processing framework in short vgps so that is a very cool new feature that allows you to start asynchronous processing and that's something where what people have been waiting for for quite some time and we will finish our session with the topic of local events some events can now also be considered locally and how customers can extend events that are delivered by sap let's start so the sap fiori elements feature Showcase with Rub so this see this showcase has been developed here by my colleague Jesse and she she always writes a blog post about this when there is a new version out so we can here have a look at this oh it opens in the other window okay and um and it's nicely described but you can use there so for example what's the what's the new feature is is that you can now Define for a rough business object a leading entity and the nice thing is now that this leading entity shows up in ADT in the beginning and this is quite helpful if you have larger Rubios that contain lots of entities so and then you can just double click on this and use the preview so we can just walk through a few of those features that we now have beside this eating entity stuff we can we have now uh to convert time zones or it's possible to have Mandatory Action parameter and if you click now on on such a link in in the blog post of Jesse you will see that you will end up in the readme of the GitHub repository and there you will find then uh lots of information about the new above this feature and also a cool feature is here if you search now if I press now Ctrl f um I can search here for these mobs and I can navigate here locally um it can and you can then walk through that document and see all these um um yeah and see all these new features so it's really nice what what we see here like like quick views that are that can be built on the backend side so it's just what what if you want to use that right we are um we will open our Eclipse we'll check here okay here's my clips and um you have uh downloaded this here in a package and then you will find the surface binding in here also this now this cool new feature of the root entity if you double click on that it will open the preview of a of this app and that would then allow you to uh to work to work through all these features that are described in detail in that blog post and in the very informative weekly document so that uh let me go back to our presentation so that that's the UI side so we are will now switch to the backend part and [Music] start with this control sap logical unit of work because the rest of the features that I will present to you somehow that depend on this or make use of that and when we look at the sap Luv and uh and the transactional phases we have so we see that there's usually a modify phase so the user is working on the UI it's changing data buffer buffers are updated and then finally yeah if everything is fine the user presses the save button and then either the data is committed to the database in the end or it might be that something goes wrong and roll back the problem in the past was that there could be situations where that um where the developer had had to look at so if for example impressive permits take place right and if maybe somebody has already performed um changes to the database and if they're in such an implicit commit took place this data was persisted so that that's not new right but what now brought to the table was the clear orchestration and control of the sap logical units of work so you know rap so we have three phases so we have the injection phase and then we have an early save phase and a late say phase okay looking back we would maybe nowadays rename those faces because early because the early save phase is more preparation of the safe phase and in the late sales is the real safe so because that's this point of no return When the data is either committed to the database or the system would let's say um stop with a dump and everything would be rolled back and um that's uh this is now something we really achieved here with Rob that um the developer is yeah he has now not all these opportunities he had with classical rock where we had to look okay uh am I using the update task correctly and so on so you cannot use it anymore because this is this is now this is not not possible with the about Cloud program programming model and the what the game here is that what you are going to develop is really stable and that's the big advantage and we want uh yeah it's what's now possible that this what has been developed for the Run framework can now also be leveraged from in our implementation so here again you see there is this modify phase that spans the interaction the early phase and the late save is really this safe sequence what we can do now is if you write a class for example not a rapio if it's possible to exclusively set this transactional sizes within class that has been delivered by us CL above TX and if you use that in your code you can there are two static methods you can use the method modify and that would signal the framework that you we are entering the interaction at early save phase and there we can do all those things that are allowed in that phase um and we can then later on enter the late save face also run by run I performed by running this static method save and then for example this would lead to a dump if you would lose something that violates this contract and that's the big Advantage you can now leverage these stability contracts that we have introduced this route let's have a look here at a code so you work in your code run and use this modify method and then it is connected out here if you would now perform a modified DB type from some later that would be aware of that violation and that would end up with a done if you however have said entering the same phase it would be allowed to to modify the data as planned and this is now the the nice thing that you can follow where can we use that as well so there are apis that are available from sap s of feminists for Hana but also in the naked steam brand you would for example find this API that allows you to send mails also in the future so and these apis are now classified and uh if you use here F2 and check the send async method and you would find that there is a transactional contract mentioned and this tells you okay I'm only allowed to use that method uh in the safe phase and if you want to read about this sap Luv in more detail I can really recommend the blog posts from my colleague Renzo right so color just click on that and here uh just a five minute read and it really describes in very detail uh how the sap logical unit of work works let's now switch to the demo so here in my Clips I've prepared class you remember this screenshot of the uh of the um classified API so I'm going here to use that mail API and I will just send an email and as you see here I'm entering the safe phase at this point and would then after that call this Ace I found this ASU call which is only allowed in the safe 8 but not in the modified phase so if we press F9 we see okay that the mail has sent and I can switch to my Outlook in a moment too many windows open so we see here just we just received that classic that in that email so far so good so we are now trying when what our lab would like now to do is I will comment out this here okay here we now get the short pump that I was expecting and um we see also this in the feed reader but this statement is not around okay foreign processing framework is the next topic so we saw that The Rock flamework everything is nicely controlled but from time to time you would like to do something asynchronously you would like to for example um yeah start a longer running process or yeah which would would do something where the user should not wait on so asynchronous start of asynchronous process is a nice thing and um for this we now have provided developed the background processing framework so it's not totally new so it allows a set asynchronous processing and technically it's a wrapper around the good old bgrc I think contrast to the bgrfc it's quite easy to configure so there is just in an on-prem system you would have to more or less only create one RC destination so that in a cloud-based system this is done by us for you and how does it work so there is a safe for execution method so this Factory class here so you can set a name for your operation and then you are using uh you're creating an instance of a class which is uh which implements certain interfaces that are developed by us and you can provide data to to that core and then it's just safe for execution once a commit work takes place the execution is started so that means this this commit work can either be started explicitly if you do that by our class or if you do this from within the rock framework this commit work is implicitly performed by the rough framework after the data has successfully been saved so we have now two use cases one is to use the the background process instrument so you are have a rough app and you want to uh let's say for example I have an action button and that should now uh start uh this um asynchronous processing and um then this safer execution method would be start would be called that must be called in the save sequence and the commit work is triggered then for you by the route trainer the other way around is of the background processing framework and then you use wrap in depth in that call so you would for example have a class that there you want to modify an entity and please note if you implement this uh this class the the framework of the background process and surrender work automatically sets the start of a modify phase and only later you could for example specify that you're entering the same phase and that would then allow you for example to call this as this classified API that I that I showed to you so that it's um uh this percent assume and yeah this we will also show come back to eclipse so there is a method it's called send email control and this implements certain interfaces that that have been uh provided to you by us and um here I'm um in that implementation uh I'm I'm performing this read entities remember the screenshot then I do is something which let's say simulator it takes long and this for example would perform an implicit EV commit which is allowed in the modify phase and finally I'm modifying the data and then I'm entering the save space and I would then send an email uh with the data that that has been updated there and [Music] that would um yeah this can now be run live um so I have a rapio and that has a that has uh um Behavior implementation class and if we look here we have uh in the safe sequence in the safe modified phase if I create something that then I instantiating here this class I'm saving this for execution and if everything goes if if the safe phase goes through it would start sending out an email and this we are looking here later on this race event that's something I would I would like to show later to you so what I'm now starting my app it's a small rugby oh so we'll see you will see that later in tekkad so it's basically uh we use also in in our Hands-On sessions in a Hands-On session also in our one of our jump start sessions so I'm I'm not creating something right so um entering a price so I'm that should simulate and an online shop and just press create and this object 21 is created we can now have a look at the power inbox and we see here that the email has been sent exactly with with that number 21 in it so in the subject yeah that shows how we can use the background processing framework from within wrap and now we will have a look at the other way around so I'm now um use rub in in bgp and oops [Music] so I'm press here F9 then what what would happen is that I'm selecting here now in order with 20 with 19 I can also change this to 21 right so we have just created this order and um then it uh would enter something in the um in the notes here I'm sending the mail so I'm just press F9 that shows me okay now it's the evpf demo control so I'm I'm f called my rapio it's from from the outside and um I can also do here a refresh and I you see here that in the notes that uh the data has been updated via my email code computer then We are continuing and we will have a look at look at events and about local events and how to extend events so local events is something which we have now introduced with 2308 and um what does this mean so we can now raise events when the event was already possible a longer time but so far we only supported remote events that were pushed to the um event mesh but you might want also to use events locally so for example you the rub the bo that we have just seen and that could for example raise an event after um let's say the uh the order has been accepted and how can we consume those events for this we would have to implement a so-called event handler class the syntax is uh the following you create a class and then you share the statement for Events off and then the name of the logio and if you would create that then and activate it you would see in the properties that uh ADT shows this as an entity event handler and we can now again go to clips and we will see here you will see here um in event consumer and you know here I've here two packages so this is a package that is part of a software component xx01 and the other one is start the business of a base object and um have now created here an event and black class and what what does it show since this rugby or resides in software component one it has been released here so you see here that at our look at the behavior definition our shop Rock business object as an event order accepted and that has some parameter and this parameter is uh contains the uuid that's always part of an event but also the order ID so the semantic key and um we look at the um there is an interface and there we have specified that this event can be used and if we check the properties the API State we see that the interface of our Behavior definition has been released for extensibility that's the senior c0 contract and also system internally that's the C1 contract so we can now make use of that um event in another software component and here that means in our behavior in our in our um event timeline so the event handler more or less listens for um for new events and what do we do to ship how can I now show you that the event is really uh is coming here so we we see here that there are two methods one is um for the event order accepted and then and there is a second method which is used for then for for a second entity from second event and we will have a look at this later on inserts now data in it or maybe I show it now because you will see the result so in addition I have created a behavior extension One Moment In the the behavior extension defines the so-called managed event or derived event based on the original event and here the trick is we can define a new parameter this time not an abstract entity as usual in an event but this is a new attitude so the view entity um has to have the same key field and um and other than that it could have other fields so but here we are we are now using this to retrieve more data from our um from the events not only the order ID but for example the order item price so and this is should show you if you as a password you will see an interesting event from sap in S4 but you would like to retrieve more data from that um from that event you can use this mechanism to correct that to create a new event based on the or um extent this event from sap and add your custom payload to that and that's a feature that was all that was a half asked by several customers so we we will see here this is the additional payload and what I'm doing now is um or we can it has already worked the the we can have a look at the table here so that's the table uh that we um are entering our data and we see here that data has been entered for the order ID 2020 London has been creating as for example also my my user is is entered and and the and a time spent can be can be added here as well again that's what I showed the the result of those derived events so you create an extension and you extend the um behavior of the original rough business object and we could can define a so-called managed event based on the existing event from sap here I'm using a set let's say is that object so it shows that this can also be used by partners and the parameter is here the view entity that has the same key field so that the data can be passed to that job and it allows as set customers to extend events from SAP with their own payload and that can then be consumed so that was the demo that I showed there so I hope that you found this features interesting and yeah when this video will be made online um yeah I will see whether there are questions or that and you can try out a few of those things in uh not in the trial systems some stuff will only be available if you have your own skin bank system goodbye have a nice day foreign