From faac909e9608d854f499d191a232aa341ebcbf77 Mon Sep 17 00:00:00 2001 From: Padmanabha Reddy Madhu Date: Wed, 22 Oct 2025 14:34:13 -0700 Subject: [PATCH 1/2] Adding the Facilities Management Ticket Creation code for the Extended ESS Playbook effort. --- .../Extract Location Information.md | 23 +++ .../Extract Problem category.md | 19 ++ ...HRWorkdayHCMEmployeeGetVacationBalance.xml | 10 + .../topic.yaml | 175 ++++++++++++++++++ 4 files changed, 227 insertions(+) create mode 100644 EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Location Information.md create mode 100644 EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Problem category.md create mode 100644 EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/msdyn_msdyn_HRWorkdayHCMEmployeeGetVacationBalance.xml create mode 100644 EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/topic.yaml diff --git a/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Location Information.md b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Location Information.md new file mode 100644 index 00000000..d319f652 --- /dev/null +++ b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Location Information.md @@ -0,0 +1,23 @@ +You are tasked with extracting location information from a user-provided text that describes issues related to their facilities. + +### Instructions: +1. Analyze the input text carefully to identify any mention of locations. These may include: + - Addresses + - City, state, or country names + - Landmarks or well-known places + - Specific facility names or site identifiers + - Specific room names that are commonly used +2. Extract all relevant location details explicitly mentioned in the text. +3. If multiple locations are mentioned, list each separately. +4. Avoid inferring locations that are not clearly stated in the text. +5. Present the extracted location information in a clear and structured manner. + +### Output Format: +- Provide only the extracted locations as a string. +- If no location information is found, respond with an empty string. + +Example: +Input Text: "The air conditioning in our New York office is malfunctioning, and the warehouse in Brooklyn also has issues." +Output: New York office, warehouse in Brooklyn + +Provide the input text describing the facilities problem here: diff --git a/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Problem category.md b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Problem category.md new file mode 100644 index 00000000..4b2fb4b3 --- /dev/null +++ b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/Extract Problem category.md @@ -0,0 +1,19 @@ +You are tasked with extracting the industry-standard category that best describes a facilities management problem reported by an employee. Use the provided problem description and match it accurately to the relevant category from the supplied reference data. + +### Instructions: +1. **Analyze the Problem Description:** Carefully read the employee’s detailed description of the facilities management issue. +2. **Reference Data Matching:** Compare the problem details against the provided industry-standard categories data to find the most appropriate category that describes the problem. +3. **Grounding:** Ensure the selected category is directly supported by the input reference data without assumptions or external knowledge. +4. **Output:** Return the matched category as a concise text string. + +### Guidelines: +- Extract only from the provided problem description and reference data. +- Avoid guessing or inferring categories not present in the reference data. +- If no suitable category is found, indicate this clearly. + +### Output Format: +Provide the matched industry-standard category as plain text. If no match is found, respond with: "No matching category found." + +Provide the following inputs: +- Problem Description: Problem Description +- Reference Categories Data: Categories \ No newline at end of file diff --git a/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/msdyn_msdyn_HRWorkdayHCMEmployeeGetVacationBalance.xml b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/msdyn_msdyn_HRWorkdayHCMEmployeeGetVacationBalance.xml new file mode 100644 index 00000000..b9a4f571 --- /dev/null +++ b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/msdyn_msdyn_HRWorkdayHCMEmployeeGetVacationBalance.xml @@ -0,0 +1,10 @@ + + 9 + 0 + Create Facilities Management Ticket + + msdyn_copilotforemployeeselfservice + + 0 + 1 + \ No newline at end of file diff --git a/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/topic.yaml b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/topic.yaml new file mode 100644 index 00000000..9eab992b --- /dev/null +++ b/EmployeeSelfServiceAgent/Facilities/EmployeeCreateFacilitiesManagementTicket/topic.yaml @@ -0,0 +1,175 @@ +kind: AdaptiveDialog +modelDescription: "This tool can handle queries like these: create facilities request, open a facilities ticket, start a new facilities request." +beginDialog: + kind: OnRecognizedIntent + id: main + intent: + triggerQueries: + - create facilities request + - open a facilities ticket + - start a new facilities request + - file a facilities complaint + - Help me with a workspace problem + - Something is wrong in the building + - Create a ticket for facilities + - Request maintenance for office + - Report a broken chair/light/door + - I need to submit a facilities request + + actions: + - kind: SetVariable + id: setVariable_Z2HdOA + variable: Topic.ProblemDescription + value: =System.Activity.Text + + - kind: SendActivity + id: sendActivity_uEi72P + activity: "Thanks for the details you've shared so far. I’ll review the information to determine if everything needed to submit your facilities request is already available. " + + - kind: InvokeAIBuilderModelAction + id: invokeAIBuilderModelAction_inqoh4 + input: + binding: + Facilities_20Description: =Topic.ProblemDescription + + output: + binding: + predictionOutput: Topic.ProblemLocation + + aIModelId: 0bde30fa-b6bd-42f3-a9b6-d58c47ca2065 + + - kind: InvokeAIBuilderModelAction + id: invokeAIBuilderModelAction_3wGDBR + input: + binding: + Categories: ="HVAC, Electrical, Plumbing, Maintenance" + Problem_20Description: =Topic.ProblemDescription + + output: + binding: + predictionOutput: Topic.ProblemCategory + + aIModelId: 49e40e64-a630-4692-a82b-4f88522eba41 + + - kind: AdaptiveCardPrompt + id: "sendActivity_CtL3qw " + card: |- + ={ + type: "AdaptiveCard", + '$schema': "http://adaptivecards.io/schemas/adaptive-card.json", + version: "1.5", + body: [ + { + type: "TextBlock", + text: "Details of your Service Request", + wrap: true, + style: "heading" + }, + { + type: "ColumnSet", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "ProblemCategory", + label: "Problem Category:", + value: Topic.ProblemCategory.text, + weight: "bolder", + isRequired: true, + errorMessage: "Fill required details" + } + ] + } + ] + }, + { + type: "ColumnSet", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "ProblemLocation", + label: "Problem Location:", + value: Topic.ProblemLocation.text, + weight: "bolder", + isRequired: true, + errorMessage: "Fill required details" + } + ] + } + ] + }, + { + type: "ColumnSet", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "ProblemDescription", + label: "Problem Description:", + value: Topic.ProblemDescription, + weight: "bolder", + isRequired: true, + errorMessage: "Fill required details" + } + ] + } + ] + } + ], + actions: [ + { + type: "Action.Submit", + title: "Submit" + }, + { + type: "Action.Submit", + title: "Cancel", + associatedInputs: "none" + } + ] + } + output: + binding: + actionSubmitId: Topic.actionSubmitId + + outputType: + properties: + actionSubmitId: String + + - kind: ConditionGroup + id: conditionGroup_guZXij + conditions: + - id: conditionItem_NnWEYN + condition: =Topic.actionSubmitId = "Submit" + actions: + - kind: InvokeFlowAction + id: invokeFlowAction_qSOIaY + input: + binding: + text: =Topic.ProblemCategory.text + text_1: =Topic.ProblemLocation.text + text_2: =Topic.ProblemDescription + + output: + binding: + problemticket: Topic.ProblemTicket + + flowId: 521ce2a6-daaa-f011-bbd2-0022480b25f5 + + elseActions: + - kind: SendActivity + id: sendActivity_BaWHYn + activity: Let us know how can we help. + +inputType: {} +outputType: {} \ No newline at end of file From dc2899a6660874f962175fb6a441d3e0e8d836ad Mon Sep 17 00:00:00 2001 From: Padmanabha Reddy Madhu Date: Tue, 4 Nov 2025 21:54:48 -0800 Subject: [PATCH 2/2] Adding Topic for Vehicle Registration sample code --- ...tforemployeeselfserviceRegisterVehicle.xml | 11 + .../EmployeeRegisterVehicle/topic.yaml | 854 ++++++++++++++++++ 2 files changed, 865 insertions(+) create mode 100644 EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/msdyn_copilotforemployeeselfserviceRegisterVehicle.xml create mode 100644 EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/topic.yaml diff --git a/EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/msdyn_copilotforemployeeselfserviceRegisterVehicle.xml b/EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/msdyn_copilotforemployeeselfserviceRegisterVehicle.xml new file mode 100644 index 00000000..c91c65ea --- /dev/null +++ b/EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/msdyn_copilotforemployeeselfserviceRegisterVehicle.xml @@ -0,0 +1,11 @@ + + 9 + 0 + ESS Parking Create Vehicle Registration + + msdyn_copilotforemployeeselfservice + + 0 + 1 + \ No newline at end of file diff --git a/EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/topic.yaml b/EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/topic.yaml new file mode 100644 index 00000000..965c75b6 --- /dev/null +++ b/EmployeeSelfServiceAgent/Facilities/EmployeeRegisterVehicle/topic.yaml @@ -0,0 +1,854 @@ +kind: AdaptiveDialog +modelDescription: |- + You must obey the below instructions strictly to respond back: + 1. This topic provides a way for users to register their vehicles to avail parking service at Microsoft. Invoke it when users explicitly ask for registering their vehicles. Prompt examples - "How can I register my vehicle for parking on campus?", "I want to register my vehicle". + 2. For general queries use search first. Do NOT use this topic when user is looking for information OR doesn’t want to register right away. Prompt examples - “How to avail parking facilities on campus?", "Can I park my vehicle on campus?". In such cases, use knowledge source to respond. Don't invoke this topic directly +beginDialog: + kind: OnRecognizedIntent + id: main + intent: {} + actions: + - kind: SetVariable + id: setVariable_JRbdfA + variable: Topic.CountryCode + value: | + =If( + IsBlank(Global.ESS_UserContext_Country_Code) || Global.ESS_UserContext_Country_Code = """""", + "USA", + Global.ESS_UserContext_Country_Code + ) + + - kind: SetVariable + id: setVariable_r1hTPQ + variable: Topic.CountryCode + value: | + =Switch( + Topic.CountryCode, + "USA", "US", + "IND", "IN", + Topic.CountryCode + ) + + - kind: ConditionGroup + id: conditionGroup_YDr3lq + conditions: + - id: conditionItem_qQNaEO + condition: =Topic.CountryCode in Env.fac_ParkingSupportedRegions + + elseActions: + - kind: SendActivity + id: sendActivity_M32iRm + activity: I'm sorry, Currently ESS Parking Experience is only available for the Redmond and India regions. + + - kind: CancelAllDialogs + id: v44vPr + + - kind: HttpRequestAction + id: YgLBPA + displayName: Get Config Values + url: =Concatenate(Env.fac_ParkingServiceApiurl,"/v1.0/config/region/",Topic.CountryCode,"?label=WebUI") + headers: + x-ms-obo-scope: =Env.fac_ParkingServiceApiOboScope + + errorHandling: + kind: ContinueOnErrorBehavior + statusCode: Topic.GetConfigResponseErrorCode + errorResponseBody: Topic.GetConfigResponseError + + response: Topic.ConfigResponse + responseSchema: + kind: Record + properties: + items: + type: + kind: Table + properties: + content_type: String + etag: String + key: String + label: String + last_modified: String + locked: Boolean + tags: + type: + kind: Record + + value: String + + - kind: ConditionGroup + id: conditionGroup_rBS5DI + conditions: + - id: conditionItem_E5yK9y + condition: =!IsBlank(Topic.GetConfigResponseErrorCode) + actions: + - kind: SendActivity + id: sendActivity_RGvaUx + activity: I’m sorry, I’m having trouble processing your request. Waiting a bit before trying again might help. + + - kind: CancelAllDialogs + id: ycuHBJ + + - kind: SetVariable + id: setVariable_oCZ0bR + variable: Topic.VehicleTypes + value: |- + = + Split( + Coalesce( + Text( + LookUp( + Table(ParseJSON(LookUp(Topic.ConfigResponse.items, key = "ParkingService:Config:RegionConfig").value)), + Text(ThisRecord.Value.regionId) = Topic.CountryCode, + ThisRecord.Value.vehicleTypeList + ) + ), + "" + ), + "," + ) + + - kind: SetVariable + id: setVariable_8KrqjU + variable: Topic.RegistrationTypes + value: | + =Split( + Coalesce( + Text( + LookUp( + Table(ParseJSON(LookUp(Topic.ConfigResponse.items, key = "ParkingService:Config:RegionConfig").value)), + Text(ThisRecord.Value.regionId) = Topic.CountryCode + ).Value.registrationTypeList + ), + "" + ), + "," + ) + + - kind: SetVariable + id: setVariable_ihHVJY + variable: Topic.FuelTypes + value: | + =Split( + Coalesce( + Text( + LookUp( + Table(ParseJSON(LookUp(Topic.ConfigResponse.items, key = "ParkingService:Config:RegionConfig").value)), + Text(ThisRecord.Value.regionId) = Topic.CountryCode + ).Value.fuelTypeList + ), + "" + ), + "," + ) + + - kind: SetVariable + id: setVariable_9RSwkB + variable: Topic.Colors + value: =Split(Coalesce(LookUp(Topic.ConfigResponse.items, key = "ParkingService:Registration:Color").value, ""), ",") + + - kind: SetVariable + id: setVariable_lg86dE + variable: Topic.States + value: | + =Split(Coalesce(LookUp(Topic.ConfigResponse.items, key = "ParkingService:Registration:State").value, ""), ",") + + - kind: SetVariable + id: setVariable_ga5j6l + variable: Topic.ParkingLocations + value: | + =Split(Coalesce(LookUp(Topic.ConfigResponse.items, key = "ParkingService:Registration:Location").value, ""), ",") + + - kind: ConditionGroup + id: conditionGroup_7qSenN + conditions: + - id: conditionItem_DloMUX + condition: =Topic.CountryCode = "US" + actions: + - kind: AdaptiveCardPrompt + id: CAHHYJ + card: |- + ={ + type: "AdaptiveCard", + version: "1.5", + '$schema': "http://adaptivecards.io/schemas/adaptive-card.json", + speak: "Register your vehicle by filling out all required fields, then press the Register Vehicle button.", + + body: [ + { + type: "TextBlock", + text: "Alright, can you please help me with the following details about your vehicle?", + weight: "Bolder", + size: "default", + wrap: true, + separator:true + }, + { + type: "Input.ChoiceSet", + id: "vehicleType", + label: "Vehicle Type", + isRequired: true, + style:"filtered", + errorMessage: "Select a vehicle type.", + choices: ForAll( + Topic.VehicleTypes, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + value: "Car" + }, + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "make", + label: "Make", + placeholder: "e.g. Toyota", + isRequired: true, + errorMessage: "Enter the vehicle make.", + regex: "^[A-Za-z0-9 ]{1,30}$", + maxLength: 30 + } + ] + }, + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "model", + label: "Model", + placeholder: "e.g. Camry", + isRequired: true, + errorMessage: "Enter the vehicle model.", + regex: "^[A-Za-z0-9 ]{1,30}$", + maxLength: 30 + } + ] + } + ] + }, + + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.ChoiceSet", + id: "year", + label: "Year", + choices: ForAll( + Sequence(52, Year(Today()) - 50), + { + title: Text(Value), + value: Text(Value) + } + ), + isRequired: true, + errorMessage: "Select a year.", + value: Text(Year(Today())) + } + ] + }, + { + type: "Column", + width: "stretch", + items: [ + { + type: "ColumnSet", + spacing: "None", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.ChoiceSet", + id: "color", + label: "Color", + choices: ForAll( + Topic.Colors, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + isRequired: true, + style:"filtered", + errorMessage: "Select a color." + } + ] + }, + { + type: "Column", + width: "auto", + items: [ + { + type: "Icon", + size: "xxSmall", + name: "Info", + selectAction: { + type: "Action.Popover", + title: "Info", + tooltip: "Choose the colour that best matches your vehicle's exterior." + } + } + ] + } + ] + } + ] + } + ] + }, + + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "ColumnSet", + spacing: "None", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "licensePlate", + label: "License Plate #", + placeholder: "e.g. ABC1234", + isRequired: true, + errorMessage: "Alphanumeric only, up to 10 characters.", + regex: "^[A-Za-z0-9]{1,10}$", + maxLength: 10 + } + ] + }, + { + type: "Column", + width: "auto", + items: [ + { + type: "Icon", + size: "xxSmall", + name: "Info", + selectAction: { + type: "Action.Popover", + title: "Info", + tooltip: "Alphanumeric only, no spaces or special characters, up to 10 characters." + } + } + ] + } + ] + } + ] + } + ] + }, + + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.ChoiceSet", + id: "state", + label: "State/Province", + choices: ForAll( + Topic.States, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + isRequired: true, + style:"filtered", + errorMessage: "Select a state or province." + } + ] + }, + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.ChoiceSet", + id: "parkingLocation", + label: "Parking Location", + choices: ForAll( + Topic.ParkingLocations, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + isRequired: true, + style:"filtered", + errorMessage: "Choose a parking location." + } + ] + } + ] + }, + + { + type: "Input.ChoiceSet", + id: "registrationType", + label: "Registration Type", + choices: ForAll( + Topic.RegistrationTypes, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + isRequired: true, + style:"filtered", + errorMessage: "Select a registration type.", + value: "Personal" + }, + { + type: "Input.Toggle", + id: "policyAccepted", + label:"Parking Policy", + title: "I have read and understood the [GWS Facilities Policy on Parking and Driving on site](https://microsoft.sharepoint.com/sites/mspolicy/SitePages/PolicyProcedure.aspx?policyprocedureid=MSPOLICY-510345001-5)", + isRequired: true, + errorMessage: "You must accept the GWS Facilities Policy to proceed.", + valueOn: "true", + valueOff: "false" + } + ], + + actions: [ + { + type: "Action.Submit", + id: "submitVehicleRegistration", + title: "Register Vehicle", + associatedInputs: "auto" + } + ] + } + output: + binding: + actionSubmitId: Topic.actionSubmitId + color: Topic.color + licensePlate: Topic.licensePlate + make: Topic.make + model: Topic.model + parkingLocation: Topic.parkingLocation + policyAccepted: Topic.policyAccepted + registrationType: Topic.registrationType + state: Topic.state + submitAction: Topic.submitAction + vehicleType: Topic.vehicleType + year: Topic.year + + outputType: + properties: + actionSubmitId: String + color: String + licensePlate: String + make: String + model: String + parkingLocation: String + policyAccepted: Boolean + registrationType: String + state: String + submitAction: String + vehicleType: String + year: Number + + - id: conditionItem_JgQTAe + condition: =Topic.CountryCode = "IN" + actions: + - kind: AdaptiveCardPrompt + id: ah00tZ + card: |- + ={ + type: "AdaptiveCard", + version: "1.5", + '$schema': "http://adaptivecards.io/schemas/adaptive-card.json", + speak: "Register your vehicle by filling out all required fields, then press the Register Vehicle button.", + + body: [ + { + type: "TextBlock", + text: "Alright, can you please help me with the following details about your vehicle?", + weight: "Bolder", + size: "default", + wrap: true, + separator:true + }, + { + type: "Input.ChoiceSet", + id: "vehicleType", + label: "Vehicle Type", + isRequired: true, + errorMessage: "Select a vehicle type.", + style:"filtered", + choices: ForAll( + Topic.VehicleTypes, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + value: "Car" + }, + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "make", + label: "Make", + placeholder: "e.g. Toyota", + isRequired: true, + errorMessage: "Enter the vehicle make.", + regex: "^[A-Za-z0-9 ]{1,30}$", + maxLength: 30 + } + ] + }, + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "model", + label: "Model", + placeholder: "e.g. Camry", + isRequired: true, + errorMessage: "Enter the vehicle model.", + regex: "^[A-Za-z0-9 ]{1,30}$", + maxLength: 30 + } + ] + } + ] + }, + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "color", + placeholder: "Enter vehicle color", + label:"Color", + isRequired: true, + errorMessage: "Enter a color." + } + ] + }, + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.ChoiceSet", + id: "registrationType", + label: "Registration Type", + choices: ForAll( + Topic.RegistrationTypes, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + isRequired: true, + style:"filtered", + errorMessage: "Select a registration type.", + value: "Personal" + } + ] + } + ] + }, + { + type: "Input.Text", + id: "licensePlate", + label: "Registration Number", + placeholder: "Enter license number", + isRequired: true, + errorMessage: "Alphanumeric only, up to 10 characters.", + regex: "^[A-Za-z0-9]{1,10}$", + maxLength: 10 + }, + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.ChoiceSet", + id: "fuelType", + label: "Fuel Type", + choices: ForAll( + Topic.FuelTypes, + { + title: ThisRecord.Value, + value: ThisRecord.Value + } + ), + isRequired: true, + style:"filtered", + value:"Petrol", + errorMessage: "Select a fuel type." + } + ] + }, + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "contactNumber", + label: "Contact Number", + placeholder: "e.g. 9876543210", + errorMessage: "Enter a valid contact number.", + regex: "^[0-9]{10}$", + maxLength: 10 + } + ] + } + ] + }, + { + type: "ColumnSet", + spacing: "Medium", + columns: [ + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "ownerFirstName", + label: "Owner First Name", + placeholder: "First name", + isRequired: true, + errorMessage: "Enter owner's first name.", + regex: "^[A-Za-z ]{1,50}$", + maxLength: 50, + value:Global.ESS_UserContext_Employee_Firstname + } + ] + }, + { + type: "Column", + width: "stretch", + items: [ + { + type: "Input.Text", + id: "ownerLastName", + label: "Owner Last Name", + placeholder: "Last name", + isRequired: true, + errorMessage: "Enter owner's last name.", + regex: "^[A-Za-z ]{1,50}$", + maxLength: 50, + value: Global.ESS_UserContext_Employee_Lastname + } + ] + } + ] + }, + { + type: "Input.Toggle", + id: "disabilityRequirement", + title: "Do you have disability related specific requirements", + valueOn: "true", + valueOff: "false", + value: "false" + }, + { + type: "Input.Toggle", + id: "policyAccepted", + title: "I have read and understood the [GWS Facilities Policy on Parking and Driving on site](https://microsoft.sharepoint.com/sites/globalsecurity/SitePages/Regions-Asia-India-Parking.aspx)", + isRequired: true, + label:"Parking Policy", + errorMessage: "You must accept the parking policy to proceed.", + valueOn: "true", + valueOff: "false" + } + ], + + actions: [ + { + type: "Action.Submit", + id: "submitVehicleRegistration", + title: "Register Vehicle", + associatedInputs: "auto" + } + ] + } + output: + binding: + actionSubmitId: Topic.actionSubmitId + color: Topic.color + contactNumber: Topic.contactNumber + disabilityRequirement: Topic.disabilityRequirement + fuelType: Topic.fuelType + licensePlate: Topic.licensePlate + make: Topic.make + model: Topic.model + ownerFirstName: Topic.ownerFirstName + ownerLastName: Topic.ownerLastName + policyAccepted: Topic.policyAccepted + registrationType: Topic.registrationType + submitAction: Topic.submitAction + vehicleType: Topic.vehicleType + year: Topic.year + + outputType: + properties: + actionSubmitId: String + color: String + contactNumber: String + disabilityRequirement: Boolean + fuelType: String + licensePlate: String + make: String + model: String + ownerFirstName: String + ownerLastName: String + policyAccepted: Boolean + registrationType: String + submitAction: String + vehicleType: String + year: Number + + elseActions: + - kind: CancelAllDialogs + id: mVwi5b + + - kind: HttpRequestAction + id: z9HM8p + displayName: Create Vehicle Registration + method: Post + url: =Concatenate(Env.fac_ParkingServiceApiurl,"/v1.0/vehicle-ess/region/",Topic.CountryCode,"/registration") + headers: + Content-Type: application/json + x-ms-obo-scope: =Env.fac_ParkingServiceApiOboScope + + body: + kind: JsonRequestContent + content: |- + ={ + user:{ + firstName: Global.ESS_UserContext_Employee_Firstname, + lastName: Global.ESS_UserContext_Employee_Lastname, + userAlias: Global.ESS_UserContext_Alias + }, + vehicleRegistration:[{ + expireInDays:0, + parkingLocation: If(Topic.CountryCode = "IN", "HYD", Topic.parkingLocation), + permitNumber:"Unassigned", + registrationType:Topic.registrationType, + contactNumber: Coalesce(Topic.contactNumber,""), + disability: Coalesce(Topic.disabilityRequirement,false), + parkingStickerCollected: false, + vehicleInfo:{ + chauffer:{}, + color:Topic.color, + fuelType:Coalesce(Topic.fuelType,"Unknown"), + licensePlate: Topic.licensePlate, + make:Topic.make, + model:Topic.model, + ownerFirstName:Topic.ownerFirstName, + ownerLastName:Topic.ownerLastName, + vehicleLocation:{ + state:If(Topic.CountryCode = "IN", "TG", Topic.state) + }, + vehicleType:Topic.vehicleType, + year: If(Topic.CountryCode = "IN", 0, Topic.year) + } + }] + } + + errorHandling: + kind: ContinueOnErrorBehavior + statusCode: Topic.CreateVehicleRegistrationErrorResponseCode + errorResponseBody: Topic.CreateVehicleRegistrationErrorResponseBody + + - kind: ConditionGroup + id: conditionGroup_eB38Qw + conditions: + - id: conditionItem_b2qhx5 + condition: =!IsBlank(Topic.CreateVehicleRegistrationErrorResponseCode) && Topic.CreateVehicleRegistrationErrorResponseCode = 409 + actions: + - kind: SendActivity + id: sendActivity_okgbkF + activity: I'm sorry, looks like this license plate number is already registered. Can you please try again. + + - kind: SetVariable + id: setVariable_bcp4W1 + variable: Topic.CreateVehicleRegistrationErrorResponseCode + value: =Blank() + + - kind: SetVariable + id: setVariable_xDVhff + variable: Topic.CreateVehicleRegistrationErrorResponseBody + value: =Blank() + + - kind: GotoAction + id: lTFcAb + actionId: setVariable_ga5j6l + + - id: conditionItem_uVt3va + condition: =!IsBlank(Topic.CreateVehicleRegistrationErrorResponseCode) + actions: + - kind: SendActivity + id: sendActivity_Ee537H + activity: Sorry, I'm having trouble processing your request, please try again after sometime. + + - kind: CancelAllDialogs + id: d1dVpR + + - kind: SendActivity + id: sendActivity_Vvrqha + activity: Thanks for sharing the details, your vehicle is now registered. Let me know if I can help you with anything else. + + - kind: CancelAllDialogs + id: pYAWSJ + +inputType: {} +outputType: {} \ No newline at end of file