Module OpenWFE::FilterMixin
In: lib/openwfe/expressions/filter.rb

This mixin adds filtering capabilities to a FlowExpression.

It‘s used by the ‘participant’ and ‘filter’ expressions.

Methods

Attributes

filter  [RW] 

Public Instance methods

Used when the workitem enters the ‘filtered zone’. Will replace the attributes of the workitem with filtered ones. Assumes the original workitem is kept under @applied_workitem.

[Source]

    # File lib/openwfe/expressions/filter.rb, line 61
61:         def filter_in workitem, filter_attribute_name=:filter
62: 
63:             @filter = get_filter filter_attribute_name, workitem
64: 
65:             return unless @filter
66: 
67:             workitem.attributes = @filter.filter_in workitem.attributes
68:             workitem.filter = @filter.dup
69:         end

Prepares the workitem for leaving the ‘filtered zone’. Makes sure hidden and unwritable fields haven‘t been tampered with. Enforces the ‘add_ok’, ‘remove_ok’, ‘closed’ filter directives. Assumes the original workitem is kept under @applied_workitem.

[Source]

    # File lib/openwfe/expressions/filter.rb, line 77
77:         def filter_out incoming_workitem
78: 
79:             return unless @filter
80: 
81:             incoming_workitem.filter = nil
82: 
83:             incoming_workitem.attributes = @filter.filter_out(
84:                 @applied_workitem.attributes, incoming_workitem.attributes)
85:         end

Protected Instance methods

Fetches the filter pointed at via the ‘filter’ attribute of the including expression class.

[Source]

     # File lib/openwfe/expressions/filter.rb, line 93
 93:             def get_filter filter_attribute_name, workitem
 94: 
 95:                 filter_name = lookup_attribute filter_attribute_name, workitem
 96: 
 97:                 return nil unless filter_name
 98: 
 99:                 lookup_variable filter_name
100:             end

[Validate]