TWiki> WebXEO Web>XeoPrimer>XeoPrimerBOL (revision 2)EditAttach
Tags:
create new tag
, view all tags
-- PedroRio - 21 Dec 2010

Business Object Language (BOL)

The Business Object Language is a small expression language to help define conditions for the behavior in XEO Object Models. It allows to reference attribute values, compare them with other values as well as making small calculations

Attributes

Object Model attributes can be referenced in BOL expressions by their name, for example if you want to build the follwing: "If the value of attribute X is bigger than 5, return true" the bol expression would be "if (x > 5) return true". This syntax works for attributes that are not Collection nor Object.

For Object attribute you can refer to their simple attributes by doing attributeObjectName.simpleAttributeName. If you have

A

Functions

DATE FUNCTIONS

NOW - Devolve a data do tipo DD-MM-AAAA (21-12-2010 a 21 de Dezembro de 2010)

TODAY - Devolve de hoje só com a data (ignora o tempo)

NOW_HOURS - Devolve a data de hoje com as horas, (ignora minutos e segundos)

NOW_MINUTES - Devolve a data de hoje com as horas e minutos (ignora os segundos)


NUMBER FUNCTIONS

ROUND - ROUND(Number) - Arredonda o número para o inteiro mais proximo (0.4 -> 0; 0.5 -> 1)


CONCAT (Concatena 2 valores)


  • CONCAT(String,String)
  • CONCAT (Number,Number) - Number pode ser long/int
  • CONCAT (Object,Object) - Concatena tudo como strings (Object.toString())


TO_DATE (Devolve um Date em Java)

  • TO_DATE(Date, Format)
  • TO_DATE (Object, Format), neste caso o Object é convertido em String
  • TO_DATE (long, Format)

O Format tem de ser algo que o SimpleDateFormatter do java entenda, senão não devolve resultado (nem estoira)

O primeiro argumento pode ser (NOW, TODAY, NOW_MINUTES, NOW_HOURS)


SUM

  • SUM ( Number , Number )
  • SUM (Object , Object) - Converts the Object to String


SUBTRACT

  • SUBTRACT (Number, Number)
  • SUBTRACT (Object, Object) - Converts the Object to String


DIFF_IN_DAYS

  • DIFF_IN_DAYS (Date, Date)
  • DIFF_IN_DAY (Date, Long)
  • DIFF_IN_DAY (Long, Date)
  • DIFF_IN_DAY (Long, Long)

Pode-se ter por exemplo DIFF_IN_DAYS (NOW, TO_DATE('DATA_FORMATADA','dd/MM/yyyy'))


DIFF_IN_UTIL_DAYS

IS_NULL (Verifica se um dado valor é null)

Funciona para todos os tipos de attributos excepto collection.

addErrorMessage - Não funciona.

aaa

Edit | Attach | Print version | History: r12 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2010-12-22 - PedroRio
 

No permission to view TWiki.WebTopBar

This site is powered by the TWiki collaboration platform Powered by Perl

No permission to view TWiki.WebBottomBar