# BP Travel — Create Flight Quotes from a Batch of Customer Requests
Customer flight-quote requests are collected into a shared work list and each one is raised as a priced quote in the BP Travel web application. For every request the automation fills in the Create Quote form (route, dates, passenger counts, contact details), submits it, and captures the quote reference and total price returned by the system. Each request is then closed off as completed or flagged as an exception for follow-up. A separate supporting routine writes a supplied data set out to an Excel workbook as a report.
## At a glance
| | |
|---|---|
| **Trigger** | Not recorded in the source. The `Create Quotes` process begins with a Start Up routine and then works items from the **Quote Requests** work list (a shared to-do list of pending requests) until none remain — consistent with either a scheduled or manually started run. |
| **Frequency** | Not recorded in the source. |
| **Systems used** | BP Travel web application in Internet Explorer (address held in the environment setting **BP Travel URL**); Microsoft Excel; the **Quote Requests** work list; general file/CSV handling utilities |
| **Inputs** | Excel file of quote requests ("Loads quote requests from an Excel file" — developer's own description of the process); per request: From Airport code, To Airport code, Departing Date (UK format), One Way flag, Returning Date, Adults, Children, Name, Postcode, Telephone, Email; BP Travel credentials (user name defaults to `bp`, password held securely); environment settings **BP Travel URL** and **BP Travel Window Titles** |
| **Outputs** | A Quote Number (quote reference) and Total Price per successful request; each work-list item marked Completed or Exception; (separate routine) an Excel workbook saved to a supplied path, data written from cell **A1** of **Sheet1** with column headings |
| **Typical run** | Not recorded in the source. The run drains the Quote Requests list one item at a time; it self-terminates if the same error occurs on 3 consecutive items. |
| **Owner** | Not recorded in the source. |
## Before you start
- **BP Travel access.** A working login for the BP Travel web application. The stored user name defaults to `bp`; the password is held as a protected value and is not visible in the source.
- **Environment settings configured for the right environment.** Two settings must point at the correct system:
- **BP Travel URL** — the web address the browser opens. The developer notes: *"Different Blue Prism environments may contain different values. e.g. the value in development environment may contain the URL to the test application whilst the value in the production environment will contain the URL of the production environment."*
- **BP Travel Window Titles** — a comma-separated list of acceptable browser window titles. The developer notes: *"The test systems use different window titles to the production system … we use the option (in the attach stage) to attach to a collection of titles."* The automation splits this text on commas before trying to find the window.
- **Internet Explorer** available; the automation attaches to a process named `IEXPLORE`.
- **Microsoft Excel** installed on the machine running the work.
- **The source Excel file of quote requests** in place. Its path, sheet name and column layout are not visible in the source — confirm these with the process owner before a run.
- **The Quote Requests work list** should contain (or be about to be loaded with) the requests to be processed. Confirm who loads it and that yesterday's items are cleared.
- No other Excel instance holding the source or report file open in a way that blocks writing.
## Procedure
### Stage 1 — Start up and load the request batch
1. Start the **Create Quotes** process. It first runs its **Start Up** routine.
2. The developer describes the **Create Quotes** process as a whole as one that *"Loads quote requests from an Excel file and performs updates in the BP Travel system"* — i.e. the request rows originate in an Excel file and are worked as items in the **Quote Requests** work list. Which routine actually reads the Excel file and loads the work list is **not determinable from the source**: the steps inside Start Up are not exposed, so the file path, sheet name and column mapping cannot be stated here either.
### Stage 2 — Launch and log in to BP Travel
1. Open Internet Explorer at the address held in the **BP Travel URL** setting.
2. Wait up to **30 seconds** for the login page to finish loading and the **Log In** button to appear.
- **If it does not appear within 30 seconds**, the automation stops the item with the system error *"Login screen not found"*.
3. Type the user name and password into the login fields and click **Log In**.
4. Wait up to **30 seconds** for one of two outcomes. The developer's note explains: *"This wait stage waits for two outcomes: The Create Quote Link to exist. This confirms we have successfully logged in. An error message that is thrown by the system when the credentials are incorrect."*
- **If the Create Quote link appears** → logged in successfully; continue.
- **If the invalid-credentials error message appears** → raise *"Invalid Log in details"*.
- **If neither appears in 30 seconds** → raise *"Timeout waiting for application to navigate from login screen after entering credentials"*.
5. Before any screen work, the automation confirms it is still connected to the browser. If it is not connected, it re-finds the Internet Explorer window using the titles listed in **BP Travel Window Titles**. If no such window is found, it treats the application as not running.
### Stage 3 — Take the next request from the work list
1. Retrieve the next pending item from the **Quote Requests** work list. Each item carries one customer's trip and contact details.
2. **If an item was returned** (the check is *"Got Item?"* — that an item reference is not blank) → proceed to Stage 4.
**If no item was returned** → the list is empty; the run finishes and moves to clean-up (Stage 9).
### Stage 4 — Navigate to the Create Quote page
1. Wait up to **30 seconds** for the left-hand navigation menu to be present and its page fully loaded.
- **If not found** → system error *"Navigate menu was not found"*.
2. Confirm the **Create Quote** link exists (a short **1-second** check — the developer notes: *"We only need an extra small wait as we know the page is already loaded. We are simply confirming that the link is on the page."*) and click it.
- **If the link is missing** → system error *"Unable to find Create Quote link"*.
*(The same menu routine also supports Search, View Quote, View Booking and Log Out. Only Create Quote and Log Out are used on the path described here.)*
### Stage 5 — Select the airports
1. Wait up to **10 seconds** for the Create Quote form to be loaded.
- **If not found** → system error *"Create Quote screen not found"*.
2. Read every entry from the **From** airport dropdown list.
3. Work down the list, skipping the first, blank entry. Developer's note: *"The first item in the list is null. Ignore it."*
4. Match the requested From airport code against the **three characters immediately preceding the last character** of each list entry — the comparison is `Mid([From Airports.Item Text],Len([From Airports.Item Text])-3,3) = [From Airport]`. This is consistent with list entries that end in a bracketed three-letter code (e.g. "London Heathrow (LHR)"), where the code sits just inside the closing bracket rather than at the very end of the text.
- **If a match is found** → select that entry.
- **If no entry matches** → raise the business exception *"The requested From airport was not available in the From combobox"* and close the item out as an exception (Stage 8).
5. Repeat steps 2–4 for the **To** airport dropdown, with the equivalent error *"The requested To airport was not available in the To combobox"*.
### Stage 6 — Complete the quote form
1. Type the **Departing Date**. Developer's note on this field: *"UK format dates only"* (i.e. DD/MM/YYYY).
2. Set the **One way** checkbox to match the request's One Way flag.
3. **If the request is one-way** → clear the **Returning Date** field (write it blank).
**If the request is a return** → type the **Returning Date** into that field.
4. Enter the remaining passenger and contact details: **Adults**, **Children**, **Name**, **Telephone**, **Email**, **Postcode**.
### Stage 7 — Submit and capture the result
1. Click the **Create Quote** button.
2. Wait up to **30 seconds** for either a quote reference or an on-screen error message to appear.
- **If neither appears** → system error, flagged for a single retry: *"No confirmation or error message was displayed after clicking the Create Quote button"*.
3. Read the quote reference and the displayed total price from the results screen.
4. **If the quote reference is not blank** → convert the displayed total to a number and return **Quote Number** and **Total Price** for the request. (The exact conversion formula is not visible in the source.)
**If the quote reference is blank** → system error, single retry: *"Unable to retrieve Quote Reference after creating quote"*.
5. **If an error message is shown instead** → read the message text from the screen and raise it as a business exception carrying that exact wording (typically a data-validation problem with the request).
### Stage 8 — Close out the work item
1. **On success** → mark the item **Completed** in the **Quote Requests** list.
2. **On failure** → mark the item as an **Exception**, then apply the retry rules:
- **If the failure is a system exception or an internal error** → the item is made available again for another attempt (a fresh item reference is created).
- Otherwise (business exceptions such as an unavailable airport or a validation message) → the item stays as an exception for human follow-up.
3. Consecutive-failure guard: the automation compares each new failure's detail text to the previous one.
- **If the same detail repeats** → increment a counter.
- **If the detail differs** → reset the counter to zero and remember the new detail.
- **If the counter reaches the limit (default 3)** → the whole run is stopped with a terminal error reading *"<limit> consecutive incidents of <exception type>: <detail>"*. Developer's note: *"The consecutive exception limit has been reached, so throw a new exception to terminate the process."*
4. Return to Stage 3 for the next item.
### Stage 9 — Log out and close the browser
1. Check whether the browser session is still attached.
- **If not attached** → nothing to do; finish.
- **If attached** → continue.
2. Click **Log Out** on the left-hand menu, then wait up to **30 seconds** for the Log Out link to disappear.
- **If the Log Out link is already gone**, the error is caught and ignored. Developer's note: *"In case the process hasn't already logged out call the logout link. If the link doesn't exist we have already logged out so handle and ignore the exception and terminate the application."*
3. Close the browser.
4. Why this matters — developer's note: *"To prevent someone being able to take control of the session logged in by a robot terminate the session on clean up. If someone attempts to take control off the robot the process will eventually throw a terminal exception. This will cause the process to fail which will dispose of the object and invoke the Clean Up action."*
### Stage 10 — (Separate routine) Produce the Excel report
This is the standalone **BP Travel - Create Report** process — *"Creates an Excel report with the supplied data collection"*. No caller for it appears in the source, so it is either run on demand or invoked from something outside this package.
1. Given a data set (**Report Data**) and an output file path (**Report Path**), open a new Excel session with automatic events disabled.
2. Create a new blank workbook.
3. Write the data set into worksheet **Sheet1**, starting at cell **A1**, **including the column headings** as the first row.
4. Save the workbook to the supplied **Report Path**.
5. Close the workbook without saving further changes, then close Excel without saving changes.
## Exceptions and recovery
| Condition | What the automation does | What a human should do |
|---|---|---|
| Requested From or To airport code not in the dropdown | Business exception: *"The requested From/To airport was not available in the From/To combobox"*; item left as an exception | Check the airport code on the source request; correct it and resubmit, or confirm BP Travel does not serve that route |
| BP Travel shows a validation error after submitting the form | Reads the on-screen message and raises it verbatim as a business exception | Read the message on the exception, fix the underlying request data (dates, passenger counts, contact details) and resubmit |
| No quote reference appears after clicking Create Quote | System exception, retried once: *"Unable to retrieve Quote Reference after creating quote"* | If it recurs, check manually in BP Travel whether the quote was in fact created before re-running, to avoid duplicates |
| Neither confirmation nor error within 30 seconds of submitting | System exception, retried once: *"No confirmation or error message was displayed after clicking the Create Quote button"* | Check application responsiveness; verify in BP Travel whether the quote exists |
| Browser not running / cannot be attached | *"Unable to attach to BP Travel - is the application running?"* | Confirm Internet Explorer is running with a window title matching the **BP Travel Window Titles** setting; correct the setting if the environment changed |
| Login page not found on launch | *"Login screen not found"* | Verify the **BP Travel URL** setting and that the site is reachable |
| Credentials rejected | *"Invalid Log in details"* | Verify/reset the BP Travel credentials held for the robot |
| Application does not leave the login screen within 30 seconds | *"Timeout waiting for application to navigate from login screen after entering credentials"* | Check application performance and network |
| Navigation menu or a menu link missing | System exception naming the missing element (*"Navigate menu was not found"*, *"Unable to find Create Quote link"*, etc.) | Likely an application change or a slow page; escalate to the automation team if the screen layout has changed |
| Invalid navigation instruction supplied internally | System exception, single retry: *"Invalid input parameter to action, potential configuration error: <value>"* | Escalate — this indicates a configuration or build fault, not a data fault |
| Item fails with a system or internal exception | Item marked as an exception and made available for a retry | Monitor; repeated retries on the same item point to a genuine fault |
| Same failure detail on consecutive items (default limit **3**) | Terminates the entire run with a message listing the repeated error | Investigate the common cause (application down, environment misconfigured, bad batch) before restarting |
| Logout link already gone at clean-up | Caught and ignored; browser is closed anyway | Nothing |
| Excel report: bad session handle, missing workbook, missing worksheet, or missing file | Raises *"Bad Handle"*, *"Workbook Not Found"*, *"Worksheet Not Found"* or *"File Not Found"*, naming the offending item | Check the report path exists and is writable, and that no conflicting workbook is open |
## Data handled
| Item | What it holds | Where it comes from |
|---|---|---|
| **Quote Requests** (work list) | One pending customer quote request per item, each carrying the trip and contact details | Loaded during Start Up from the source Excel file |
| From Airport / To Airport | Three-letter airport codes for the route; matched against the three characters immediately preceding the last character of each dropdown entry (i.e. the code inside a trailing bracket) | Request item |
| Departing Date / Returning Date | Travel dates in **UK format only** (developer's note). Returning Date is blanked for one-way trips | Request item |
| One Way | Flag; drives the One way checkbox and whether Returning Date is entered or cleared | Request item |
| Adults / Children | Passenger counts (both default to 0 if not supplied) | Request item |
| Name, Postcode, Telephone, Email | Customer contact details typed into the quote form | Request item |
| Quote Reference (Quote Number) | The quote identifier read back from BP Travel after successful submission | BP Travel results screen |
| Total Price | The quoted total, read as text and converted to a number | BP Travel results screen |
| Error Message | Validation text shown by BP Travel when the form is rejected; becomes the business-exception message | BP Travel Create Quote screen |
| **BP Travel URL** | Web address of the BP Travel application for this environment | Environment setting |
| **BP Travel Window Titles** | Comma-separated list of acceptable browser window titles; split into a list before attaching | Environment setting |
| User Name / Password | BP Travel login credentials; user name defaults to `bp`, password held as a protected value | Stored configuration |
| Consecutive Exception Limit | Threshold for aborting the run when the same error repeats; default **3** | Process configuration |
| Previous Exception Detail | The text of the last failure, used to decide whether the current failure is "the same" | Set at runtime |
| Report Data / Report Path | The data set to publish and the full output file path for the Excel report | Supplied to the Create Report routine by its caller |
| Wait timeouts | Standard waits used throughout: XXS 0.5s, XS 1s, S 5s, M 10s, L 30s, XL 60s, XXL 120s | Object configuration |
## Not determinable from the source
- Path, sheet name and column layout of the source Excel file of quote requests — the Start Up routine's internals are not exposed.
- Which routine reads the Excel file and loads the **Quote Requests** work list.
- How and when items are loaded into the **Quote Requests** list, and who owns or monitors it.
- Schedule, expected daily volume, and any cut-off times.
- What the **BP Travel - Create Report** output is used for, who receives it, and where **Report Path** points — no caller for this routine appears in the source.
- Whether the captured Quote Numbers and Total Prices are written back to the work list, the source Excel file, or the report.
- The actual BP Travel URL and window titles (held as environment settings; values not in the source).
- How the displayed total price text is converted to a number (the conversion step's formula is not shown).
- Any per-item retry limit — only the consecutive-exception limit of 3 is visible.
- Downstream handling of business exceptions such as unavailable airports — whether a human reworks and resubmits them.
- Whether the **Search**, **View Quote** and **View Booking** menu options are used by any live process; they are built but not called on the path described here.
How this SOP was checked
Generated from the project's source files and audited against them. Audit verdict: minor issues, confidence medium.
Strong, well-traceable coverage of the BP Travel web path: launch/login waits and error texts, left-menu navigation (30s menu wait, 1s link check), Create Quote form fill (airport combos, UK-format departing date, One Way branch blanking/writing Returning Date, passenger/contact fields), submit-and-read of Quote Reference/Total Price, work-item completion/exception handling with the consecutive-exception limit of 3, logout/terminate clean-up, and the standalone BP Travel - Create Report Excel routine (Sheet1, A1, headings included, Save As Report Path, close without saving). Correctly declares as unknown: Start Up internals, source file path/sheet/columns, schedule, report consumer, price-cast formula. Weak points are all in areas the outline does not expose (Start Up, '01 - Navigate to Page', queue get-next-item), where the SOP sometimes states inference as fact.
2 corrections from the audit were applied to the procedure above.
Remaining minor notes, not corrected:
- Stage 2 (Launch and log in) — Presented as a definite step of the run, but the outlined Create Quotes Main Page shows only Start Up, the 'Got Item?' decision and '01 - Navigate to Create Quotes'; no call to Launch or Log In appears. Launch/Log In exist only as pages on the BP Travel - Basic Actions object. (Note that launch and login are capabilities of the BP Travel - Basic Actions object presumed to run inside Start Up; the source does not show where they are called.)
- Stage 2, step 5 (attach check) — The connect/re-attach check is placed after login as a general precaution. In the source the Attach call sits at the start of the BP Travel - Quotes 'Create Quote' action (immediately before the Create Quote screen wait), with 'Unable to attach to BP Travel' raised if it fails. (Move the attach check to the beginning of Stage 5 (before waiting for the Create Quote form) where the source performs it.)
- Stage 3 and Stage 8 step 4 (loop back) — Describes retrieving the next pending item and looping until the list is empty. The outlined Main Page contains no get-next-item stage and no loop; only the decision IF Got Item? ⟨[Item ID]<>""⟩. (State that the outline shows only the 'Got Item?' check on an item reference; the queue-fetch stage and loop-back are inferred and not visible in the source.)
- Stage 8, steps 1-2 (Mark Item As Exception) — Asserts the item is marked Exception and then a fresh item reference is created for system/internal exceptions. The outlined page shows only the retry-type decision (Exception Type = 'system exception' or 'internal'), a New Item ID data item and the consecutive-count logic — no queue 'Mark Exception' or retry call is listed. (Say the page decides retry eligibility on exception type and holds a New Item ID; the actual queue exception/retry calls are not shown in the source.)
- Stage 9, step 2 — Says the automation waits up to 30 seconds 'for the Log Out link to disappear'. The wait condition in the source is HTMLCheckExistsAndDocumentLoaded on the Log Out link (exists and parent document loaded), despite the stage being named 'Wait for Logout to go' — the SOP may have the condition backwards. (Describe the wait as confirming the logged-out page has loaded (check-exists/document-loaded on the Log Out link), noting the ambiguity between stage name and condition; a timeout is caught and the browser is terminated regardless.)
- Stage 6, step 1 — Expands the developer note 'UK format dates only' to 'i.e. DD/MM/YYYY'; the specific mask is not in the source. (Quote the note as-is and mark the exact date mask as unconfirmed.)