Generic Interface has a defined flow to perform actions as a provider and as a requester.
This flows are described below:
HTTP request
OTRS receives HTTP request and pass it through the layers.
The provider module in in charge to execute and control this actions.
Network Transport
The network transport module decodes the data payload and separates the operation name from the rest of the data.
The operation name and the operation data are returned to the provider.
Data External
Data as sent from the remote system (This is not a module-based layer).
Mapping
The data is transformed from the External System format to the OTRS internal format as specified in the mapping configuration for this operation (Mapping for incoming request data).
The already transformed data is returned to the provider.
Data Internal
Data as transformed and prepared to be passed to the operation (This is not a module based layer).
Operation
Receives and validates data.
Performs user access control.
Executes the action.
Operation
Returns result data to the provider.
Data Internal
Data as returned from operation.
Mapping
The data is transformed back to the Remote system format as specified in the mapping configuration (Mapping for outgoing response data).
The already transformed data is returned to the provider.
Data external
Data as transformed and prepared to be passed to Network Transport as response.
Network Transport
Receives the data already in the Remote System format.
Constructs a valid response for this network transport type.
HTTP response
The response is sent back to the web service client.
In the case of an error, an error response is sent to the remote system (e.g. SOAP fault, HTTP error, etc).
Event Trigger Handler
Based on the web service configuration determines if the request will be synchronous or asynchronous.
Synchronous
A direct call to the Requester is made in order to create a new request and pass it through the layers.
Asynchronous
Create a new Generic Interface (Requester) task for the OTRS Scheduler (by delegating the request execution to the Scheduler, the user experience could be highly improved, otherwise all time needed to prepare the request and the remote execution will be added to the OTRS Events that trigger those requests).
In its next cycle the Scheduler process reads the new task and creates a call to the Requester that will create a new request and pass it through the layers.
Invoker
Receives data from the event.
Validates received data (if needed).
Call core modules to complement the data (if needed).
Return the request data structure or send a Stop Communication signal to the requester, to gracefully cancel the request.
Data Internal
Data as passed from the invoker (This is not a module based layer).
Mapping
The data is transformed to the Remote system format as specified in the mapping configuration (Mapping for outgoing response data).
The already transformed data is returned to the requester.
Data External
Data as transformed and prepared for sending to the remote system.
Network Transport
Receives the remote operation name and the data already transformed to the Remote System format from the requester.
Constructs a valid request for the network transport.
Sends the request to the remote system and waits for the response
Network transport
Receives the response and decodes the data payload.
Returns the data to the requester.
Data External
Data as received from the Remote System
Mapping
The data is transformed form the External System format to the OTRS internal format as specified in the mapping configuration for this operation (Mapping for incoming response data).
The already transformed data is returned to the requester.
Data Internal
Data as transformed and ready to be passed back to the requester.
Invoker
Receives return data.
Handles the data as needed by specifically by each Invoker (included error handling if any).
Return the Invoker result and data to the Requester.
Event Handler or Scheduler
Receives the data from the Requester, in the case of the Scheduler this data might contain information to Re-Schedule the task immediately or in the future.