Skip to content

Instantly share code, notes, and snippets.

puts "Die Biertester betreten den Raum (Initialisierung der Engine).\n\n"
require 'rubygems'
require 'openwfe/engine' # sudo gem install ruote
#
# start engine (not persistent, all workitems are lost after script execution)
#
engine = OpenWFE::Engine.new(:definition_in_launchitem_allowed => true)
@tosch
tosch / lvb.js
Last active August 29, 2015 21:34
CmdUtils.CreateCommand({
names: ["lvb"],
description: "Reiseplanung der Nahverkehrsagentur Sachsen-Anhalt. Achtung: Umlaute funktionieren noch nicht so recht...",
help: "lvb starthaltestelle to endhaltestelle at zeit on datum",
arguments: [
{
role: 'source',
nountype: noun_arb_text,
label: 'Starthaltestelle'
},
<?xml version="1.0" encoding="UTF-8"?>
<process-definition revision="0.1" name="Test">
<cursor>
<participant tag="_1" ref="Anfang"/>
<participant tag="_2" ref="Mitte"/>
<jump if="${field:reject} == true" to="_1"/>
</cursor>
</process-definition>
# require all the libs we need
require 'rubygems'
require 'patron' # fast HTTP client using libcurl
require 'yajl/json_gem' # fast JSON parsing
require 'ruote-kit/client' # the most important bit of all of course ;-)
module RuoteKit
module Client
(in /home/tsc/git/ruote-kit)
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF~~
parent gone for
{"wfid"=>"20100105-bopajojuta", "engine_id"=>"engine", "expid"=>"0_1"}
{"wfid"=>"20100105-bopajojuta", "engine_id"=>"engine", "expid"=>"0"}
["subprocess", {"_triggered"=>"on_cancel", "ref"=>"bail_out"}, []]
~~
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
1)
tsc@raisa:~/git/rk$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
tsc@raisa:~/git/rk$ rake spec
(in /home/tsc/git/rk)
./spec/../lib/ruote-kit.rb:6: warning: already initialized constant VERSION
./spec/helpers/../../lib/ruote-kit.rb:6: warning: already initialized constant VERSION
./spec/views/../../lib/ruote-kit.rb:6: warning: already initialized constant VERSION
........................................................FF...............FFF.F..FFF........
1)
# config/environment.rb
Rails::Initializer.run do |config|
config.gem 'yajl-ruby',
:lib => 'yajl'
config.gem 'ruote'
end
>> pdef = Ruote.process_definition{sequence{workflow_step_one; workflow_step_two}}
=> ["define", {}, [["sequence", {}, [["workflow_step_one", {}, []], ["workflow_step_two", {}, []]]]]]
>> wfid = Ruote.engine.launch pdef
=> "20100127-beposopaya"
>> Ruote.engine.process(wfid)
=> == Ruote::ProcessStatus ==
expressions : 3
0!!20100127-beposopaya : #<Ruote::Exp::SequenceExpression:0xb6937d88>
0_0!!20100127-beposopaya : #<Ruote::Exp::SequenceExpression:0xb69375a4>
0_0_0!!20100127-beposopaya : #<Ruote::Exp::ParticipantExpression:0xb6936dc0>
#--
# Copyright (c) 2010, John Mettraux, jmettraux@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
def remote_definition_allowed!(true_or_false = true)
conf = @storage.get('configurations', 'engine')
conf['remote_definition_allowed'] = true_or_false
@storage.put(conf)
true_or_false
end