lib/openwfe/expool/expstorage.rb
#
# This method is used by the various implementations of
# find_expressions()
#
This method is used by the various implementations of
find_expressions()
This method is used by the various implementations of find_expressions ()
def does_match? (options, fexp_or_fei)
      wfid = options[:wfid]
      wfid_prefix = options[:wfid_prefix]
      parent_wfid = options[:parent_wfid]
      wfname = options[:wfname]
      wfrevision = options[:wfrevision]
      ic = options[:include_classes]
      ec = options[:exclude_classes]
      ic = Array(ic) if ic
      ec = Array(ec) if ec
      cs = options[:consider_subprocesses]
      ap = options[:applied]
      wi = options[:workitem]
      fexp, fei = if fexp_or_fei.is_a?(FlowExpressionId)
        [ nil, fexp_or_fei ]
      else
        [ fexp_or_fei, fexp_or_fei.fei ]
      end
       let's make it verbose...
       try to put the most demanding checks up front... optimize...
      if fexp
        return false if (ap == true and not fexp.apply_time)
        return false if (ap == false and fexp.apply_time)
        if wi == true
          return false unless fexp.respond_to?(:applied_workitem)
          return false if fexp.applied_workitem == nil
        end
        return false unless class_accepted?(fexp, ic, ec)
      end
      return false \
        if wfname and fei.wfname != wfname
      return false \
        if wfrevision and fei.wfrevision != wfrevision
      return false \
        if cs and fei.sub_instance_id != ''
      return false \
        if wfid and fei.wfid != wfid
      return false \
        if wfid_prefix and not fei.wfid.match("^{wfid_prefix}")
      return false \
        if parent_wfid and not fei.parent_wfid == parent_wfid
      true
    end
def does_match? ( options , fexp_or_fei ) wfid = options [ :wfid ] wfid_prefix = options [ :wfid_prefix ] parent_wfid = options [ :parent_wfid ] wfname = options [ :wfname ] wfrevision = options [ :wfrevision ] ic = options [ :include_classes ] ec = options [ :exclude_classes ] ic = Array ( ic ) if ic ec = Array ( ec ) if ec cs = options [ :consider_subprocesses ] ap = options [ :applied ] wi = options [ :workitem ] fexp , fei = if fexp_or_fei . is_a? ( FlowExpressionId ) [ nil , fexp_or_fei ] else [ fexp_or_fei , fexp_or_fei . fei ] end if fexp return false if ( ap == true and not fexp . apply_time ) return false if ( ap == false and fexp . apply_time ) if wi == true return false unless fexp . respond_to? ( :applied_workitem ) return false if fexp . applied_workitem == nil end return false unless class_accepted? ( fexp , ic , ec ) end return false if wfname and fei . wfname != wfname return false if wfrevision and fei . wfrevision != wfrevision return false if cs and fei . sub_instance_id != '' return false if wfid and fei . wfid != wfid return false if wfid_prefix and not fei . wfid . match ( "^#{wfid_prefix}" ) return false if parent_wfid and not fei . parent_wfid == parent_wfid true end
This method is used by the various implementations of
find_expressions()
This method is used by the various implementations of find_expressions ()
# # let's make it verbose... # # try to put the most demanding checks up front... optimize...
options
<not_specific>
fexp_or_fei
<not_specific>