article by Frank Nimphius, September 2020

 

Bag items added to a composite bag entity cannot be reordered. Still you can change the order in which bag items get displayed to a user in a chatbot conversation. In this article I explain how you can change the order in BotML using a relatively unknown property, entityOrder, that exists for the CommonResponse and ResolveEntities components.

The composite bag entity in the image below defines a booking order confirmation domain object I did mockup for this article. 

In the above image, notice the order of the bag items to be: Address, EMail, TicketingDate, Vegetarian. When this composite bag entity gets resolved at runtime using the System.RespolveEntities or the System.CommonResponse component, then the following conversation gets printed. 

No assume you don't want this order. Instead you want to first print for the TicketingDate, then for EMail and then for Address and the Vegetarian meal.

To accomplish this, you use the entityOrder property that exists on the System.CommonResponse and the System.ResolveEntity components as shown in the images below

System.ResolveEntities

System.CommonResponseComponent

 The conversation that results out of this property settings (for the example) is shown in the image below

The entityOrder property ensures bag items are printed in the specified order. Any bag item you don't list in the entityOrder property will be appended to the defined list in the order they appear in the composite bag entity.

What to watch out for

By default, all bag items have the out-of-order extraction feature enabled. This can however lead to false positive extractions. For example, the Address entity may interpret June 22 as a valid address. So when you change the order of how bag items get resolved you may need to unset out-of-order extraction or restrict it to a specific bag item that would not cause a conflict.

 

Related Content

TechExchange Quick-Tip: How to Intelligently Cancel Composite Bag Entity Driven User Dialog Flows

TechExchange Quick-Tip: Setting Composite Bag Entity Item Values From A Custom Component

TechExchange: How-to Use the System.ResolveEntities Component in Oracle Digital Assistant

TechExchange Quick-Tip: Solving the Riddle of the Unresolved DATE Bag Item in Composite Bag Entities

TechExchange: Building Model Driven Questionnaire Conversations Using Composite Bag Entities in Oracle Digital Assistant

TechExchange Quick-Tip: Understanding Oracle Digital Assistant Skill Entity Properties – Or, What Does "Fuzzy Match" Do?

TechExchange: Use Entities To Build Powerful, Robust And Speech-Ready Action Menus

TechExchange: All 2-Minutes Oracle Digital Assistant Tech Tip Videos on YouTube

Author