# File lib/ruote/fei.rb, line 205
    def self.extract_h(arg)

      if arg.is_a?(Hash)
        return arg if arg['expid']
        return arg['fei'] if arg['fei']
      end

      return extract_h(arg.fei) if arg.respond_to?(:fei)
      return arg.h if arg.is_a?(Ruote::FlowExpressionId)
      return arg.h['fei'] if arg.is_a?(Ruote::Workitem)

      if arg.is_a?(String)

        ss = arg.split('!')

        return {
          'engine_id' => ss[-4] || 'engine',
          'expid' => ss[-3],
          'subid' => ss[-2],
          'wfid' => ss[-1]
        }
      end

      raise ArgumentError.new(
        "couldn't extract fei out of instance of #{arg.class}")
    end