Ticket Handler

  • The ticket Handler module works as an intermediate module between the destination module and the route call
  • For eg:  route_ajax=“ticket-handler/<ticket_id>/submit”
  • Here submit module is the destination module
  • At first ticket-handler module will be executed and here session ticket will be verified.
  • Use session_ticket.get to get session ticket data.
  • Check details here – session_ticket-get
  • Please consider the following example,
  • Calling Code snippet in samples app:
  • The session activity is configured with the attribute, app="samples"serving as a router within the application.
  • The designated destination module within the “samples” app is labelled as “test_2”.
  • When the Call Test component receives a click event, it initiates a routing action to the “ticket-handler” module within the same “samples” app.

 

  • Ticket handler code:
  • In the given scenario, qs.0 is designated as ticket_id due to the structure of the route call.
  • Utilizing the ticket_id, data associated with the ticket is retrieved, denoted as ticket_data.
  • If ticket_data is not empty, it signifies that the ticket is valid and contains relevant information.
  • Following validation, subsequent routing procedures can be executed based on session ticket activity.
  • These routing actions may encompass services, modules, or templates, depending on the context.

 

  • Calling Code snippet using service module as calling module:
  • In this code, the session activity is configured with the app attribute set to “system,” serving as a bypassing mechanism. If the system app is not present, it needs to be created.
  • Additionally, the destination module is specified as the service module located in “test_service,” identified as “test_module.”
  • When the Call Test receives a click event, the routing will direct to the module “test_service.test_module.”

 

 

  • So simple it is, try this in your app.
  • Happy coding.
  • Ps: Shortly, this will get updated as ticket-handler as service perhaps there will be a modification in routine too.
Updated on Apr 05, 2024