# File lib/ruote/exp/flow_expression.rb, line 372
    def do_apply(msg)

      if msg['state'] == 'paused'

        return pause_on_apply(msg)
      end

      if msg['flavour'].nil? && (aw = attribute(:await))

        return await(aw, msg)
      end

      unless Condition.apply?(attribute(:if), attribute(:unless))

        return do_reply_to_parent(h.applied_workitem)
      end

      pi = h.parent_id
      reply_immediately = false

      if attribute(:scope).to_s == 'true'

        h.variables ||= {}
      end

      if attribute(:forget).to_s == 'true'

        h.variables = compile_variables
        h.parent_id = nil
        h.forgotten = true

        reply_immediately = true

      elsif attribute(:lose).to_s == 'true'

        h.lost = true

      elsif msg['flanking'] or (attribute(:flank).to_s == 'true')

        h.flanking = true

        reply_immediately = true
      end

      if reply_immediately and pi

        @context.storage.put_msg(
          'reply',
          'fei' => pi,
          'workitem' => Ruote.fulldup(h.applied_workitem),
          'flanking' => h.flanking)
      end

      filter

      consider_tag
      consider_timers

      apply
    end