Friday, February 18, 2022

#903 Bringing it all together - OIC + OHIP + Simphony

The thing with OIC Integration is that it does the plumbing in the background. It's not that exciting demoing integrations directly from the OIC tester so that's why I created a Visual Builder front end to demo some of the compelling functionality. Those of you who know me appreciate the fact that I'm not the greatest when it comes to developing UIs. Not that I don't appreciate art and design - below are some of the pictures adorning my humble abode in Bavaria -


So with that said on to my demo VB app - 
Visual Builder is Oracle's low-code solution for building and running native mobile and web apps. When I say low code, I really mean low code - 99% declarative.

The goal of the app is to demo usage of the OHIP and Simphony apis in a visual manner. There are 2 user personas, firstly, the guest, who can update her guest profile, reserve rooms etc. The second persona is the Front Office person. He can specify how the guest is going to pay for the room (assign credit card to reservation). He can also assign a vacant and inspected room to the guest, then check them in. Finally, he can do what all hotels should do - order an ice cold beer to be sent up to the guest's room.

The apis I will be using have been covered in previous posts - so the focus here is more on the VB side.
Visual Builder is simple to use and simple to explain - so for you neophytes out there - pay attention!
















You see the icons on the right - 
  • first icon that looks like a mobile phone is where you create native Mobile Apps
  • second icon, where I am, allows me to create Web Apps
  • third icon is for Service Connections - getting access to data from the outside world. I use service connections to pull in the required OIC OHIP and Simphony related integration apis.
  • fourth icon is for Business Objects - I will create a few of these as app data stores.
Let's ignore the other icons for now.

Service Connections



 

One sees the following dialogue, when one clicks on the + 

























So it is very easy to import these api definitions from OIC Integration. Now to the Business Objects -

Business Objects














These 3 are related to the guest. Think of logging into your hotel booking app - Bonvoi or something similar. Guest Profile includes details such as name, contact info etc. Any changes made will be synced to the Profile in Opera Cloud.

Payment Methods includes credit card info etc. Necessary when booking a room. 

StayRequest should really have been called reservations as it includes the reservation data.

These Business Objects have their own REST apis, so I can update them easily within my app. For example, if the guest user makes a change to their credit card details then I simply invoke the following api - declaratively of course. 























So now to the Web App - 

Web App























I have a few pages, as you can see. The main page is called main-start and is pre-seeded when I create a web app.


 
So let's try out the app - 



I click on my guest profile - 


















I have the opportunity to change the email address, which I do - 
























The relevant OIC integration is invoked on clicking Save.

























I can also view the payment methods - my credit card data - 



















I can easily specify what should happen on clicking Save - by creating an Action Chain - more about them later.
















Now to the first use case - reserving a room - 





Room available for €75 - I'll reserve that 

That's another reservation added - 




Now to the 2nd persona - the front office person - He chooses the relevant reservation - 






As you can see there are a couple of steps here - All of these could be executed in one call to OIC, however, I have broken them down, just for visibility purposes. First thing our front office person does, let's call him Uncle Paudge - an elderly gent, but gets on great with guests of a certain ilk - is to Assign a Payment Method to the reservation. We used the preferred payment method already set up for the guest here.









Naturally, the relevant OIC integration has been invoked - 






Now to finding a room for our guest - 





Looks like room 405 is the only one available, but no worries, this is a room with a great view of the lake.





Now Uncle Paudge can officially check in the guest -






Finally, the guest deserves a welcome pint, so Uncle Paudge clicks on the Order Welcome Drink for Customer (yes, I've renamed it) button -





This invokes the Simphony integration described in the post here
This sends a text to the guest, advising them to hurry on up to the room for a ice cold beer.










Visual Builder details

Using VB to demo usage of OIC integrations is very easy, remember also VB is part of the OIC toolkit and is tightly integrated with OIC Integration and Process. Granted, my UI is very basic, however, you can create very compelling UIs with VB. VB has the concept of application and page variables - this makes it very easy to pass data between pages. 

Here is an example on the reservation code variable from the page above - 



















Note the Pass On URL setting - this allows me to pass the reservation code, when navigating to this page.

Here are the relevant button properties on the calling page - 



Note the Action Chain, let's look at it - 
note the ability to set the variables (Input Parameters)



The action chains for invoking OIC integrations are similar - Note the rich list of actions available -



Setting the OIC request payload is easy - 


VB variables can be simple such as of type String, however, you can also create variables based on types eg. Business Object Types or REST response types. This makes it very easy to manipulate data in VB apps.






















Net, net - it is definitely worth looking at Visual Builder for creating mashups on top of your app apis. Happy Developing!

Friday, February 11, 2022

#902 OIC -- Oracle Hospitality -- Simphony

 


In this post we look at how OIC can provide the glue and value add between Opera Cloud and Simphony. 

The main scenario here is as follows - guest checks into the hotel, an order is sent to Simphony for a welcome drink, with instructions to be delivered to the guest's room. Finally an SMS is sent to the guest's mobile, welcoming them.

Firstly, let's carry on from the previous blog post and the pizza order. This will be ordered from Jimmy's Cistine - the primary eatery - in our flagship Dublin Hotel - Óstán Mac Cumascaigh. btw. cistine is the Irish for kitchen, óstán the Irish for hotel. 

So imagine the pizza has been ordered by our guest, Cathal Brugha, staying in room 310. How can we create the connection on the order? 

Here is a simple solution - use the "extensions" fields - 















Note the options - this data will be printed on the Simphony display, on the receipt etc.

So simple for Jimmy's top server, Paudge, to deliver this to Cathal in room 310.

A very loosely couple integration, you may say, and who am I to deny that. But let's look at our main use case - Here we want to place an order for a welcome drink to be delivered to the room, once the guest has been checked in. We also send a text, welcoming them to the hotel.

Previous posts have covered the OHIP apis for room reservation, checkin etc. Here I just concentrate on the order placement and texting.

The main integration here could have the following request payload - 

1. guest profileId,
2. menuItemId for welcome drink
3. guest room nr
4. hotelId

The guest profile id will allow me to invoke OHIP to retrieve guest name and mobile nr.

Here is a very basic flow - 

 





The first step is to retrieve the guest profile and loop on the telephone numbers, selecting the one of type MOBILE. 

The second step is to do a local invoke of the existing PlaceOrder integration, discussed in the previous post. 

The final step is to send the text to the guest's mobile phone. I also have a separate integration for this - thanks to my colleague Pavan D.

The GetProfileDetails invoke is configured as follows - 




I then check if Profile has been found, if so iterate to retrieve MOBILE telephone number - 



For Each configuration - 


Check for Mobile nr - 



Finally - 





OrderDrink is the local invoke of the Simphony PlaceOrder integration - 














The Request Payload is as follows - 


I added the menu item to the Simphony OIC Lookup - as everyone gets a free bottle of Peroni.  


SendSMS invokes the following integration - 


This requires a Twilio trial account. This gives you a trial sender number which you can use - 


Account SID and Auth Token are required to create the Twilio connection in OIC - 


Twilio invokes is configured as follows - 



Target Mapping is simple -










So let's try it out! Nestor Makhno has just checked in.