Class Ruote::Exp::DefineExpression
In: lib/ruote/exp/fe_define.rb
Parent: FlowExpression

The main names for this expression are ‘define’ and ‘process_definition’. It simply encloses a process definition (and gives it a name and revision if needed).

  pdef = Ruote.process_definition :name => 'test', :revision => '0' do
    sequence do
      participant :ref => 'alice'
      participant :ref => 'bob'
    end
  end

It‘s used for subprocess definitions as well.

  pdef = Ruote.process_definition :name => 'test', :revision => '0' do
    sequence do
      buy_food
      cook_food
    end
    define 'buy_food' do
      participant :ref => 'alice'
    end
    define :name => 'cook_food' do
      participant :ref => 'bob'
    end
  end

like a sequence

Ruote 2.0 treats the child expressions of a ‘define’ expression like a ‘sequence’ expression does. Thus, this

  pdef = Ruote.process_definition :name => 'test' do
    sequence do
      buy_food
      cook_food
    end
  end

is equivalent to

  pdef = Ruote.process_definition :name => 'test' do
    buy_food
    cook_food
  end

Methods

Public Class methods

Returns true if the tree‘s root expression is a definition (define, process_definition, …)

Used by instances of this class and also the expression pool, when launching a new process instance.

Public Instance methods

[Validate]