Skip Navigation

FormsService

IFormsService provides capabilities of opening predefined graphical forms like Queue Placement form and prepopulating the form with the data provided by the developer. The developer can create the request data object necessary to open the form. If an end-user submits the form then the request is being processed and a result is displayed on the screen and is returned to the caller. The result is data from specific services like Queue Placement service. Submitting the form via API results in the same action as the end-user action. If the form is closed without submitting it null is returned instead of the data.

Supported forms:
  • Queue Placement

  • Reservation Modify

  • Air Shopping

Methods

/**
 * Opens the Queue Placement modal and prepopulate it with data extracted from the RQ.
 *
 * @param rq @link CommandMessageQueuePlaceRq Represent request object
 */
openForm(rq: CommandMessageQueuePlaceRq): Promise<CommandMessageQueuePlaceRs|null>;

/**
     * Opens the Reservation Modify modal and pre-populate it with data extracted from the request.
     * @param rq @link ReservationModifyRq represents request object
     * @returns Promise with Command Message Basic response or null when the form was closed.
     */
 openForm(rq: CommandMessageReservationModifyRq): Promise<CommandMessageBasicRs | null>;

/**
* Opens the Air Shopping Form and pre-populate it with data extracted from the request.
* @param rq @link AirShoppingInputRq Represent request object
* @returns Promise with Command Message Basic response or null when the form was closed.
*/
abstract openForm(rq: FormsAirShoppingInputRq): Promise<CommandMessageAirShoppingRs | null>;

Usage

  1. Invoke openForm.

export class FormsServiceUsageExample {

	private formsService: IFormsService = getService(IFormsService);

    async doSomethingWithRecordLocator(): void {

        const sampleRqObject =  {
		    QueuePlaceRq: {
			    Queue: [{
				    QueueName: 'Name',
				    QueueNumber: '123',
				    PrefatoryInstructionCode: '123',
				    PseudoCityCode: '123'
		        }];
		    }
		};

        // send request and extract response
        var rs: CommandMessageQueuePlaceRs = await formsService.send(sampleRqObject);

        // do something with response
        rs.getStatus();
    }
}