RE: processes running not in parallel

"He Wei" <[email protected]> Wed, 17 Aug 2005 17:07:50 +0800
Newsgroups gmane.comp.java.enhydra.shark
Message-ID <20050817090756.HHYG1195.morpheus2.pacific.net.sg@weihenb>
Hello Monique,

Yes, please share with me your modified JavaClassToolAgent.
Thank you for your info, I will look through them.
Did you ever test to let your application start a new Thread for each of you
instances as just suggested by Vladimir Puskas? Sample code is as following:
	  //final SharkConnection sc;
       //final Map workflowRelevantData;
       for (int i = 0; i < 5; i++) {
          new Thread() {
             public void run() {
                try {
                   WfProcess theProcess = sc.createProcess("pkg","pdef");
                   theProcess.set_process_context(workflowRelevantData);
                   theProcess.start();
                } catch (RootException e) {
                   e.printStackTrace();
                }
             }
          }.start();
       }
These process instances should run in parallel. I am testing on it.
Best Regards,
He Wei

-----Original Message-----
From: Monique Maker [mailto:[email protected]] 
Sent: Wednesday, August 17, 2005 4:15 PM
To: [email protected]
Subject: Re: [shark] processes running not in parallel

Hello He Wei,

According the Shark documentation all workflow applications (respectively
ToolAgents) in an activity are executed when the activity finishes. Probably
the tool can execute activity.complete, but we are afraid that this could
cause an infinite loop. Unfortunately we had no resources to check the
behaviour of Shark in similar situation and asked a question to the Shark
team on 18.07.2005 but we still have no answer. If you are interested, the
mail-list thread should be "Shark transactions question".

Even if Shark will not loop infinitely, there is another problem - the
credentials of a user to complete the activity. This is one of the problems
we rise in the mail-list thread "Logging Shark internal information in
external application" as of 21.07.2005.

We already modified the original JavaClassToolAgent to supply some of the
ToolAget parameters (such as processID and activityID) to our tools and I
can share it if you need it, though the change is easy to implement.

Best Regards,
Monique


He Wei wrote:
> Hello Monique,
> 
> Thank you very much for your answer. 
> This behavior for a workflow engine should not be acceptable, and should
be
> considered as a bug.
> Did you mean that without the solution of "how a TolAgent can finish an
> activity", the problem cannot be solved, is it?
> Best Regards,
> He Wei
> 
> -----Original Message-----
> From: Monique Maker [mailto:[email protected]] 
> Sent: Tuesday, August 16, 2005 6:24 PM
> To: [email protected]
> Subject: Re: [shark] processes running not in parallel
> 
> Hello He Wei,
> 
> When we asked similar question to the Shark team they explained us that
> Shark processes activities "greedy", i.e. it executes as many activities
as
> it can. In the case of all automatic activities the Shark engine runs all
of
> them before to proceed anything else. That is the reason you observe a
> sequential processes execution.
> 
> You cannot change this Shark behavior with some settings. Intead you will
> need to change your process definitions. Shark team advised us to change
the
> activities to automatic start and manual end, but we still have no answer
> how a TolAgent can finish an activity (if this is your case too).
> 
> Regards,
> Monique
> 
> He Wei wrote:
> 
>>In my testing, I started several process instances for the same process 
>>definition by the following java codes. "allProcesses" is array, whose 
>>length determines how many process instance to initiate. The process 
>>contains only automatic activities, which means each activity 
>>automatically start and complete by the engine. It supposes that those 
>>initiated processes should run in parallel, is it? However the results 
>>show that these processes start running in sequence, in other words, the 
>>second process starts to run only after the first process instance 
>>completes, and the third one start running only after the second 
>>completes, then the 4^th , 5^th and so on. It is quite strange. Could 
>>you please advice why this happens? Any settings need to be considered 
>>in shark? Thank you very much.
>>
>> 
>>
>>      for(i=0;i<allProcesses.length;i++)
>>
>>      {
>>
>>       
>>
>>                  Map m1 = new HashMap();
>>
>>                  m1.put("TotalTimeTaken",TotalTimeTaken);
>>
>>                  m1.put("ProcessStartTime",ProcessStartTime);
>>
>>                  m1.put("MovingDecision",MovingDecision);
>>
>>     
>>
>>                  WfProcess proc1 = sConn.createProcess(pkgId,pDefId);
>>
>>                  proc1.set_process_context(m1);
>>
>>     
>>
>>     
>>
>>                  proc1.start();
>>
>>       
>>
>>          }
>>
>>      }
>>
>> 
>>
>>Best Regards,
>>
>>He Wei
>>
> 
> 
> 
> 
>
message-footer.txt (text/plain, 271 B)
--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws