Re: Transactions on Tool Activities
"Ignacio Talavera" <[email protected]> Wed, 13 Dec 2006 14:14:15 -0300
| Newsgroups | gmane.comp.java.enhydra.shark |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format... ------------=_1166030115-20094-65 Content-Type: multipart/alternative; boundary="----=_Part_122519_21036862.1166030055218" ------=_Part_122519_21036862.1166030055218 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, does the new relase of shark support notification of events via WF-XML?, because with the older version I could not make it owrk properly. If it does how can I use it , AuditEventNotification. Thanks. On 12/13/06, Sasa Bojanic <[email protected]> wrote: > > Hi, > > shark works just like you expect. When you call complete() on Manual > activity, manual activity will be finished and it will execute any > subsequent Tool activities in the same method call. > In your case, you create and begin user transaction before completing > activity A, and you are committing transaction after you call complete() > method for this activity. During complete() method call, activity A will > be brought to state closed.completed, activity B will be created and > started and three tool agents for this activity will be executed, > activity B will be finished and brought to state closed.completed, and > since there is nothing to do in the process, process will finish and > will come to state closed.completed. > If anything goes wrong during any of these steps, it will be like > nothing happened (like you never called complete on activity A). > > Look at shark as to the process state engine, and the states of the > process are represented by the manual activities. Automatic activities > are executed using the same UserTransaction your client application > creates before completing manual activity. > > In the following scenario: > > Start -> A (manual) -> B (tool) -> C (tool) -> D (manual) -> Finish > > when you say something like: > // UserTransaction ut; > // WfActivity actA; > try { > ut=3DgetUserTransaction(); > ut.begin(); > actA.complete(); > ut.commit(); > } catch (Exception ex) { > try { > ut.rollback(); > } catch (Exception _) {} > } > > activity A is completed, activity B is created, its tool agent is > executed and it is completed, activity C is created, its tool agent is > executed and it is completed, and finally activity D is created (and > also assignments for activity D are created). > > Greetings, > Sasa. > > [email protected] wrote: > > Hi all, > > > > I understand that for all handling I do on activities and processes I > must manually create the UserTransaction and call the begin() and commit(= ), > and that's OK. However, what is the behavior for tool activities with > automatic start and automatic end? Imagine the following scenario: > > > > Start -> Activity A (no implementation) -> Activity B (three mapped > tools in a row) -> Finish > > > > Suppose that Activity A has manual start and manual end. Suppose that > the user (through some Shark client application) starts and completes the > Activity A, calling the transaction.begin() just before doing it and > calling the transaction.commit() just after doing that. I suppose now that > Shark engine is going to invoke the three tool activities, right? However, > who's going to create the user transaction, call the begin() just before > invoking the tools and call the commit() just after that? I mean, these m= ust > be done or else the start/completion of Activity B will not be performed = on > the Shark engine database, right? > > Also, if it is done somewhere, can you ensure me that the begin() is > called before invoking the first tool, and that the commit() is called ju= st > after invoking successfully the third tool? > > Finally, is there any means to use the Shark engine-created > transaction for the tool activity on the invoked tools? I mean, these too= ls > will be mapping applications which are in fact Java fa=E7ades to database > operations, and I would like to only "complete" the tool activity only if > these three operations are successful, and vice-versa, only to commit the > results of the three operations if the Shark engine DB is successfully > updated. > > > > Thanks in advance! > > > > Regards, > > > > Fuad Abinader > > > > > > ------------------------------------------------------------------------ > > > > > > -- > > You receive this message as a subscriber of the [email protected]= ing list. > > To unsubscribe: mailto:[email protected] > > For general help: mailto:[email protected]?subject=3Dhelp > > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > > > > > -- > You receive this message as a subscriber of the [email protected]= g list. > To unsubscribe: mailto:[email protected] > For general help: mailto:[email protected]?subject=3Dhelp > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > ------=_Part_122519_21036862.1166030055218 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, does the new relase of shark support notification of events via WF-XML?= , because with the older version I could not make it owrk properly. If it d= oes how can I use it , AuditEventNotification.<br><br>Thanks.<br><br><br> <div><span class=3D"gmail_quote">On 12/13/06, <b class=3D"gmail_sendername"= >Sasa Bojanic</b> <<a href=3D"mailto:[email protected]">sasaboy@proz= one.co.yu</a>> wrote:</span><blockquote class=3D"gmail_quote" style=3D"b= order-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; paddin= g-left: 1ex;"> Hi,<br><br>shark works just like you expect. When you call complete() on Ma= nual<br>activity, manual activity will be finished and it will execute any<= br>subsequent Tool activities in the same method call.<br>In your case, you= create and begin user transaction before completing <br>activity A, and you are committing transaction after you call complete(= )<br>method for this activity. During complete() method call, activity A wi= ll<br>be brought to state closed.completed, activity B will be created and <br>started and three tool agents for this activity will be executed,<br>ac= tivity B will be finished and brought to state closed.completed, and<br>sin= ce there is nothing to do in the process, process will finish and<br>will c= ome to state=20 closed.completed.<br>If anything goes wrong during any of these steps, it w= ill be like<br>nothing happened (like you never called complete = on activity A).<br><br>Look at shark as to the process state engine, and th= e states of the <br>process are represented by the manual activities. Automatic activities<= br>are executed using the same UserTransaction your client application<br>c= reates before completing manual activity.<br><br>In the following scenario: <br><br> Start -> A (manual) -> B (tool) -> C (tool) -&= gt; D (manual) -> Finish<br><br>when you say something like:<br>// UserT= ransaction ut;<br>// WfActivity actA;<br>try {<br> u= t=3DgetUserTransaction();<br> ut.begin();<br> actA.complet= e();<br> ut.commit();<br>} catch (Exception ex) {<br= > try {<br>  = ; ut.rollback();<br> } catch (Exception _) {}<b= r>}<br><br>activity A is completed, activity B is created, its tool agent is <br>executed and it is completed, activity C is created, its tool agent is<= br>executed and it is completed, and finally activity D is created (and<br>= also assignments for activity D are created).<br><br>Greetings,<br>Sasa. <br><br><a href=3D"mailto:[email protected]">[email protected]</a> wrote:<br>= > Hi all,<br>><br>> I understand that for a= ll handling I do on activities and processes I must manually create the Use= rTransaction and call the begin() and commit(), and that's OK. However, wha= t is the behavior for tool activities with automatic start and automatic en= d? Imagine the following scenario: <br>><br>> Start -> Activity A (no implementation) -&g= t; Activity B (three mapped tools in a row) -> Finish<br>><br>>&nb= sp; Suppose that Activity A has manual start and manual end. Suppose = that the user (through some Shark client application) starts and completes = the Activity A, calling the=20 transaction.begin() just before doing it and calling the transaction.commit= () just after doing that. I suppose now that Shark engine is going to invok= e the three tool activities, right? However, who's going to create the user= transaction, call the begin() just before invoking the tools and call the = commit() just after that? I mean, these must be done or else the start/comp= letion of Activity B will not be performed on the Shark engine database, ri= ght? <br>> Also, if it is done somewhere, can you ensure me that = the begin() is called before invoking the first tool, and that the commit()= is called just after invoking successfully the third tool?<br>> &n= bsp; Finally, is there any means to use the Shark engine-created transactio= n for the tool activity on the invoked tools? I mean, these tools will be m= apping applications which are in fact Java fa=E7ades to database operations= , and I would like to only "complete" the tool activity only if t= hese three operations are successful, and vice-versa, only to commit the re= sults of the three operations if the Shark engine DB is successfully update= d. <br>><br>> Thanks in advance!<br>><br>> Regards,<br>><br>>= ; Fuad Abinader<br>><br>><br>> -----------------------------------= -------------------------------------<br>><br>><br>> --<br>> Yo= u receive this message as a subscriber of the=20 <a href=3D"mailto:[email protected]">[email protected]</a> mailing list= .<br>> To unsubscribe: mailto:<a href=3D"mailto:shark-unsubscribe@object= web.org">[email protected]</a><br>> For general help: mail= to: <a href=3D"mailto:[email protected]">[email protected]</a>?subject=3Dhe= lp<br>> ObjectWeb mailing lists service home page: <a href=3D"http://www= .objectweb.org/wws">http://www.objectweb.org/wws</a><br>><br><br><br><br= ><br> <br>--<br>You receive this message as a subscriber of the <a href=3D"mailto= :[email protected]">[email protected]</a> mailing list.<br>To unsubscri= be: mailto:<a href=3D"mailto:[email protected]">shark-unsubsc= [email protected] </a><br>For general help: mailto:<a href=3D"mailto:[email protected]">sym= [email protected]</a>?subject=3Dhelp<br>ObjectWeb mailing lists service home= page: <a href=3D"http://www.objectweb.org/wws">http://www.objectweb.org/ww= s</a> <br><br><br></blockquote></div><br> ------=_Part_122519_21036862.1166030055218-- ------------=_1166030115-20094-65 Content-Type: text/plain; name="message-footer.txt" Content-Disposition: inline; filename="message-footer.txt" Content-Transfer-Encoding: 8bit -- 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 ------------=_1166030115-20094-65--