X

Developer Partner Community

How to Ensure Valid User Date Entries in Oracle Intelligent Bots using BotML and a Custom Component by Frank Nimphius

Juergen Kress
PaaS & Middleware Partner Adoption

image

Oracle Intelligent Bots provides a DATE entity that bot designers can use to assign and save dates for later use. Though the DATE entity validates dates by their format, it does not check whether the provided date actually exists.

For example, February 29th only exists in leap years and February 30th does not exist at all. Assigning a date of February 30th is saved as March 2nd, which from a logical perspective appears to be the right thing to do, but from a business perspective may not be what you want.

Given that enforcing valid date entries is important for many businesses, how can you build chatbots that accept date input only if the date really exist? The use of Regular Expression comes to mind, but this is more for detecting valid patterns than a logic that includes leap years and different days in a month. If you cannot use Regular Expressions then the solution obviously needs to be found in JavaScript. A benefit of a JavaScript based solution is hat JavaScript is the programming language of custom components in Oracle Intelligent Bots.

In this article I explain how to create a custom bot component that validates date string entries based on a pre-defined date format and the validness of the actual date. If the date input string has passed validation you can then use the System.MatchEntity built-in component to save the date object in a context variable. Once saved in a context variable, using Apache FreeMarker expressions, you can print the date in any format you like. Sounds interesting? Well it is. Read the complete article here.

 

Developer Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

clip_image003 Blog clip_image005 Twitter clip_image004 LinkedIn image[7][2][2][2] Facebook image Meetups

Technorati Tags: PaaS,Cloud,Middleware Update,WebLogic, WebLogic Community,Oracle,OPN,Jürgen Kress

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.