Sorry for the late response... Thanks for your comments.

I am in a firm which is a subsidiary of Pershing LLC.

I need one more help, John.

The below code is the embedded engine in Java, which forwards the
worklist from one participant to another.

*********JAVA**********
        Engine engine = new InMemoryEngine();

        // prepare worklists

        InMemoryWorklist wla = new InMemoryWorklist("a");
        InMemoryWorklist wlb = new InMemoryWorklist("b");

        // register participants

        engine.registerParticipant(wla);
        engine.registerParticipant(wlb);

        //
        // launch flow

        LaunchItem li = new LaunchItem();
        li.setWorkflowDefinitionUrl("field:__definition__");

        String flowDef =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+
            "<process-definition name=\"test\" revision=\"0.0\">\n"+
            "   <sequence>\n"+
            "      <participant ref=\"a\" />\n"+
            "      <participant ref=\"b\" />\n"+
            "   </sequence>\n"+
            "</process-definition>";

        li.getAttributes().puts("__definition__", flowDef);

        engine.launch(li, false);

        System.out.println("wla.countWorkItems() :
"+wla.countWorkItems());
        System.out.println("wlb.countWorkItems() :
"+wlb.countWorkItems());

        java.util.Iterator it = wla.iterator();

        InFlowWorkItem wi = (InFlowWorkItem)it.next();

        wla.forward(wi);

        System.out.println("\n ~~ forwarded workitem\n");

        System.out.println("wla.countWorkItems() :
"+wla.countWorkItems());
        System.out.println("wlb.countWorkItems() :
"+wlb.countWorkItems());

***********************

Similarly, can i forward the workitem from one participant to another
in the below ruby code?

*********RUBY**********

$:.unshift('lib') # running from ruote/ probably

require 'rubygems'
require 'ruote'
require 'ruote/storage/fs_storage'

storage = Ruote::FsStorage.new('ruote_work')

engine = Ruote::Engine.new(
   Ruote::Worker.new(storage))

# registering participants

engine.register_participant :alpha do |workitem|
  workitem.fields['message'] = { 'text' => 'hello !', 'author' =>
'Alice' }
end

engine.register_participant :bravo do |workitem|
  puts "I received a message from #{workitem.fields['message']
['author']}"
end

# defining a process
pdef = Ruote.process_definition :name => 'test' do
  sequence do
    participant :alpha
    participant :bravo
  end
end

# launching, creating a process instance

wfid = engine.launch(pdef)

engine.wait_for(wfid)

***********************

Your help is greatly appreciated...

Thanks and regards,
Silvester

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