Class Ruote::Exp::IfExpression
In: lib/ruote/exp/fe_if.rb
Parent: FlowExpression

Here are examples of the ‘if’ expression in use :

  _if do
    equals :field_value => 'customer', :other_value => 'British Petroleum'
    participant :ref => 'Allister'
  end

and :

  _if :test => '${f:customer} == British Petroleum' do
    participant :ref => 'Allister'
  end

An else clause is accepted :

  _if do
    equals :field_value => 'customer', :other_value => 'British Petroleum'
    participant :ref => 'Allister'
    participant :ref => 'Bernardo'
  end

or :

  _if :test => '${f:customer} == British Petroleum' do
    participant :ref => 'Allister'
    participant :ref => 'Bernardo'
  end

Note that any expression accepts an :if attribute :

  participant :ref => 'Al', :if => '${f:customer} == British Petroleum'

shorter

It‘s ok to shortcircuit the _if expression like this :

  _if '${f:customer.name} == Fred' do
    subprocess 'premium_course'
    subprocess 'regular_course'
  end

Methods

Public Instance methods

called by ‘else’, ‘then’ or perhaps ‘equals‘

Protected Instance methods

[Validate]