def to_h

      %w[
        expressions errors stored_workitems schedules trackers
      ].each_with_object({}) do |a, h|

        k = a == 'stored_workitems' ? 'workitems' : a

        v = self.send(a)
        v = v.collect { |e| e.respond_to?(:h) ? e.h : e }

        h[k] = v
      end
    end
def to_h

      %w[
        expressions errors stored_workitems schedules trackers
      ].each_with_object({}) do |a, h|

        k = a == 'stored_workitems' ? 'workitems' : a

        v = self.send(a)
        v = v.collect { |e| e.respond_to?(:h) ? e.h : e }

        h[k] = v
      end
    end
Outputs the process status as a hash (easily JSONifiable).