Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08A4258C9 for ; Tue, 10 May 2011 12:51:59 +0000 (UTC) Received: (qmail 67487 invoked by uid 500); 10 May 2011 12:51:57 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 67369 invoked by uid 500); 10 May 2011 12:51:57 -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 67361 invoked by uid 99); 10 May 2011 12:51:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 May 2011 12:51:57 +0000 X-ASF-Spam-Status: No, hits=3.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of darac1111@gmail.com designates 74.125.82.171 as permitted sender) Received: from [74.125.82.171] (HELO mail-wy0-f171.google.com) (74.125.82.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 May 2011 12:51:51 +0000 Received: by wyb32 with SMTP id 32so5306928wyb.30 for ; Tue, 10 May 2011 05:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=NCOlarrgV3KiPk60cyDieviK2xxDw8inF2i30T2Jo7o=; b=xk4Sws5cNJbiT2/l2OLrcTRf2nmJ2GD17pT7I2/SYDzFNmOmcbjxCZx/i3LjeWV/ka FFKjDp8z9m8NnONq94AZSKLcJWfjowEROQ1+6Vh+XyCO6TsqPTf1+QztsewmpKXPX1ca MkRYAWYMEKkav1qOgE2CMeIdQI7qB/qhBXH2k= 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=Vx1lI0uD/umlZAbCew6jkKLQ/O0u1D2XoZ5tTuDxf55U7u1IlZtq0mWHaWpZxxGtG2 W/QWzdqIoZCftyclE3RVmSfMQa9PLZ27qnyJz+vFRMV8WcorUJqzfazvwIufpXfNZb2R nf9ddloLmOzYAY5iB/s8+FDRrR5nasSXbZ9l8= MIME-Version: 1.0 Received: by 10.227.55.10 with SMTP id s10mr6539296wbg.87.1305031889789; Tue, 10 May 2011 05:51:29 -0700 (PDT) Received: by 10.227.37.163 with HTTP; Tue, 10 May 2011 05:51:29 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 May 2011 14:51:29 +0200 Message-ID: Subject: Re: [scxml] Calling go() twice From: Dario D To: Commons Users List Content-Type: multipart/alternative; boundary=20cf300258a436235e04a2eb6ac3 --20cf300258a436235e04a2eb6ac3 Content-Type: text/plain; charset=ISO-8859-1 Rahul, in regards to triggering events, I am trying to trigger them from within the workflow like this: As you can see, I am trying to trigger an event from within "action1" state and then move to "action2". However, this does not happen and the log output shows only "entering action1". If the event is being triggered, why the transition does not take place? Thank you. 2011/5/3 Rahul Akolkar > On Tue, May 3, 2011 at 10:13 AM, Dario D wrote: > > Thanks Jocke. How would you suggest to resume the the last state before > the > > condition was not met? Let's say that the condition was made valid > somehow. > > How to resume from the last state? > > > > To continue the previous example: > > > > try { > > exec.go(); > > // Execution stops at state2, condition is not met > > // Condition is made valid through some means > > // How to resume? > > } catch (ModelException e) { > > e.printStackTrace(); > > } > > > > > Triggering events is here: > > http://commons.apache.org/scxml/guide/core-events.html > > The main page for the user guide, which has more, is here: > > http://commons.apache.org/scxml/guide.html > > If you're using EL, you've have to use the EL syntax for expressions, > so rather than the following from your example ... > > > > ... the syntax will be like below: > > > > -Rahul > > > > > > 2011/5/3 jocke eriksson > > > >> exec.go(); should only be called once. It will start the state > >> machine and it will go through all steps that meets the criteria > >> (event cond). > >> > >> Regards Jocke. > >> > >> 2011/5/3 Dario D : > >> > Hello all, > >> > > >> > I've just started using SCXML and it's great. However, I've hit a > brick > >> wall > >> > and I can't seem to figure out something. I have the following XML > file: > >> > > >> > >> > version="1.0" > >> > initialstate="state1"> > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > Now, I execute the state machine like this: > >> > > >> > SCXMLExecutor exec = null; > >> > exec = new SCXMLExecutor(new ELEvaluator(), new > >> SimpleDispatcher(), > >> > new SimpleErrorReporter()); > >> > Context ctx = new ELContext(); > >> > exec.setRootContext(ctx); > >> > exec.setStateMachine(scxml); > >> > exec.setSuperStep(true); > >> > // Start execution > >> > try { > >> > exec.go(); > >> > exec.go(); > >> > } catch (ModelException e) { > >> > e.printStackTrace(); > >> > } > >> > > >> > As you can see I call exec.go() two times. I would expect that in the > >> first > >> > time, the state machine will stop in the "state2" state and remain > there, > >> > because condition is not satisfied for going into "state3". However, > when > >> > exec.go() is called the second time, it goes from the start. > Effectively, > >> it > >> > acts as exec.reset()? Following output is provided: > >> > > >> > 03.05.2011. 14:01:32 org.apache.commons.scxml.model.Log execute > >> > INFO: null: State 1 > >> > 03.05.2011. 14:01:32 org.apache.commons.scxml.model.Log execute > >> > INFO: null: State 2 > >> > 03.05.2011. 14:01:32 org.apache.commons.scxml.model.Log execute > >> > INFO: null: State 1 > >> > 03.05.2011. 14:01:32 org.apache.commons.scxml.model.Log execute > >> > INFO: null: State 2 > >> > > >> > Could you explain this behavior? > >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --20cf300258a436235e04a2eb6ac3--