On Sun, Aug 9, 2009 at 1:20 AM, Jason<[email protected]> wrote:
>
> What would be the best way of overriding the default wfidgen function?

Hi Jason,

you first have to provide a class that implements a safe #generate
method (must return a String), like for example :

(NOTE : these examples are ruote 2.0 based)

---8<---
module MyRuote
  class ArgoWfidGenerator
    def generate
      (Time.now.to_f * 1000).to_i.to_s
        # probably not safe (not unique in a group of systems)
    end
  end
end
--->8---

Then you tell your engine about it :

---8<---
engine.add_service(:s_wfid_generator, MyRuote::ArgoWfidGenerator)
--->8---

or you work with an engine that overrides #build_wfid_generator :

---8<---
module MyRuote
  class Engine < Ruote::FsPersistedEngine
    def build_wfid_generator
      add_service(:s_wfid_generator, MyRuote::ArgoWfidGenerator)
    end
  end
end

#...

engine = MyRuote::Engine.new(opts)
--->8---


Best regards,

-- 
John Mettraux   -   http://jmettraux.wordpress.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to