Hi again,
Doing a little more debugging, I added the following in subprocess.rb in
self.lookup_subprocess:
# maybe subprocess :ref => 'uri'
subtree = fexp.context.reader.read(ref) rescue nil
require 'pp'
pp subtree
pp subtree.class
I get the following:
"/home/devel/Workflow/pdefs/XX-initialize-station.rb"
String
20110317-bebinibiba RuntimeError
20110317-bebinibiba no subprocess named
'file:/home/devel/Workflow/pdefs/XX-return-invalid-bike.rb' found
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/util/subprocess.rb:58:in
`lookup_subprocess'
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/exp/fe_subprocess.rb:184:in
`apply'
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/exp/flowexpression.rb:252:in
`do_apply'
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:326:in
`launch'
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:243:in
`process'
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:173:in
`step'
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:75:in `run'
20110317-bebinibiba
/home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:87:in
`run_in_thread'
20110317-bebinibiba org/jruby/RubyProc.java:268:in `call'
20110317-bebinibiba org/jruby/RubyProc.java:232:in `call'
So for some reason, as I said, Reader#read is returning the same String
passed in instead of actually reading the file and returning the tree. I've
tried prepending 'file:' and 'file://' to the absolute pathname to no avail.
I've also tried using relative paths (because of our project setup, the
pdefs directory is 2 levels above ruote-kit, so the path is
"../../pdefs/initialize-station.rb")
And yes, the file does exist :)
This is driving me crazy!
-Mario.
--
I want to change the world but they won't give me the source code.
On Thu, Mar 17, 2011 at 08:46, Mario Camou <[email protected]> wrote:
> Hi all,
>
> I am having trouble with calling processes and subprocesses given the file
> name. As an example, here's a call to a subprocess:
>
> subprocess :ref => '/home/devel/Workflow/pdefs/XX-initialize-station.rb'
>
> I get the following:
>
> 20110317-besohibutsu RuntimeError
> 20110317-besohibutsu no subprocess named
> './home/devel/Workflow/pdefs/XX-initialize-station.rb' found
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/util/subprocess.rb:58:in
> `lookup_subprocess'
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/exp/fe_subprocess.rb:184:in
> `apply'
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/exp/flowexpression.rb:252:in
> `do_apply'
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:326:in
> `launch'
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:243:in
> `process'
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:173:in
> `step'
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:75:in `run'
> 20110317-besohibutsu
> /home/devel/Workflow/ruote-components/ruote/lib/ruote/worker.rb:87:in
> `run_in_thread'
> 20110317-besohibutsu org/jruby/RubyProc.java:268:in `call'
> 20110317-besohibutsu org/jruby/RubyProc.java:232:in `call'
>
> After tracing through the Ruote code I think the culprit is in
> ruote/lib/ruote/reader.rb in the read(definition) method:
>
> def read(definition)
>
> return definition if Ruote.is_tree?(definition)
>
> (return XmlReader.read(definition)) rescue nil
> (return Rufus::Json.decode(definition)) rescue nil
> (return ruby_eval(definition)) rescue nil
>
> if definition.index("\n").nil? && definition.index(' ').nil?
>
> raise ArgumentError.new(
> "remote process definitions are not allowed"
> ) if Ruote::Reader.remote?(definition) &&
> @context['remote_definition_allowed'] != true
>
> return read(open(definition).read)
> end
>
> raise ArgumentError.new(
> "doesn't know how to read definition (#{definition.class}) " +
> "or error in process definition")
> end
>
> It's returning the same String passed in. Doing a few pp's, it drops past
> the XmlReader but doesn't go past the Rufus::Json.decode (which is weird
> because if I call it directly it *DOES* toss an exception). If I do a pp in
> subprocess.rb I see that read is returning the same String I passed in.
>
> I have checked and "remote_definitions_allowed" is enabled.
>
> Any ideas?
>
> Thanks!
> -Mario.
>
> --
> I want to change the world but they won't give me the source code.
>
--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en