Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 54564 invoked from network); 26 Apr 2010 19:03:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Apr 2010 19:03:45 -0000 Received: (qmail 57713 invoked by uid 500); 26 Apr 2010 19:03:44 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 57493 invoked by uid 500); 26 Apr 2010 19:03:44 -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 57485 invoked by uid 99); 26 Apr 2010 19:03:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 19:03:44 +0000 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aarathi@gmail.com designates 209.85.221.195 as permitted sender) Received: from [209.85.221.195] (HELO mail-qy0-f195.google.com) (209.85.221.195) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 19:03:37 +0000 Received: by qyk33 with SMTP id 33so11907317qyk.24 for ; Mon, 26 Apr 2010 12:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=+lQpbH0v1RBheA9lQfKJyC1Rdh18uGRPrF0/cMDbsSc=; b=EYifFb7+zVTk+iyH5sZj2mlyhWqf0S50MOtDxF/E9f33M4sjAESV4AAIGoCqZ9gISS EGKHHWrWt3qumyiyngcGxKhZ87BHC0D3qE6XsqhMzniIiEsz5MXEJ4Fv54J+WT9DZxTo 966trmiBaBgHKw8IgyalN3UQ4wWfoWjxn/QPw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=gJRhdNVpaNj86czOzP83fw3QygfYtWhgcrzdPHHaCVwc2TPd6f92YRQAC46ItXB9Se FArpLsX9xH7fmstP8pIt4+aqevrQNEiA4bs1rZCBuq5DnAbakhsxyLqIIXOklDoXnqd7 81iiKS92nDRJ0E2cZNRz1P26tj4jLYouvWp5o= MIME-Version: 1.0 Received: by 10.224.113.19 with SMTP id y19mr1369460qap.309.1272308596926; Mon, 26 Apr 2010 12:03:16 -0700 (PDT) Received: by 10.229.19.135 with HTTP; Mon, 26 Apr 2010 12:03:16 -0700 (PDT) In-Reply-To: References: Date: Mon, 26 Apr 2010 14:03:16 -0500 Message-ID: Subject: Re: [scxml] How to update the datamodel from inside a state's executable content? From: Aarathi To: Commons Users List Content-Type: multipart/alternative; boundary=00c09f93d8d5f6eb5c0485286d73 --00c09f93d8d5f6eb5c0485286d73 Content-Type: text/plain; charset=ISO-8859-1 In the listener: public void onEntry(TransitionTarget state) { .... // call method named as the state thru reflection invokeState(state.getId(), state.getDatamodel() } stateP(Datamodel model){ // some new value for "data1" is generated, so update it on the datamodel String newData1Value = "15"; boolean found = false; List dataList = datamodel.getData(); for(Data d : dataList){ if(d.getId().equals("data1"){ d.setExpr(newData1Value); found = true; } } if(!found){ Data d= new Data(); d.setId("data1"); d.setExpr("15"); model.addData(d); } } On Mon, Apr 26, 2010 at 1:30 PM, Rahul Akolkar wrote: > On Mon, Apr 26, 2010 at 12:09 PM, Aarathi wrote: > > *Details on how I use the commons scxml api:* > > My state's scxml looks like this - > > > > > > > > > > > > > > > > > > > > I use the commons scxml with the "listener" pattern. So when the > > "onEntry()" is called in the SCXMLWorkflowListener, it does something > > similar to AbstractStateMachine ie hand off to a method with the same > name > > as the stateName. > > > > So relating to the scxml above , I have a method stateP(). This method > holds > > the executable content for that state. Typically, in stateP(), the value > of > > data1 is changed and then control is handed off to an async call. When > this > > async call returns it fires the events that the transitions need. > > > > *Question:* > > While evaluating the condition on the transition, the value of data1 is > > always what it was initialized to ie 11. The updates I make in the > > executable content in stateP() never kicks in. So obviously, the > transition > > is never taken. What am I missing? > > > > There are many occassions where we update data models in executable > content in our tests (such as, via or even programmatically) > so this seems specific to a particular usage pattern you have. > > Please say a little more, perhaps with a snippet showing a simplified > stateP() impl, as to how you update data1 and what the said async call > looks like. > > -Rahul > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --00c09f93d8d5f6eb5c0485286d73--