def clear

      %w[ msgs schedules errors expressions workitems ].each do |type|
        purge_type!(type)
      end
    end
def clear

      %w[ msgs schedules errors expressions workitems ].each do |type|
        purge_type!(type)
      end
    end
Used when doing integration tests, removes all
 msgs, schedules, errors, expressions and workitems.

 NOTE that it doesn't remove engine variables (danger)