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> &lt;<a href=3D"mailto:[email protected]">sasaboy@proz=
one.co.yu</a>&gt; 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&nbsp;&nbsp;(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>&nbsp;&nbsp;Start -&gt; A (manual) -&gt; B (tool) -&gt; C (tool) -&=
gt; D (manual) -&gt; Finish<br><br>when you say something like:<br>// UserT=
ransaction ut;<br>// WfActivity actA;<br>try {<br>&nbsp;&nbsp;&nbsp;&nbsp;u=
t=3DgetUserTransaction();<br>
&nbsp;&nbsp;&nbsp;&nbsp;ut.begin();<br>&nbsp;&nbsp;&nbsp;&nbsp;actA.complet=
e();<br>&nbsp;&nbsp;&nbsp;&nbsp;ut.commit();<br>} catch (Exception ex) {<br=
>&nbsp;&nbsp;&nbsp;&nbsp;try {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;ut.rollback();<br>&nbsp;&nbsp;&nbsp;&nbsp;} 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>=
&gt; Hi all,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;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>&gt;<br>&gt;&nbsp;&nbsp; Start -&gt; Activity A (no implementation) -&g=
t; Activity B (three mapped tools in a row) -&gt; Finish<br>&gt;<br>&gt;&nb=
sp;&nbsp; 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>&gt;&nbsp;&nbsp; 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>&gt;&nbsp;&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 &quot;complete&quot; 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>&gt;<br>&gt; Thanks in advance!<br>&gt;<br>&gt; Regards,<br>&gt;<br>&gt=
; Fuad Abinader<br>&gt;<br>&gt;<br>&gt; -----------------------------------=
-------------------------------------<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Yo=
u receive this message as a subscriber of the=20
<a href=3D"mailto:[email protected]">[email protected]</a> mailing list=
.<br>&gt; To unsubscribe: mailto:<a href=3D"mailto:shark-unsubscribe@object=
web.org">[email protected]</a><br>&gt; For general help: mail=
to:
<a href=3D"mailto:[email protected]">[email protected]</a>?subject=3Dhe=
lp<br>&gt; ObjectWeb mailing lists service home page: <a href=3D"http://www=
.objectweb.org/wws">http://www.objectweb.org/wws</a><br>&gt;<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--