Guest User

Untitled

a guest
May 28th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. require 'rubygems'
  2. require 'ruote'
  3.  
  4. # preparing the engine
  5.  
  6. engine = Ruote::Engine.new(
  7. Ruote::Worker.new(
  8. Ruote::HashStorage.new))
  9.  
  10. pdef = Ruote.process_definition :name => 'test' do
  11. # literal output
  12. echo 'test'
  13. # top-level variable
  14. echo '${foo}'
  15. # or use f: prefix
  16. echo '${f:foo}'
  17. # variable in a hash?
  18. echo '${f:foo_hash["key"]}'
  19. end
  20.  
  21. # launching, creating a process instance
  22.  
  23. wfid = engine.launch(pdef,
  24. 'foo' => 'bar',
  25. 'foo_hash' => {'key' => 'value'})
  26. engine.wait_for(wfid)
Add Comment
Please, Sign In to add comment