Plugins Workflow

Introduction

HotelX Plugins are a separate Go application that get compiled into the main application and run natively in our servers that add or modify specific functionalities. Plugins are specified at the request level, or be configured by default.

Flows

HotelX query or mutation determine what flow is executed. Plugins can be executed in different Queries or Mutations:

  • Search
  • Quote
  • Book
  • Booking
  • Cancel

Steps

Step is the minium container where plugins are executed sequentially.

Step When it’s executed
Request After Client requests message to HotelX.
Request Access Before send request to Supplier using Access and after Accesses has been calculated.
Response Option After Supplier responds message. For every option returned.
Response Access After all Access options has been responded.
Response Before HotelX responds message to to Client.

Plugin Types

Plugin types supported by HotelX:

Plugin Names

Plugin Context Execution

Once message hits HotelX, it flows over different flows and steps. That’s why plugins are executed in different contexts.

Context allows:

  • Read objects involved in current query and/or mutations.
  • Read objects available in all HotelX operations.

Plugin Step Execution

HotelX determines the order and the plugins executed for each step. Notice that not all the plugins available in HotelX have a plugin type. The following table shows the plugins with plugin types and also the rest of the plugins with their corresponding plugin name.

search quote hotelBook hotelCancel hotelBooking
Request [PRE_STEP]
HOTEL_MAP
[POST_STEP]
[PRE_STEP]
[POST_STEP]
[PRE_STEP]
booking_detail_persistence
genvcc
[POST_STEP]
[PRE_STEP]
[POST_STEP]
[PRE_STEP]
[POST_STEP]
Request Access [PRE_STEP]
add_parameterX
MARKETS_GROUP
blacklist
[POST_STEP]
[PRE_STEP]
add_parameterX
[POST_STEP]
[PRE_STEP]
add_parameterX
[POST_STEP]
[PRE_STEP]
add_parameterX
[POST_STEP]
[PRE_STEP]
add_parameterX
[POST_STEP]
Response Option [PRE_STEP]
BOARD_MAP
ROOM_MAP
AMENITY_MAP
PROMOTION_MAP
CURRENCY_CONVERSION
COMMISSION
safety_margin
[POST_STEP]
[PRE_STEP]CURRENCY_CONVERSION
COMMISSION
[POST_STEP]
[PRE_STEP]
CURRENCY_CONVERSION
COMMISSION
[POST_STEP]
[PRE_STEP]
CURRENCY_CONVERSION
COMMISSION
[POST_STEP]
[PRE_STEP]
CURRENCY_CONVERSION
COMMISSION
[POST_STEP]
Response [PRE_STEP]
AGGREGATION
preference[POST_STEP]
[PRE_STEP]
[POST_STEP]
[PRE_STEP]
[POST_STEP]
[PRE_STEP]
[POST_STEP]
[PRE_STEP]
[POST_STEP]

Ftp Endpoint

ftp://ftp.xmltravelgate.com

Directory Format

Root path

The structure of the directory should be in the below format, all files should be inside this directory

/F[Folder code]_[Unique code]/HotelX_[Unique code]/

  • F[Folder code]_[Unique code]

    • Folder code: corresponds to the folder number.
    • Unique code: corresponds to the folder unique code in our system.
  • HotelX_[Unique code]

    • Unique code: corresponds to the HotelX unique code in our system.

Example

  • /F**0**\_**178**/HotelX\_**179**

Updating ftp data

We have two options:

  1. Reprocessing the same data by renaming the file and just removing “_processed”.
    Example: SourceContext_DestinationContext_entity_map_processed.csv –> example.csv
  2. Changing the data by deleting the processed file and uploading a new one with new information.

Deleting ftp data

Uploading a new file only with headers (no information).

Code Source, Code Destination

Entities processed types:

Sequential

Type of processing sequentially, the first rule that coincides will be the one applied.

Supplier

Rules applied or indexed at the supplier level.

Access

Rules applied or indexed at the access level.

Hotel

The key to indexing is of the hotel type, we hope that the reference is by a hotel code where the type will be given by the context.

Destination

Idem hotel.

We have different combinations values from entities values this table show this combinations:

entity chainCodes destinationCodes hotelCodes
chain Yes No No
hotel No No Yes
destination No Yes No

How to execute a plugin

A plugin execution can be specified in any request’s HotelSettingsInput and it must specify in which step it should be executed. The plugin type and name are mandatory in order to identify a plugin instance.

		"plugins": [
			{
				"step": "PluginStepType",
				"pluginsType": {
					"name": "plugin name (its unique)",
					"type": "PluginType",
                    "parameters": []
				}
			}
		]