Class OpenWFE::FilterExpression
In: lib/openwfe/expressions/fe_filter.rb
Parent: FlowExpression

This expression applies a filter to the workitem used by the process segment nested within it.

    class TestFilter48a0 < ProcessDefinition
        sequence do

            set :field => "readable", :value => "bible"
            set :field => "writable", :value => "sand"
            set :field => "randw", :value => "notebook"
            set :field => "hidden", :value => "playboy"

            alice

            filter :name => "filter0" do
                sequence do
                    bob
                    charly
                end
            end

            doug
        end

        filter_definition :name => "filter0" do
            field :regex => "readable", :permissions => "r"
            field :regex => "writable", :permissions => "w"
            field :regex => "randw", :permissions => "rw"
            field :regex => "hidden", :permissions => ""
        end
    end

In this example, the filter ‘filter0’ is applied upon entering bob and charly‘s sequence.

Please note that the filter will not be enforced between bob and charly, it is enforced just before entering the sequence and just after leaving it.

Note also that the ParticipantExpression accepts a ‘filter’ attribute, thus :

    <filter name="filter0">
        <participant ref="toto" />
    </filter>

can be simplified to :

    <participant ref="toto" filter="filter0" />

Methods

apply   reply  

Included Modules

FilterMixin

Attributes

applied_workitem  [RW] 
filter  [RW] 

Public Instance methods

[Source]

     # File lib/openwfe/expressions/fe_filter.rb, line 105
105:         def apply workitem
106: 
107:             if @children.length < 1
108:                 reply_to_parent workitem
109:                 return
110:             end
111: 
112:             @applied_workitem = workitem.dup
113:             filter_in workitem, :name
114: 
115:             store_itself
116: 
117:             get_expression_pool.apply @children[0], workitem
118:         end

[Source]

     # File lib/openwfe/expressions/fe_filter.rb, line 120
120:         def reply workitem
121: 
122:             filter_out workitem
123: 
124:             reply_to_parent workitem
125:         end

[Validate]