Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 40410 invoked from network); 21 Sep 2010 05:06:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Sep 2010 05:06:57 -0000 Received: (qmail 45658 invoked by uid 500); 21 Sep 2010 05:06:56 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 45103 invoked by uid 500); 21 Sep 2010 05:06:53 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 45093 invoked by uid 99); 21 Sep 2010 05:06:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 05:06:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [80.247.228.93] (HELO smtp-2.nfrance.com) (80.247.228.93) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 05:06:44 +0000 Received: from [192.168.0.11] (lns-bzn-47f-62-147-215-165.adsl.proxad.net [62.147.215.165]) (authenticated bits=0) by smtp-2.nfrance.com (8.13.8/8.13.6) with ESMTP id o8L56K2F074559 for ; Tue, 21 Sep 2010 07:06:21 +0200 (CEST) (envelope-from dev@artenum.com) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: [scxml] How to retrieve the transition target in a custom action From: =?iso-8859-1?Q?Thi=E9bault_Beno=EEt?= In-Reply-To: Date: Tue, 21 Sep 2010 07:06:18 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4518729C-EACA-4874-9837-554A34650A6D@artenum.com> References: <271FABBF-760D-4A86-AFA6-68137FCA5FB0@artenum.com> To: "Commons Users List" X-Mailer: Apple Mail (2.1081) Le 21 sept. 2010 =E0 00:12, Rahul Akolkar a =E9crit : > >=20 > I believe you mean a transition thats not a stay nor self transition, > since the only way a custom action will ever execute is if some > transiton is being followed (in order for SCXML executable content to > execute). Thank you Rahul for your answer. Indeed I want to know wether I'm in a stay or self transition. I confirm = that my custom action is within a transition (or onentry/onexit). >=20 > There isn't a direct way to access information about the transition > target. I imagine your custom action is within a transition element. > If so, you could walk up the SCXML object model and check whether the > parent transition has a target attribute and whether it is the parent > state id itself. How can you do this from within a custom action? > It may also be possible to infer whether a (non-stay) > transition is being followed and what the target is, by using a > suitable SCXMLListener impl. >=20 > For long computations, you should consider using the external > communications module (either or ) to send an event to > (or invoke) some external process which manages the computation and > fires a completion event on the state machine when done. I quickly looked at the invoke examples provided in SCXML tests and they = seem less appropriate than using custom actions, which make the XML file = more readable IMHO. >=20 > -Rahul >=20 >=20 >> I need this info to know if it is possible to launch a long = computation in a different thread: >> - if there is a transition target, the state machine will go to the = new state and my computation will be started in one state and continue = in another one, which I want to avoid. >> - if there is no transition target, it means that my computation is = performed within the original state (internal transition) and I can use = my computation without fearing an undetermined state machine. >>=20 >> Kind regards, >>=20 >> Ben >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org