Hello Ocha,
welcome to ruote's mailing list.
Could I have the backtrace fo the "missing error" ?
> I would recommend changing Engine#processes to:
>
> if opts.size > 0
> wfids = @context.storage.expression_wfids(opts)
> return wfids.size if opts[:count]
> else
> wfids = @context.storage.expression_wfids
> end
> list_processes(wfids, opts)
>
> let me know what you think...
OK, #list_processes is meant to deal with a 'wfids' set to nil. I will look at the error backtrace and make the appropriate modification.
Thanks in advance,
--
John Mettraux - http://jmettraux.wordpress.com
Unfortunately I don¹t have a backtrace ‹ we patched it(in the calling
code, non ruote files) by manually skipping processes that have 0
expressions. We were getting missing_method 'attribute' for nilclass when
we were trying to iterate through processes that collect their
definition_name. The error was raised ultimately for processes that had 0
expressions in them (and maybe wfid=nil, not sure about this). Running
through ruote Engine#processes I found that wfid variable can be different
if passing options hash with some garbage in it (eg :test=>²test²). I
would expect to have the same list of processes returned by
Engine#processes if I don¹t pass options hash or if I pass options hash
with unusable keys.
Thanks
Iuri
>--
>you received this message because you are subscribed to the "ruote users"
>group.
>to post : send email to openwfe...@googlegroups.com
>to unsubscribe : send email to
>openwferu-use...@googlegroups.com
>more options : http://groups.google.com/group/openwferu-users?hl=en
Hello Iuri,
I think I know the root cause.
https://github.com/jmettraux/ruote/blob/f496d53ba0962c3f3048b09b5015e19fe07cc928/lib/ruote/engine/process_status.rb#L161-164
https://github.com/jmettraux/ruote/blob/f496d53ba0962c3f3048b09b5015e19fe07cc928/lib/ruote/engine/process_status.rb#L72-91
Could be triggered by a process that has no root expression anymore (this covers your "no expressions anymore" case).
I will come up with a proper test case and a proper fix.
> Running
> through ruote Engine#processes I found that wfid variable can be different
> if passing options hash with some garbage in it (eg :test=>²test²). I
> would expect to have the same list of processes returned by
> Engine#processes if I don¹t pass options hash or if I pass options hash
> with unusable keys.
OK, that's a second issue, those garbage opts get passed to Storage#expression_wfids
https://github.com/jmettraux/ruote/blob/2e75b2b75ca1caa5495e0756e0986fa34aafd46e/lib/ruote/engine.rb#L269
https://github.com/jmettraux/ruote/blob/2e75b2b75ca1caa5495e0756e0986fa34aafd46e/lib/ruote/storage/base.rb#L114-133
I guess the "if opts.size > 0" is hurting (as suggested by your patch).
I will add a test case and integrate your patch.
By the way, what storage implementation are you using ?
Thanks for reporting those issues, stay tuned,
Hello Iuri,
this got fixed in
https://github.com/jmettraux/ruote/commit/851a2daf9e87b7bbc91d29f5d7fdac5b5d744c30
> > Running
> > through ruote Engine#processes I found that wfid variable can be different
> > if passing options hash with some garbage in it (eg :test=>²test²). I
> > would expect to have the same list of processes returned by
> > Engine#processes if I don¹t pass options hash or if I pass options hash
> > with unusable keys.
>
> I will add a test case and integrate your patch.
I integrated your patch as
https://github.com/jmettraux/ruote/commit/6c1e9c5529a7cf343b58e5553f116b7a5379f457
#processes now looks like
Your initial issue was caused by "leftovers", ie workitems, errors or schedules for which there are no more expressions. #processes is no simplified and should not return ProcessStatus instances when there are no expressions (as you pointed out).
I've added a #leftovers method to Engine to retrieve such "leftovers" (and potentially delete them and/or investigate why they ended up being left over).
https://github.com/jmettraux/ruote/commit/9597c8997c89dcc83553d90bd721679b1d2f6a12
Many thanks,
Thanks John.