Skip to content

Instantly share code, notes, and snippets.

@netinlet
Created March 26, 2012 17:36
Show Gist options
  • Save netinlet/2207156 to your computer and use it in GitHub Desktop.
Save netinlet/2207156 to your computer and use it in GitHub Desktop.
ruote history
module Ruote
class StorageHistory
def steps_by_process(wfid)
# which ones were 'executed' - filters out items like setting up sequence and concurrence steps
all_expressions = self.by_process(wfid)
dispatched_expressions = all_expressions.select{|flow_expr| 'dispatched' == flow_expr["action"]}
# for all the flow_expressions, get the name and order by sorting by the original timestamp
dispatched_expressions.map do |flow_expr|
[flow_expr['participant_name'], flow_expr["original_put_at"]]
end.sort{|a,b| a.last <=> b.last}.map{|exp| exp.first}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment