You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Nestor Urquiza <ne...@yahoo.com> on 2006/04/20 00:03:39 UTC

[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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
Thanks for the fast response!

--- Rahul Akolkar <ra...@gmail.com> wrote:

> On 4/20/06, Nestor Urquiza <ne...@yahoo.com>
> wrote:
> > Thanks Rahul,
> > I would include "Method Invocation" as part of
> >
>
"http://jakarta.apache.org/commons/sandbox/scxml/guide/contexts-evaluators.html"
> >
> > I would include "payload/_eventdata" documentation
> as
> > part of
> >
>
"http://jakarta.apache.org/commons/sandbox/scxml/guide/core-events.html"
> >
> <snip/>
> 
> Sounds good, thats done (site not refreshed yet).
> Feel free to suggest
> any documentation patches [1] via bugzilla if you
> can think of
> additions / improvements.
> 
> -Rahul
> 
> [1] http://jakarta.apache.org/commons/patches.html
> 
>
---------------------------------------------------------------------
> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/20/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> Thanks Rahul,
> I would include "Method Invocation" as part of
> "http://jakarta.apache.org/commons/sandbox/scxml/guide/contexts-evaluators.html"
>
> I would include "payload/_eventdata" documentation as
> part of
> "http://jakarta.apache.org/commons/sandbox/scxml/guide/core-events.html"
>
<snip/>

Sounds good, thats done (site not refreshed yet). Feel free to suggest
any documentation patches [1] via bugzilla if you can think of
additions / improvements.

-Rahul

[1] http://jakarta.apache.org/commons/patches.html

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
Thanks Rahul,
I would include "Method Invocation" as part of
"http://jakarta.apache.org/commons/sandbox/scxml/guide/contexts-evaluators.html"

I would include "payload/_eventdata" documentation as
part of
"http://jakarta.apache.org/commons/sandbox/scxml/guide/core-events.html"

--- Rahul Akolkar <ra...@gmail.com> wrote:

> On 4/20/06, Nestor Urquiza <ne...@yahoo.com>
> wrote:
> > Agree about documentation. I will post my usecase
> > implementation whenever a finish it at least the
> steps
> > I followed to get my State Oriented Business
> Protocol
> > working.
> >
> <snip/>
> 
> That'll be nice, thanks.
> 
> 
> >
> > I would say that the simpler the example the
> better
> > the guide so I would build a second
> > StandaloneJexlExpressions2.java and
> > StandaloneElExpressions2.java to show for example
> > method invocation (at least for jexl), context
> > manipulation and maybe payload operations.
> <snap/>
> 
> Method invocation is straightforward, so probably
> not worth creating
> that extra set. A test case that showcases it, OTOH,
> will be a welcome
> addition.
> 
> 
> > I have a
> > little idea about what a payload can do for me for
> > executing events but an example would definetely
> help.
> > Maybe what you put in the payload object is
> available
> > within the context and therefore I do not need the
> > exec getter I am asking for because instead of
> using:
> > evts[0] = new
> TriggerEvent(this.getClass().getName(),
> >                  TriggerEvent.SIGNAL_EVENT, null);
> >
> > I can use:
> > evts[0] = new
> TriggerEvent(this.getClass().getName(),
> >                  TriggerEvent.SIGNAL_EVENT,
> > myContextObject);
> >
> > I am sorry if I did not quite get what a payload
> is
> > :-( ... maybe a future thread subject from me to
> come.
> >
> <snip/>
> 
> Yup, payload becomes variable "_eventdata". Read the
> _eventdata
> section of the W3C draft or search the archives for
> it, I remember a
> couple of posts on that recently.
> 
> 
> > Commonly you do not have a lot of time to reverse
> > engineering and for sure more memebers of the open
> > community would contribute if the real power of
> > commons-scxml is shown in a very simple manner.
> >
> <snap/>
> 
> Hard to disagree with that ;-) Again, all feedback
> on documentation is
> welcome. So, where would you expect to find a note
> on method
> invocation (and another one on payloads) in the user
> guide [1]? Lets
> add these two bits, as a small step towards that
> goal. Other rough
> edges in the docs?
> 
> -Rahul
> 
> [1]
>
http://jakarta.apache.org/commons/sandbox/scxml/guide.html
> 
> 
> > Thanks,
> > Nestor
> 
>
---------------------------------------------------------------------
> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/20/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> Agree about documentation. I will post my usecase
> implementation whenever a finish it at least the steps
> I followed to get my State Oriented Business Protocol
> working.
>
<snip/>

That'll be nice, thanks.


>
> I would say that the simpler the example the better
> the guide so I would build a second
> StandaloneJexlExpressions2.java and
> StandaloneElExpressions2.java to show for example
> method invocation (at least for jexl), context
> manipulation and maybe payload operations.
<snap/>

Method invocation is straightforward, so probably not worth creating
that extra set. A test case that showcases it, OTOH, will be a welcome
addition.


> I have a
> little idea about what a payload can do for me for
> executing events but an example would definetely help.
> Maybe what you put in the payload object is available
> within the context and therefore I do not need the
> exec getter I am asking for because instead of using:
> evts[0] = new TriggerEvent(this.getClass().getName(),
>                  TriggerEvent.SIGNAL_EVENT, null);
>
> I can use:
> evts[0] = new TriggerEvent(this.getClass().getName(),
>                  TriggerEvent.SIGNAL_EVENT,
> myContextObject);
>
> I am sorry if I did not quite get what a payload is
> :-( ... maybe a future thread subject from me to come.
>
<snip/>

Yup, payload becomes variable "_eventdata". Read the _eventdata
section of the W3C draft or search the archives for it, I remember a
couple of posts on that recently.


> Commonly you do not have a lot of time to reverse
> engineering and for sure more memebers of the open
> community would contribute if the real power of
> commons-scxml is shown in a very simple manner.
>
<snap/>

Hard to disagree with that ;-) Again, all feedback on documentation is
welcome. So, where would you expect to find a note on method
invocation (and another one on payloads) in the user guide [1]? Lets
add these two bits, as a small step towards that goal. Other rough
edges in the docs?

-Rahul

[1] http://jakarta.apache.org/commons/sandbox/scxml/guide.html


> Thanks,
> Nestor

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
Agree about documentation. I will post my usecase
implementation whenever a finish it at least the steps
I followed to get my State Oriented Business Protocol
working. 

I think usecases are the best way to explore the
potential of an api as well as TestCases for what you
have been doing a great job. Having a junit TestCase
per class is commonly a good place to show the user
how the class is supposed to be used.

I would say that the simpler the example the better
the guide so I would build a second
StandaloneJexlExpressions2.java and
StandaloneElExpressions2.java to show for example
method invocation (at least for jexl), context
manipulation and maybe payload operations. I have a
little idea about what a payload can do for me for
executing events but an example would definetely help.
Maybe what you put in the payload object is available
within the context and therefore I do not need the
exec getter I am asking for because instead of using:
evts[0] = new TriggerEvent(this.getClass().getName(),
                  TriggerEvent.SIGNAL_EVENT, null);

I can use:
evts[0] = new TriggerEvent(this.getClass().getName(),
                  TriggerEvent.SIGNAL_EVENT,
myContextObject);

I am sorry if I did not quite get what a payload is
:-( ... maybe a future thread subject from me to come.

Commonly you do not have a lot of time to reverse
engineering and for sure more memebers of the open
community would contribute if the real power of
commons-scxml is shown in a very simple manner.

Thanks,
Nestor
--- Rahul Akolkar <ra...@gmail.com> wrote:

> On 4/19/06, Fasih <fa...@baypackets.com>
> wrote:
> <snip/>
> >
> > By the way, you can look at the code from SVN. I
> couldn't find much
> > documentation, the code itself is the best guide.
> >
> <snap/>
> 
> This is true. One of the things that we'd appreciate
> feedback on is
> how the documentation can be improved. There are a
> bunch of things in
> code that are not properly documented, and there are
> bunch of things
> that unfortunately may have been taken for granted
> that need to be
> clarified.
> 
> Documentation is one of the major thrusts before a
> 1.0, so let us know
> where its missing the mark. As always, documentation
> patches are
> welcome too.
> 
> -Rahul
> 
> 
> > +Fasih
> >
> <snip/>
> 
>
---------------------------------------------------------------------
> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/19/06, Fasih <fa...@baypackets.com> wrote:
<snip/>
>
> By the way, you can look at the code from SVN. I couldn't find much
> documentation, the code itself is the best guide.
>
<snap/>

This is true. One of the things that we'd appreciate feedback on is
how the documentation can be improved. There are a bunch of things in
code that are not properly documented, and there are bunch of things
that unfortunately may have been taken for granted that need to be
clarified.

Documentation is one of the major thrusts before a 1.0, so let us know
where its missing the mark. As always, documentation patches are
welcome too.

-Rahul


> +Fasih
>
<snip/>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
I just posted in another thread [1] my use case.
Basically I will add point 4 to your list:

4. A jexl method invocation will need to have in the
context an object instance to be used.

Just to be clear with my usecase:

The http-call comes, then I instantiate a Service
instance that holds an Executor per session. This
Service Instance class is supposed to insert itself in
the exec context because the class has (for example in
my case) a boolean method that will execute all
specific tasks and return true upon success and the
method will be used by jexl parser to evaluate a
post-condition.

Thanks,
Nestor
[1] [SCXML] patterns for bridging 
--- Fasih <fa...@baypackets.com> wrote:

> 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" <ne...@yahoo.com>
> To: "Jakarta Commons Users List"
> <co...@jakarta.apache.org>
> 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:
> > <if cond="${foo.bar eq barString}");
> >
> > for the statement --> Evaluator evaluator = new
> > JexlEvaluator(); in the scxml we could have:
> > <if cond="foo.bar eq barString");
> >
> > 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 <fa...@baypackets.com>
> 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" <ne...@yahoo.com>
> >> To: "Jakarta Commons Users List"
> >> <co...@jakarta.apache.org>
> >> 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 <fa...@baypackets.com>
> >> 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" <ne...@yahoo.com>
> >> >> To: "Jakarta Commons Users List"
> >> >> <co...@jakarta.apache.org>
> >> >> 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
> 
> 


__________________________________________________
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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Fasih <fa...@baypackets.com>.
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" <ne...@yahoo.com>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
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:
> <if cond="${foo.bar eq barString}");
>
> for the statement --> Evaluator evaluator = new
> JexlEvaluator(); in the scxml we could have:
> <if cond="foo.bar eq barString");
>
> 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 <fa...@baypackets.com> 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" <ne...@yahoo.com>
>> To: "Jakarta Commons Users List"
>> <co...@jakarta.apache.org>
>> 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 <fa...@baypackets.com>
>> 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" <ne...@yahoo.com>
>> >> To: "Jakarta Commons Users List"
>> >> <co...@jakarta.apache.org>
>> >> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
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:
<if cond="${foo.bar eq barString}");

for the statement --> Evaluator evaluator = new
JexlEvaluator(); in the scxml we could have:
<if cond="foo.bar eq barString");

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 <fa...@baypackets.com> 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" <ne...@yahoo.com>
> To: "Jakarta Commons Users List"
> <co...@jakarta.apache.org>
> 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 <fa...@baypackets.com>
> 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" <ne...@yahoo.com>
> >> To: "Jakarta Commons Users List"
> >> <co...@jakarta.apache.org>
> >> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Fasih <fa...@baypackets.com>.
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" <ne...@yahoo.com>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
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 <fa...@baypackets.com> 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" <ne...@yahoo.com>
>> To: "Jakarta Commons Users List"
>> <co...@jakarta.apache.org>
>> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
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 <fa...@baypackets.com> 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" <ne...@yahoo.com>
> To: "Jakarta Commons Users List"
> <co...@jakarta.apache.org>
> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Fasih <fa...@baypackets.com>.
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" <ne...@yahoo.com>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
Sure I just added Bug 39367 ... 
Thanks

--- Rahul Akolkar <ra...@gmail.com> wrote:

> On 4/20/06, Nestor Urquiza <ne...@yahoo.com>
> wrote:
> > I put the example in my last response to Faish and
> of
> > course if having the getter
> > SCXMLExecutor#getRootContext() can be avoided for
> my
> > use case I rather do it.
> >
> > I am using a propietary kind of servlet container
> and
> > the way context is managed is with a simple Map
> but I
> > would really like to have my code at "bridge"
> level
> > not dependant on this particular servlet
> > implementation. I can even put the rootCtx in the
> > context as I am doing with my exec in the "system"
> > (also called most recently "domain" by you) layer
> > because the main problem of course is that it is
> not
> > enough to have the exec object if I want to
> manipulate
> > the root context.
> >
> > So given those facts do you have an alternative
> for my
> > usecase other than making available
> > SCXMLExecutor#getRootContext()?
> <snip/>
> 
> Ah, proprietary stuff ;-) You could provide a root
> context that was a
> JexlContext instantiated using the Map argument
> constructor, that way
> whatever is in the "simple Map" above is in the
> Context. The only
> difference in moving to another container would
> probably be how that
> Map is obtained, maybe that is significant enough
> for making this
> addition.
> 
> Can you file a report in bugzilla [1] with some
> details on how the
> getter helps interoperability for your usage? I know
> its a small
> change, but we should have better archival for why
> someone would like
> to set vars on the root context (rather than setting
> them in the
> "environment" itself) before making the change, IMO.
> 
> -Rahul
> 
> [1]
>
http://jakarta.apache.org/commons/sandbox/scxml/issue-tracking.html
> 
> 
> > Thanks!
> >
> <snap/>
> 
>
---------------------------------------------------------------------
> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/20/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> I put the example in my last response to Faish and of
> course if having the getter
> SCXMLExecutor#getRootContext() can be avoided for my
> use case I rather do it.
>
> I am using a propietary kind of servlet container and
> the way context is managed is with a simple Map but I
> would really like to have my code at "bridge" level
> not dependant on this particular servlet
> implementation. I can even put the rootCtx in the
> context as I am doing with my exec in the "system"
> (also called most recently "domain" by you) layer
> because the main problem of course is that it is not
> enough to have the exec object if I want to manipulate
> the root context.
>
> So given those facts do you have an alternative for my
> usecase other than making available
> SCXMLExecutor#getRootContext()?
<snip/>

Ah, proprietary stuff ;-) You could provide a root context that was a
JexlContext instantiated using the Map argument constructor, that way
whatever is in the "simple Map" above is in the Context. The only
difference in moving to another container would probably be how that
Map is obtained, maybe that is significant enough for making this
addition.

Can you file a report in bugzilla [1] with some details on how the
getter helps interoperability for your usage? I know its a small
change, but we should have better archival for why someone would like
to set vars on the root context (rather than setting them in the
"environment" itself) before making the change, IMO.

-Rahul

[1] http://jakarta.apache.org/commons/sandbox/scxml/issue-tracking.html


> Thanks!
>
<snap/>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Nestor Urquiza <ne...@yahoo.com>.
I put the example in my last response to Faish and of
course if having the getter
SCXMLExecutor#getRootContext() can be avoided for my
use case I rather do it.

I am using a propietary kind of servlet container and
the way context is managed is with a simple Map but I
would really like to have my code at "bridge" level
not dependant on this particular servlet
implementation. I can even put the rootCtx in the
context as I am doing with my exec in the "system"
(also called most recently "domain" by you) layer
because the main problem of course is that it is not
enough to have the exec object if I want to manipulate
the root context.

So given those facts do you have an alternative for my
usecase other than making available
SCXMLExecutor#getRootContext()?
Thanks!

--- Rahul Akolkar <ra...@gmail.com> wrote:

> On 4/19/06, Nestor Urquiza <ne...@yahoo.com>
> wrote:
> > Hello,
> > I am planning to store just the SCXMLExecutor in a
> per
> > session basis.
> <snip/>
> 
> Sounds good.
> 
> 
> > 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!
> >
> <snap/>
> 
> No, its best not made public. The SCInstance is
> really getting into
> the internals of the SCXML engine. It holds the
> references needed for
> a particular execution, the contexts and histories
> for that execution,
> and shouldn't be exposed to the casual user.
> However, for "advanced"
> usage, accessing these internals are often
> necessary, so for users who
> wish to author:
> 
>  * Custom actions
>  * Custom SCXML semantics
> 
> the SCInstance is made available via method
> signatures in the public
> contract (see SCXMLSemantics interface, and custom
> actions page in
> user guide).
> 
> The root context for an SCXML document is its link
> to the environment
> this document is being used in (i.e. the environment
> variables). It
> often merely wraps another "context" (set of
> variables). Couple of
> examples:
> 
>  * The RootContext in the o.a.c.s.env.jsp package
> wraps a JspContext,
> i.e. any variables defined in the JSP are available
> within the SCXML
> document
>  * The SessionContext in the o.a.c.s.env.faces
> package wraps a
> "session map", i.e. any attributes defined in the
> associated session
> are available within the SCXML document
> 
> The nightlies by no means provide a complete list of
> such Context
> impls, and you may have to write one if needed (but
> the impls are
> usually trivial, since they merely delegate to some
> backing
> environment context).
> 
> So, often setting variables in the root context does
> *not* involve this:
> 
> // assuming the getter method was available
> exec.getRootContext().set("foo", fooValue)
> 
> rather something like so:
> 
> <c:set var="foo" value="foovalue" /> <%-- in host
> JSP --%>
> 
> or so:
> 
> session.setAttribute("foo", foovalue); // defining
> session attribute
> 
> and that gets picked up due to the delegating root
> context.
> 
> Also, as Faish points out, the pseudo often looks
> like:
> 
> <pseudo>
> Context rootCtx = // new suitable context type
> SCXMLExecutor exec = // new executor
> exec.setRootContext(rootCtx);
> exec.setStateMachine(// parsed, procedurally
> constructed SCXML object);
> </pseudo>
> 
> We probably could have a symmetric
> SCXMLExecutor#getRootContext() to
> match the setter, but the absence of a getter
> actually encourages the
> preferred latter usages (please open a request in
> bugzilla [1] for the
> getter if you have an example of why you'd rather
> set variables using
> the former usage).
> 
> -Rahul
> 
> [1]
>
http://jakarta.apache.org/commons/sandbox/scxml/issue-tracking.html
> 
>
---------------------------------------------------------------------
> 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


Re: [scxml] SCXMLExecutor#getSCInstance ... any chance to make it public?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/19/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> Hello,
> I am planning to store just the SCXMLExecutor in a per
> session basis.
<snip/>

Sounds good.


> 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!
>
<snap/>

No, its best not made public. The SCInstance is really getting into
the internals of the SCXML engine. It holds the references needed for
a particular execution, the contexts and histories for that execution,
and shouldn't be exposed to the casual user. However, for "advanced"
usage, accessing these internals are often necessary, so for users who
wish to author:

 * Custom actions
 * Custom SCXML semantics

the SCInstance is made available via method signatures in the public
contract (see SCXMLSemantics interface, and custom actions page in
user guide).

The root context for an SCXML document is its link to the environment
this document is being used in (i.e. the environment variables). It
often merely wraps another "context" (set of variables). Couple of
examples:

 * The RootContext in the o.a.c.s.env.jsp package wraps a JspContext,
i.e. any variables defined in the JSP are available within the SCXML
document
 * The SessionContext in the o.a.c.s.env.faces package wraps a
"session map", i.e. any attributes defined in the associated session
are available within the SCXML document

The nightlies by no means provide a complete list of such Context
impls, and you may have to write one if needed (but the impls are
usually trivial, since they merely delegate to some backing
environment context).

So, often setting variables in the root context does *not* involve this:

// assuming the getter method was available
exec.getRootContext().set("foo", fooValue)

rather something like so:

<c:set var="foo" value="foovalue" /> <%-- in host JSP --%>

or so:

session.setAttribute("foo", foovalue); // defining session attribute

and that gets picked up due to the delegating root context.

Also, as Faish points out, the pseudo often looks like:

<pseudo>
Context rootCtx = // new suitable context type
SCXMLExecutor exec = // new executor
exec.setRootContext(rootCtx);
exec.setStateMachine(// parsed, procedurally constructed SCXML object);
</pseudo>

We probably could have a symmetric SCXMLExecutor#getRootContext() to
match the setter, but the absence of a getter actually encourages the
preferred latter usages (please open a request in bugzilla [1] for the
getter if you have an example of why you'd rather set variables using
the former usage).

-Rahul

[1] http://jakarta.apache.org/commons/sandbox/scxml/issue-tracking.html

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org