NF9 Boolean Logic Enhancements

From iDempiere en

Feature: Boolean Logic Expression Enhancements

Goal: Development

Developer: Hengsin (talk)

Feature Ticket: IDEMPIERE-4824

Description: Enhancements for boolean logic expressions (readonly, display and mandatory):

  1. Open and Close bracket support to define the evaluation order of logic expression that have multiple and/or combinations.
  2. add NOT ($!), <=, >= and Regular Expression Match (~) operators
  3. add Unit Test Cases for evaluation of boolean logic expressions

Usage of New Features

  1. Use open and close bracket to define evaluation order of expression.
    1. Example: @IsSummary@='N' & (@ProductType@=I | @ProductType@=S)
  2. Not/Negate operator: $!
    1. Example: $!(@IsLot@=Y & @M_LotCtl_ID@ > 0)
    2. Note that we can't use ! as the legacy code have been using it as the not equal operator.
  3. Greater than or equal to operator: >=
    1. Example: @IsLot@=Y& @M_LotCtl_ID@ >= 100
  4. Less than or equal to operator <=
    1. Example: @A_Asset_ID@<=1&@A_CreateAsset@='Y'
  5. Regular Expression Match Operator: ~
    1. Example: @Identifier@ ~ '^([a-zA-Z_$][a-zA-Z\\d_$]*)$'
    2. Note: to avoid parsing issues, always quote your regular expression with ' or ""
    3. It is fix to the format of <Input String> ~ '<Regular Expressions>', i.e you must always put your regular expression after the ~ operator.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.