Breadcrumb
- Sabre Red 360 Software Development Kit Help
- Sabre Red 360 Developer Toolkit
- Web Modules
- Examples
- com.sabre.redapp.example3.web.wf.extension.pricing Sample
com.sabre.redapp.example3.web.wf.extension.pricing Sample
This sample demonstrates adding remarks and passengers in dynamo.air.pricing:beforePricing
and dynamo.air.pricing:afterPricing
extension points.
Execution time - this will be executed after a user sends manual air price command in the command line or requests pricing graphically in the Advanced Pricing window, but before the request is sent to the Sabre host.
Code invoked in dynamo.air.pricing:beforePricing
/**
* This class demonstrates how to use the dynamo.air.pricing:beforePricing web extension point.
*/
export class SampleExtPointBeforeAirPrice extends BeforeAirPriceExtension {
static SERVICE_NAME: string = 'com-sabre-redapp-example3-web-wf-extension-pricing-web-module-SampleExtPointBeforeAirPrice';
/**
* Adds a sample remark to the user's session. It doesn't add the remark to the PNR.
* The flow is continued.
*
* @param rq input.
*/
async onBeforeAirPrice(rq: CommandMessageAirPriceRq): Promise<ExtPointBeforeAirPriceRqDataResult> {
console.log('THIS WEB REDAPP beforeAirPrice');
await getService(ICommandMessageService).send('5TESTBEFOREAIRPRICE'); (1)
const cmdWithShowRq: CommandMessageRq = { rq: '5TESTREMARKSHOWRQ', showRq: true };
await getService(ICommandMessageService).send(cmdWithShowRq); (2)
const cmdWithShowRqAndShowRs: CommandMessageRq = { rq: '5TESTREMARKSHOWRQSHOWRS', showRq: true, showRs: true };
await getService(ICommandMessageService).send(cmdWithShowRqAndShowRs); (3)
return {
Status: 'CONTINUE'
};
}
}
-
Add a remark.
-
Add a passenger. Request will be visible in GUI because showRq value is set to true.
-
Add a passenger. Both request and response will be visible because showRq and showRs are set to true.
Code invoked in dynamo.air.pricing:afterPricing
/**e
* This class demonstrates how to use the dynamo.air.pricing:afterPricing web extension point.
*/
export class SampleExtPointAfterAirPrice extends AfterAirPriceExtension {
static SERVICE_NAME: string = 'com-sabre-redapp-example3-web-wf-extension-pricing-web-module-SampleExtPointAfterAirPrice';
/**
* Adds a sample remark to the user's session. It doesn't add the remark to the PNR.
* The flow is continued.
*
* @param rs air pricing result.
*/
async onAfterAirPrice(rs: CommandMessageAirPriceRs): Promise<ExtPointResult> {
console.log('THIS WEB REDAPP afterAirPrice');
await getService(ICommandMessageService).send('5TESTAFTERAIRPRICE'); (1)
return {
Status: 'CONTINUE'
};
}
}
-
Add a remark.
Note
|
The value of showRq and showRs variables is 'false' by default. |

Figure 1. Remarks and passengers added in dynamo.air.pricing:beforePricing and dynamo.air.pricing:afterPricing extension points
Note
|
The above features work in Sabre Red 360 only. In SRW 2.0 they do not apply. |