Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 13684 invoked from network); 11 Aug 2010 19:52:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Aug 2010 19:52:14 -0000 Received: (qmail 75250 invoked by uid 500); 11 Aug 2010 19:52:13 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 75159 invoked by uid 500); 11 Aug 2010 19:52:13 -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 75151 invoked by uid 99); 11 Aug 2010 19:52:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 19:52:13 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [129.83.20.191] (HELO smtp-bedford.mitre.org) (129.83.20.191) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 19:52:04 +0000 Received: from smtp-bedford.mitre.org (localhost.localdomain [127.0.0.1]) by smtp-bedford.mitre.org (8.13.1/8.13.1) with ESMTP id o7BJpgHD006868 for ; Wed, 11 Aug 2010 15:51:43 -0400 Received: from imchub2.MITRE.ORG (imchub2.mitre.org [129.83.29.74]) by smtp-bedford.mitre.org (8.13.1/8.13.1) with ESMTP id o7BJpgNi006865 for ; Wed, 11 Aug 2010 15:51:42 -0400 Received: from [129.83.50.56] (129.83.50.56) by imchub2.MITRE.ORG (129.83.29.74) with Microsoft SMTP Server id 8.2.254.0; Wed, 11 Aug 2010 15:51:42 -0400 Message-ID: <4C62FF4E.3030800@mitre.org> Date: Wed, 11 Aug 2010 15:51:42 -0400 From: Abigail Gertner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: user@commons.apache.org Subject: Re: [scxml] datamodel, custom actions and digester References: <4C61DCBE.8020400@mitre.org> <4C62E9B9.8000007@mitre.org> In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 8/11/2010 3:36 PM, Rahul Akolkar wrote: > On Wed, Aug 11, 2010 at 2:19 PM, Abigail Gertner wrote: > >> >> On 8/11/2010 12:29 AM, Rahul Akolkar wrote: >> >>> >>> The way to obtain the live values of the datamodel is to use the >>> expression evaluator, see interfaces mentioned here: >>> >>> http://commons.apache.org/scxml/guide/contexts-evaluators.html >>> >>> >>> >> Is it possible to call a method using the expression evaluator with an >> argument that is a node in the XML tree, rather than just a string value? >> >> > > > Executable content is open ended in SCXML, as largely speaking most > things are possible with custom actions. I'm afraid I've lost the > bigger picture of your scenario in the pin-pointed question above. > > To obtain a node using the expression evaluator, use > Evaluator#evalLocation(...) which returns a Node. > What I mean is, if I want to do something like: Where the argument to foo.bar() is a Node from the datamodel, but with the current context values included, how can I get that from the expression evaluator. I tried using the Data('var','path') expression but it doesn't seem to work for nodes. >>> Might be worthwhile revisiting the need for using >>> SCXMLParser#newInstance() rather than the static parse methods. >>> >>> >>> >>> >> The reason I am doing this is that I am using xinclude to include a >> separate xml file and I found that I needed to call setXIncludeAware() >> on the parser to make it do the include. Is there some way to do this >> using the static parse methods? >> >> > > > Not in the latest release (v0.9) so thats one of the cases where you > may indeed not be able to use the static parse methods. Based on what > I've read so far, it seems your best bet may be to register the > digester rules for your custom actions by hand after you obtain the > new instance and let the custom action do the appropriate expression > evaluation and datamodel / context processing. > I'm trying to do it this way now and having trouble getting the custom action to fire. I am using dig.addObjectCreate("!*/onentry/sendMessage", SendMessage.class); Where my custom action is called SendMessage. Then in my scxml file I have The SendMessage object is being created when the file is parsed, but the execute() method is not being called when the state is entered. Do I have to do something else to get it to call execute()? --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org