def remove_process(wfid)

      2.times do
        # two passes

        Thread.pass

        %w[ schedules expressions errors workitems ].each do |type|
          get_many(type, wfid).each { |d| delete(d) }
        end

        doc = get_trackers

        doc['trackers'].delete_if { |k, v| k.end_with?("!#{wfid}") }

        @context.storage.put(doc)
      end
    end
def remove_process(wfid)

      2.times do
        # two passes

        Thread.pass

        %w[ schedules expressions errors workitems ].each do |type|
          get_many(type, wfid).each { |d| delete(d) }
        end

        doc = get_trackers

        doc['trackers'].delete_if { |k, v| k.end_with?("!#{wfid}") }

        @context.storage.put(doc)
      end
    end
Removes a process by removing all its schedules, expressions, errors,
 workitems and trackers.

 Warning: will not trigger any cancel behaviours at all, just removes
 the process.