Condições que comparam instruções

É possível construir condições que comparam e manipulam valores, datas, sequências de texto e atributos numéricos e booleanos (true ou false) de eventos e de entidades.

Os exemplos a seguir ilustram alguns operadores de texto, numéricos e de tempo.

Para visualizar a lista de operadores disponíveis nas regras, consulte Idioma de regra de negócios.

starts with e ends with

É possível utilizar os operadores de texto starts with e ends with para determinar se uma sequência de texto começa ou termina com uma sequência específica de caracteres:

se 
	the maintenance number of 'the customer' starts with “TX” 
então 
	print "redirect the call to call center A"; 
is more than e is less than

É possível utilizar os operadores numéricos is more than e is less than para comparar dois valores numéricos:

se 
	the purchase value of 'the shopping cart' is more than $100 
então 
	print "apply a 10% discount to the value of the shopping cart";
after e before

É possível utilizar os operadores de data e hora after e before, e outros operadores, para comparar pontos no tempo:

definições
set 'the pickup date' to the pickup date of 'the rented car';
set 'the scheduled return date' to the scheduled return date of 'the rented car';
se 
	the return date of 'the rented car' is after 'the pickup date' and before 'the scheduled return date' 
então...

A regra a seguir é aplicável somente quando o agente recebe o evento de retorno.

when a return event occurs, called 'the return'
definições
 set 'the purchase' to a purchase event;
if 'the return' is after the period of 1 week after 'the purchase'
então...

Para obter mais informações sobre comparações de tempo e local, consulte Raciocínio ao longo do tempo e de eventos e Raciocínio sobre locais geográficos.