Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 60781 invoked from network); 20 Apr 2006 02:34:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Apr 2006 02:34:07 -0000 Received: (qmail 21097 invoked by uid 500); 20 Apr 2006 02:34:03 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 21045 invoked by uid 500); 20 Apr 2006 02:34:03 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 21034 invoked by uid 99); 20 Apr 2006 02:34:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Apr 2006 19:34:03 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [72.254.128.201] (HELO s-utl01-atpop.stsn.net) (72.254.128.201) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 19 Apr 2006 19:34:02 -0700 Received: from s-utl01-atpop.stsn.net ([127.0.0.1]) by s-utl01-atpop.stsn.net (SMSSMTP 4.1.2.20) with SMTP id M2006041922334012908 for ; Wed, 19 Apr 2006 22:33:40 -0400 X-Spam-Level: Received: from prasadsony ([10.27.75.22]) by s-utl01-atpop.stsn.net for commons-user@jakarta.apache.org; Wed, 19 Apr 2006 22:33:38 -0400 Message-ID: <005501c66422$ce68fb10$164b1b0a@prasadsony> From: "Fasih" To: "Jakarta Commons Users List" References: <20060420010851.61223.qmail@web50911.mail.yahoo.com> Subject: Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public? Date: Wed, 19 Apr 2006 21:33:16 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=0.0 required=9.9 tests=ALL_TRUSTED: -2.867,AWL: 0.419,BAYES_00: -1.665, SARE_RECV_ADDR: 0.027,SARE_TOCC_USER: 0.011 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I see, in my use-case there are multiple SCXML docs and multiple Executors, that's why the confusion. Anyways, so, you have one SCXML doc which is traversed/executed by multiple execs. These execs try to insert some data in the scInstance's or their own rootContext so that it can be evaluated by SCXML. I know of two points where a user code is called. 1. Initialisation: Here you have a handle to rootContext as well as Exec. I mean this is the point you do exec.setRootContext() so, you wouldnt need the scIntance to get the root context 2. As a state-transition in a custom action: Here you get scInstance as an argument. 3. As a state-event notified through SCXML Listener. What is your use-case, where does your code come in? I am not sure if I will be able to help. But it would be helpful to others to know the various use-cases it can be used in. +Fasih ----- Original Message ----- From: "Nestor Urquiza" To: "Jakarta Commons Users List" Sent: Wednesday, April 19, 2006 8:08 PM Subject: Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public? >I am afraid it does not do what I want. > I have only one SCXML object (doc) for my whole > application but several Executors (exec). > The code below is adding data to the doc instead of > adding data to the root context (rootCtx) that is > unique per Executor. > Take a look at [1] below and you will see what I mean > ... I am just trying to make my code able to set > variables that can be tested in conditions (guards) > within the sxcml file for example: > > Context context = new ELContext(); > // Say we have an instance 'foo' of type Foo which > // has a property 'bar' of type String > context.set("foo", foo); > > for the statement --> Evaluator evaluator = new > ELEvaluator(); in the scxml we could have: > > for the statement --> Evaluator evaluator = new > JexlEvaluator(); in the scxml we could have: > > and in both cases the condition will be true only if > (foo.bar=="barString") > > Hope now in clearer ... or still I am missing > something??? > > Thanks a lot! > > --- Fasih wrote: > >> Sorry, >> I removed a few lines from the code. >> Let me re-paste the snippet, as is in my code: >> >> exec = new SCXMLExecutor(evaluator, ed, trc); >> exec.addListener(doc, trc); >> exec.setSuperStep(true); >> exec.setRootContext(rootCtx); >> exec.setStateMachine(doc); >> Data scenarioData = new Data(); >> scenarioData.setName(SCENARIO_ID_PARAM); >> scenarioData.setExpr("'"+id+"'"); >> doc.getDatamodel().addData(scenarioData); >> >> If I understand you correctly, the line >> exec.setStateMachine(doc); does the >> trick you are looking for! >> >> By the way, you can look at the code from SVN. I >> couldn't find much >> documentation, the code itself is the best guide. >> >> +Fasih >> >> ----- Original Message ----- >> From: "Nestor Urquiza" >> To: "Jakarta Commons Users List" >> >> Sent: Wednesday, April 19, 2006 5:41 PM >> Subject: Re: [scxml] SCXMLExecutor#getSCInstance ... >> any chance to make it >> public? >> >> >> > Hey thanks for replying, >> > I see your code is adding data to data model which >> is >> > related to the SCXML object. However I think I do >> not >> > understand how this map to the specific Executor. >> In >> > other words I am trying to set within my specific >> code >> > variables that are in the root context which in >> turns >> > is defined in a per Executor basis and not in a >> per >> > SCXML instance. >> > Could you please be more explicit or point me to a >> > place in the documentation where this is >> explained? >> > From [1] I see that variables to be used within >> the >> > scxml file are supposed to be handled thru a >> Context >> > instance. >> > Thanks a lot, >> > Nestor >> > >> > [1]http://jakarta.apache.org/commons/sandbox/scxml/api-notes/side-effect-el.html >> > >> > --- Fasih >> wrote: >> > >> >> Yup, >> >> I have done exactly the same thing >> >> >> >> exec = new SCXMLExecutor(evaluator, ed, trc); >> >> Data scenarioData = new Data(); >> >> scenarioData.setName(SCENARIO_ID_PARAM); >> >> scenarioData.setExpr("'"+id+"'"); >> >> doc.getDatamodel().addData(scenarioData); >> >> >> >> I guess that should answer your question. >> >> >> >> +Fasih >> >> >> >> ----- Original Message ----- >> >> From: "Nestor Urquiza" >> >> To: "Jakarta Commons Users List" >> >> >> >> Sent: Wednesday, April 19, 2006 5:03 PM >> >> Subject: [scxml] SCXMLExecutor#getSCInstance ... >> any >> >> chance to make it >> >> public? >> >> >> >> >> >> > Hello, >> >> > I am planning to store just the SCXMLExecutor >> in a >> >> per >> >> > session basis. Then of course I need to have >> >> access >> >> > from my "bridge" to SCInstance#getRootContext >> to >> >> > obtain the context needed to set variables from >> my >> >> > specific-code. >> >> > The problem is right now the >> >> > SCXMLExecutor#getSCInstance has package access >> >> > Can we make it public? Or there is a better way >> to >> >> > accomplish what I am trying to do??? >> >> > Thanks a lot! >> >> > >> >> > >> __________________________________________________ >> >> > Do You Yahoo!? >> >> > Tired of spam? Yahoo! Mail has the best spam >> >> protection around >> >> > http://mail.yahoo.com >> >> > >> >> > >> >> >> > >> > --------------------------------------------------------------------- >> >> > To unsubscribe, e-mail: >> >> commons-user-unsubscribe@jakarta.apache.org >> >> > For additional commands, e-mail: >> >> commons-user-help@jakarta.apache.org >> >> > >> >> > >> >> >> >> >> >> >> >> >> > >> > --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: >> >> commons-user-unsubscribe@jakarta.apache.org >> >> For additional commands, e-mail: >> >> commons-user-help@jakarta.apache.org >> >> >> >> >> > >> > >> > __________________________________________________ >> > Do You Yahoo!? >> > Tired of spam? Yahoo! Mail has the best spam >> protection around >> > http://mail.yahoo.com >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: >> commons-user-unsubscribe@jakarta.apache.org >> > For additional commands, e-mail: >> commons-user-help@jakarta.apache.org >> > >> > >> >> >> >> >> > --------------------------------------------------------------------- >> To unsubscribe, e-mail: >> commons-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: >> commons-user-help@jakarta.apache.org >> >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org