PrevTopNext

DSL for Operator Order Processing (3)

Knack #4: Create sub-phrases for restrictions.

DRL:
    $order: OperatorOrder( $code: code, $id1: elId1, $id2: elId2, $opId: opId )
    $operator: Operator( id == $opId )
    CommandCode( code == $code, 
                 operands != ($id1 != null ? ($id2 != null ? 2 : 1) : 0) )

English:
...with an incorrect number of operands.

DSL definition:
[when]- with an incorrect number of elements=
      operands != ($id1 != null ? ($id2 != null ? 2 : 1) : 0) )

PrevTopNext