You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rahul Akolkar <ra...@gmail.com> on 2006/04/05 19:53:32 UTC

Re: [SCXML] uml2bpel cool, but what about csxml2bpel?

Consolidating two replies in one, and assuming CSXML is just a
(repeated) typo for SCXML ...

On 4/5/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> Hi everyone,
> Yesterday I posted something about the job I am
> planning to do for a business protocol and Rauhl
> headed me up towards BPEL4WS.
> I then found
> http://www-128.ibm.com/developerworks/webservices/library/ws-uml2bpel/
> as a tool for converting from Rational UML diagrams to
> BPEL ... the problem I see with that approach is that
> a diagram is not easy to maintain as it is an xml
> file.
<snip/>

And that a diagram doesn't do anything for you at the middleware and
runtime levels, which is where SCXML comes in [1]. That is why there
is code generation, C++ and Java stubs from class diagrams come with
the Rational stack already, the way to think of SCXML documents in
this context -- as you've noticed -- is what the state machine diagram
gets transformed to (for example, all usecases on the Commons SCXML
website are accompanied by matching state machine diagrams for each
document). The modeling diagrams are extremely useful, and should be
the basis for the SCXML document, however, thats another discussion.


> CSXML is the xml representation of a StateChart
> diagram and I am wondering if anyone here knows about
> any plans from IBM or better open source to use them
> both (CSXML and BPEL).
> My particular task does not require SOAP and in fact
> seems like the clients are more for simple GET/POST
> still of course having a state behaviour. Of course in
> any case since Web Services are a future target I am
> interesting in getting any info you might be have
> about this.
> Maybe you can point me to a better place to post this
> proposal (ibm - developer works, eclipse framework or
> one of the already existing UML frameworks)
<snap/>

I personally do not have any more information about Eclipse framework
development (or whats happening with BPEL) than what is publicly
available, but the second hit on google for "commons scxml eclipse"
(without the quotes, ofcourse) gave me this message:

http://dev.eclipse.org/mhonarc/lists/vtp-dev/msg00151.html

So, seems atleast some portions of Eclipse land seem to be looking at
using Commons SCXML.

I also can't say what the best place to "post this proposal" is. There
are clear similarities in most state machine notations, for example,
check this gutted BPEL snippet:

<process ...>

 <variables>
 ...
 </variables>

 <flow ...>
  <!-- receive, invoke, assign, reply etc. -->
 </flow>

</process>

and this SCXML snippet:

<scxml ...>

 <datamodel>
 ...
 </datamodel>

 <state ...> <!-- composite state -->
  <!-- sub-states, invoke, params, assigns, sends, onentry/onexit etc. -->
 </state>

</scxml>

and while there may be deltas semantically to be bridged, transforms
are just waiting to be written. But beyond simulations and testing,
what this means in terms of using Commons SCXML in the BPEL domain, I
don't know, and haven't looked at it before you asked. If you have
ideas, feel free to shoot them this way.


> Any help greatly appreciated. Reinventing wheel is
> something I do not want to do for sure
> Thanks
> Nestor
>
On 4/5/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> I see that ws-uml2bpel uses XMI to build BPEL, WSDL,
> and XSD files so the question can be also ... any
> XMI2CSXML convertor around there?
> BTW is Rose or XDE the only options as eclipse plugin
> for building a proper uml diagram that can be exported
> as XMI or even better to CSXML?
> thanks!
>
<snip/>

At this time, probably yes. I don't trust anything other than the
Rational stack for my UML work anyway, but thats a personal
preference. However, tooling and format conversions understandably
take time, and I see signs of both these things happening.

As with any emerging technology (and I'd consider SCXML to be one),
whether you can adopt it right now depends on what you're trying to
achieve (you will find similar sentiments echoing across numerous
emerging technologies -- this may sound obvious, but its often
worthwhile to list out the scenarios):

 * If you're working on a tight deadline on an existing project which
already uses some notation for state charts for its domain(s), stick
with the notation and tools you have.

 * If you're starting a new project, spend a few cycles to evaluate
whether using Commons SCXML makes sense. A clear benefit is you don't
have to own the notation or the implementation (if you're owning it).
Additionally, it may help with any existing limitations. I've done
this more than once and found Commons SCXML did things that I needed
(see usecases on website).

 * If you need to invent a state machine notation for your domain,
don't. Use SCXML. Otherwise it will just be YASCN (yet another state
chart notation). And that, truly, is reinventing the proverbial wheel.

-Rahul

[1] http://people.apache.org/~rahul/CommonsSCXML.pdf (see page 2)

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


Re: [SCXML] uml2bpel cool, but what about csxml2bpel?

Posted by Nestor Urquiza <ne...@yahoo.com>.
Thanks for this Rahul
best regards,
Nestor

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

> On 4/6/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> <snip/>
> >
> > You are right I should have started a new thred to
> > request to you mainly as we already said the
> plugin
> > and the available mdl files.
> >
> <snap/>
> 
> Ping.
> 
> I've uploaded the state machine diagrams in my home
> directory [1] --
> grab CommonsSCXMLUsecases.zip -- as I had mentioned
> before I use
> Rational, so you will either need the Modeler or the
> Software
> Architect (v 6.0 or up) to pull in the model (import
> using project
> interchange format, should be straightforward).
> 
> I'm sure such diagrams can be generated using a
> plethora of other
> softwares as well. As an update, I'm also checking
> on the plugin
> front, no news there yet -- will ping again when
> there is (the plugin
> is also Rational specific).
> 
> -Rahul
> 
> [1] http://people.apache.org/~rahul/
> 
> 
> >
> > 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] uml2bpel cool, but what about csxml2bpel?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/6/06, Nestor Urquiza <ne...@yahoo.com> wrote:
<snip/>
>
> You are right I should have started a new thred to
> request to you mainly as we already said the plugin
> and the available mdl files.
>
<snap/>

Ping.

I've uploaded the state machine diagrams in my home directory [1] --
grab CommonsSCXMLUsecases.zip -- as I had mentioned before I use
Rational, so you will either need the Modeler or the Software
Architect (v 6.0 or up) to pull in the model (import using project
interchange format, should be straightforward).

I'm sure such diagrams can be generated using a plethora of other
softwares as well. As an update, I'm also checking on the plugin
front, no news there yet -- will ping again when there is (the plugin
is also Rational specific).

-Rahul

[1] http://people.apache.org/~rahul/


>
> 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] uml2bpel cool, but what about csxml2bpel?

Posted by Nestor Urquiza <ne...@yahoo.com>.

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

> On 4/6/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> >
> > --- Rahul Akolkar <ra...@gmail.com> wrote:
> >
> <snip/>
> > >
> > > Yes, that plugin takes the EMF model for the
> state
> > > chart diagram and
> > > converts it to its SCXML document serialization.
> > Could you help me to get that plugin?
> <snap/>
> 
> Could you please put a line or two of whitespace
> between the earlier
> post and yours? Sorry if I'm being too picky, it
> just takes less
> effort to read if there is some whitespace between
> responses. Thanks
> in advance.
> 

Makes absolutely sense. You got it!


> Let me check on the plugin front, last time I
> checked it wasn't
> publicly available (but it was meant to be at some
> point AFAIK).
> 

Yes please!

> 
> > > None of the Java
> > > classes for the usecases involved any roundtrips
> > > from the modeling
> > > layer, primarily because the usecases make for
> > > fairly trivial class
> > > diagrams. But that is indeed the larger picture.
> > Perfect! and what about the classes for the main
> > common-scxml api? Are you making or planning
> roundtrip
> > for them?
> > >
> <snap/>
> 
> Yes, Commons SCXML started with a UML class diagram.
> I might still
> have the initial cuts lying around somewhere. The
> model package is
> mostly code-gen'ed from that UML model. There are
> fewer round-trips
> these days. Ofcourse, this is not really relevant to
> our other
> discussion, but merely some trivia at this point :-)
> 

You are right I should have started a new thred to
request to you mainly as we already said the plugin
and the available mdl files. 

> -Rahul

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] uml2bpel cool, but what about csxml2bpel?

Posted by "Mike Sparr - www.goomzee.com" <mi...@goomzee.com>.
Hey Rahul,

Do I have to update my version (december snapshot) and implement <datamodel>
to set global application variables?  I would like to set variables that all
states/transitions can access and <assign> or cond="${var}".  I got it to
work by declaring vars WITHIN the transition and passing in namelist for
SEND..  

See my other post about variable scoping.  Help appreciated.

Rgds,


Mike





On 4/6/06 9:24 AM, "Rahul Akolkar" <ra...@gmail.com> wrote:

> On 4/6/06, Nestor Urquiza <ne...@yahoo.com> wrote:
>> 
>> --- Rahul Akolkar <ra...@gmail.com> wrote:
>> 
> <snip/>
>>> 
>>> Yes, that plugin takes the EMF model for the state
>>> chart diagram and
>>> converts it to its SCXML document serialization.
>> Could you help me to get that plugin?
> <snap/>
> 
> Could you please put a line or two of whitespace between the earlier
> post and yours? Sorry if I'm being too picky, it just takes less
> effort to read if there is some whitespace between responses. Thanks
> in advance.
> 
> Let me check on the plugin front, last time I checked it wasn't
> publicly available (but it was meant to be at some point AFAIK).
> 
> 
>>> None of the Java
>>> classes for the usecases involved any roundtrips
>>> from the modeling
>>> layer, primarily because the usecases make for
>>> fairly trivial class
>>> diagrams. But that is indeed the larger picture.
>> Perfect! and what about the classes for the main
>> common-scxml api? Are you making or planning roundtrip
>> for them?
>>> 
> <snap/>
> 
> Yes, Commons SCXML started with a UML class diagram. I might still
> have the initial cuts lying around somewhere. The model package is
> mostly code-gen'ed from that UML model. There are fewer round-trips
> these days. Ofcourse, this is not really relevant to our other
> discussion, but merely some trivia at this point :-)
> 
> -Rahul
> 
> ---------------------------------------------------------------------
> 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] uml2bpel cool, but what about csxml2bpel?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/6/06, Nestor Urquiza <ne...@yahoo.com> wrote:
>
> --- Rahul Akolkar <ra...@gmail.com> wrote:
>
<snip/>
> >
> > Yes, that plugin takes the EMF model for the state
> > chart diagram and
> > converts it to its SCXML document serialization.
> Could you help me to get that plugin?
<snap/>

Could you please put a line or two of whitespace between the earlier
post and yours? Sorry if I'm being too picky, it just takes less
effort to read if there is some whitespace between responses. Thanks
in advance.

Let me check on the plugin front, last time I checked it wasn't
publicly available (but it was meant to be at some point AFAIK).


> > None of the Java
> > classes for the usecases involved any roundtrips
> > from the modeling
> > layer, primarily because the usecases make for
> > fairly trivial class
> > diagrams. But that is indeed the larger picture.
> Perfect! and what about the classes for the main
> common-scxml api? Are you making or planning roundtrip
> for them?
> >
<snap/>

Yes, Commons SCXML started with a UML class diagram. I might still
have the initial cuts lying around somewhere. The model package is
mostly code-gen'ed from that UML model. There are fewer round-trips
these days. Ofcourse, this is not really relevant to our other
discussion, but merely some trivia at this point :-)

-Rahul

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


Re: [SCXML] uml2bpel cool, but what about csxml2bpel?

Posted by Nestor Urquiza <ne...@yahoo.com>.

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

> On 4/5/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> > Thanks for this again. I am trying to convince my
> team
> > to go with an SCXML (apologies for several typos)
> > approach even though there is no stable release
> still.
> <snip/>
> 
> Yup, [scxml] needs to "graduate sandbox" first.
> While I can't
> guarantee when that will happen (no one person can),
> I will call a
> second vote for this on the commons dev list soon.
> Other than that, if
> your team has questions, I'm here.
awesome, thanks
> 
> 
> > another thing ... are you going to publish the mdl
> > files you are using for the project?
> <snap/>
> 
> You mean the state machine diagrams? Can't access
> that disk right now,
> give me a day or two. I'll ping this thread when
> they're posted.
Yes please! Thanks!
> 
> 
> > I saw you have in one of the screenshots the mdl
> for
> > the StopWatch Use case for example, specifically
> for
> > the StateChart ... Now, I see from the url below
> [1]
> > that you have like an eclipse plugin to make your
> UML
> > to SCXML conversion?
> > Also are you making round trip for all of your
> classes
> > as well meaning do you have mdls for your OOP
> design
> > as well?
> <snip/>
> 
> Yes, that plugin takes the EMF model for the state
> chart diagram and
> converts it to its SCXML document serialization.
Could you help me to get that plugin?
> None of the Java
> classes for the usecases involved any roundtrips
> from the modeling
> layer, primarily because the usecases make for
> fairly trivial class
> diagrams. But that is indeed the larger picture.
Perfect! and what about the classes for the main
common-scxml api? Are you making or planning roundtrip
for them?
> 
> 
> > as always I really appreciate your help
> > Thanks a lot again,
> <snap/>
> 
> You're just as welcome,
Glad to read it!
> -Rahul
> 
> 
> > Nestor
> >
> >
> > --- Rahul Akolkar <ra...@gmail.com> wrote:
> <snip/>
> > >
> > > [1]
> http://people.apache.org/~rahul/CommonsSCXML.pdf
> > > (see page 2)
> > >
> <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] uml2bpel cool, but what about csxml2bpel?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/5/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> Thanks for this again. I am trying to convince my team
> to go with an SCXML (apologies for several typos)
> approach even though there is no stable release still.
<snip/>

Yup, [scxml] needs to "graduate sandbox" first. While I can't
guarantee when that will happen (no one person can), I will call a
second vote for this on the commons dev list soon. Other than that, if
your team has questions, I'm here.


> another thing ... are you going to publish the mdl
> files you are using for the project?
<snap/>

You mean the state machine diagrams? Can't access that disk right now,
give me a day or two. I'll ping this thread when they're posted.


> I saw you have in one of the screenshots the mdl for
> the StopWatch Use case for example, specifically for
> the StateChart ... Now, I see from the url below [1]
> that you have like an eclipse plugin to make your UML
> to SCXML conversion?
> Also are you making round trip for all of your classes
> as well meaning do you have mdls for your OOP design
> as well?
<snip/>

Yes, that plugin takes the EMF model for the state chart diagram and
converts it to its SCXML document serialization. None of the Java
classes for the usecases involved any roundtrips from the modeling
layer, primarily because the usecases make for fairly trivial class
diagrams. But that is indeed the larger picture.


> as always I really appreciate your help
> Thanks a lot again,
<snap/>

You're just as welcome,
-Rahul


> Nestor
>
>
> --- Rahul Akolkar <ra...@gmail.com> wrote:
<snip/>
> >
> > [1] http://people.apache.org/~rahul/CommonsSCXML.pdf
> > (see page 2)
> >
<snap/>

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


Re: [SCXML] uml2bpel cool, but what about csxml2bpel?

Posted by Nestor Urquiza <ne...@yahoo.com>.
Thanks for this again. I am trying to convince my team
to go with an SCXML (apologies for several typos)
approach even though there is no stable release still.
another thing ... are you going to publish the mdl
files you are using for the project?
I saw you have in one of the screenshots the mdl for
the StopWatch Use case for example, specifically for
the StateChart ... Now, I see from the url below [1]
that you have like an eclipse plugin to make your UML
to SCXML conversion?
Also are you making round trip for all of your classes
as well meaning do you have mdls for your OOP design
as well?
as always I really appreciate your help
Thanks a lot again,
Nestor


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

> Consolidating two replies in one, and assuming CSXML
> is just a
> (repeated) typo for SCXML ...
> 
> On 4/5/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> > Hi everyone,
> > Yesterday I posted something about the job I am
> > planning to do for a business protocol and Rauhl
> > headed me up towards BPEL4WS.
> > I then found
> >
>
http://www-128.ibm.com/developerworks/webservices/library/ws-uml2bpel/
> > as a tool for converting from Rational UML
> diagrams to
> > BPEL ... the problem I see with that approach is
> that
> > a diagram is not easy to maintain as it is an xml
> > file.
> <snip/>
> 
> And that a diagram doesn't do anything for you at
> the middleware and
> runtime levels, which is where SCXML comes in [1].
> That is why there
> is code generation, C++ and Java stubs from class
> diagrams come with
> the Rational stack already, the way to think of
> SCXML documents in
> this context -- as you've noticed -- is what the
> state machine diagram
> gets transformed to (for example, all usecases on
> the Commons SCXML
> website are accompanied by matching state machine
> diagrams for each
> document). The modeling diagrams are extremely
> useful, and should be
> the basis for the SCXML document, however, thats
> another discussion.
> 
> 
> > CSXML is the xml representation of a StateChart
> > diagram and I am wondering if anyone here knows
> about
> > any plans from IBM or better open source to use
> them
> > both (CSXML and BPEL).
> > My particular task does not require SOAP and in
> fact
> > seems like the clients are more for simple
> GET/POST
> > still of course having a state behaviour. Of
> course in
> > any case since Web Services are a future target I
> am
> > interesting in getting any info you might be have
> > about this.
> > Maybe you can point me to a better place to post
> this
> > proposal (ibm - developer works, eclipse framework
> or
> > one of the already existing UML frameworks)
> <snap/>
> 
> I personally do not have any more information about
> Eclipse framework
> development (or whats happening with BPEL) than what
> is publicly
> available, but the second hit on google for "commons
> scxml eclipse"
> (without the quotes, ofcourse) gave me this message:
> 
>
http://dev.eclipse.org/mhonarc/lists/vtp-dev/msg00151.html
> 
> So, seems atleast some portions of Eclipse land seem
> to be looking at
> using Commons SCXML.
> 
> I also can't say what the best place to "post this
> proposal" is. There
> are clear similarities in most state machine
> notations, for example,
> check this gutted BPEL snippet:
> 
> <process ...>
> 
>  <variables>
>  ...
>  </variables>
> 
>  <flow ...>
>   <!-- receive, invoke, assign, reply etc. -->
>  </flow>
> 
> </process>
> 
> and this SCXML snippet:
> 
> <scxml ...>
> 
>  <datamodel>
>  ...
>  </datamodel>
> 
>  <state ...> <!-- composite state -->
>   <!-- sub-states, invoke, params, assigns, sends,
> onentry/onexit etc. -->
>  </state>
> 
> </scxml>
> 
> and while there may be deltas semantically to be
> bridged, transforms
> are just waiting to be written. But beyond
> simulations and testing,
> what this means in terms of using Commons SCXML in
> the BPEL domain, I
> don't know, and haven't looked at it before you
> asked. If you have
> ideas, feel free to shoot them this way.
> 
> 
> > Any help greatly appreciated. Reinventing wheel is
> > something I do not want to do for sure
> > Thanks
> > Nestor
> >
> On 4/5/06, Nestor Urquiza <ne...@yahoo.com> wrote:
> > I see that ws-uml2bpel uses XMI to build BPEL,
> WSDL,
> > and XSD files so the question can be also ... any
> > XMI2CSXML convertor around there?
> > BTW is Rose or XDE the only options as eclipse
> plugin
> > for building a proper uml diagram that can be
> exported
> > as XMI or even better to CSXML?
> > thanks!
> >
> <snip/>
> 
> At this time, probably yes. I don't trust anything
> other than the
> Rational stack for my UML work anyway, but thats a
> personal
> preference. However, tooling and format conversions
> understandably
> take time, and I see signs of both these things
> happening.
> 
> As with any emerging technology (and I'd consider
> SCXML to be one),
> whether you can adopt it right now depends on what
> you're trying to
> achieve (you will find similar sentiments echoing
> across numerous
> emerging technologies -- this may sound obvious, but
> its often
> worthwhile to list out the scenarios):
> 
>  * If you're working on a tight deadline on an
> existing project which
> already uses some notation for state charts for its
> domain(s), stick
> with the notation and tools you have.
> 
>  * If you're starting a new project, spend a few
> cycles to evaluate
> whether using Commons SCXML makes sense. A clear
> benefit is you don't
> have to own the notation or the implementation (if
> you're owning it).
> Additionally, it may help with any existing
> limitations. I've done
> this more than once and found Commons SCXML did
> things that I needed
> (see usecases on website).
> 
>  * If you need to invent a state machine notation
> for your domain,
> don't. Use SCXML. Otherwise it will just be YASCN
> (yet another state
> chart notation). And that, truly, is reinventing the
> proverbial wheel.
> 
> -Rahul
> 
> [1] http://people.apache.org/~rahul/CommonsSCXML.pdf
> (see page 2)
> 
>
---------------------------------------------------------------------
> 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] variable scoping

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/7/06, Mike Sparr - www.goomzee.com <mi...@goomzee.com> wrote:
> Hi Rahul,
>
> I have consolidated questions that have been looming below, plus response to
> your input on variable scoping.
>
>
> WILL CHECK SYNTAX BASED ON SUGGESTIONS.
> Tomorrow I will upgrade our snapshot with your changes.  This message got
> filtered as junk mail so I didn't see it until now.  Thanks for the input.
> Yes, based upon spec I should've been able to lazily instantiate the vars
> w/o expr="" but will test that out with this snapshot.  I did try the
> <onentry><var...> and got exceptions but that could've been because I didn't
> declare them as blank.  I think I used expr="''" and other variations to get
> it to work.
>
<snip/>

An empty expr attribute is no longer needed if you just want to define
a variable with <var> (with a null associated value) -- fixed earlier
in the week. The messages you are seeing in the logs are coming from
the namelist in the <send> element, when the value of one or more
variables in the namelist is null (one log message per variable) --
that is just to flag that a value of null was sent over the wire,
which *might* be of interest for error reporting purposes.

However, the error message is quite misleading, it says
"UNDEFINED_VARIABLE" where it should really say something to the
effect of "NULL_PARAMETER". If you want, you can file a report in
bugzilla (details here [1]) for a better error message, so we don't
forget this.


>
> SVN CHECKOUT?
> The datamodel seems like best option so I'm looking forward to updating our
> snapshot.  Offhand, do you know the svn command/url to check out your
> latest?  First I'll test against your nightly binary tomorrow, but I have an
> ANT build script for packaging everything so I want to pull down source.
>
<snap/>

Sure, the Commons SCXML website [2] has all the information, including
the SVN checkout URL and page on building Commons SCXML (see
navigation bar on left). Building should be straightforward, since
even with ant the dependencies are downloaded (which may not always be
the most optimal approach, though its often easier). If you have
trouble building, please ping the list.


>
> XMLNS ON/OFF IN DIGESTER?
> In addition, I recall a while back that we modified your source to exclude
> the xmlns handling in the digester - what was your final solution to that?
> Did you turn it off, leave it on or make it configurable via the factory
> suggestion?
>
<snip/>

Yes, I remember that discussion. The outcome then was to allow
digester instances configured for SCXML parsing to be available for
further customization. Take a look at the SCXMLDigester class [3],
specifically the newInstance() method. This page [4] from the user
guide talks about customizing the Digester per individual needs, and
though it talks about custom actions, the idea for any kind of
customization is similar. The default SCXML digester is namespace
aware.


>
> EL QUESTION (substring):
> The voice browser being used (Nuance) had built-in grammars and leveraging
> the currency grammar returns "USD20" for 20 dollars.  In the EL I've tried
> various attempts to parseInt or substring or replace to no avail.  How would
> I remove the currency code prefix using the EL in the framework?  Do you
> have a document on available functions - I've tried JSP 2.0 functions and
> they didn't exist and documentation on Commons EL usage resorts to JavaDoc
> but little/no function reference.  Suggest Commons EL team copy PHP.net and
> list all available functions with description/examples...
>
<snap/>

Function invocation with JSP 2.0 EL (or why there was a lack thereof)
has been a fun topic. JSP 2.0 EL does allow you to invoke "namespaced"
functions, which are mapped to static Java methods. There are no
"available functions". There is JSTL, which provides a functions tag
library, and it does have the substringAfter() which is probably what
you'd need here. The FunctionMapper in the Commons SCXML distro is not
mapped to recognise that. It will indeed be useful, and for that,
please open an enhancement request in bugzilla. The list of JSTL
functions, BTW, is here [5].

<sidebar>
While EL was the only expression language available in the early days
of Commons SCXML, we can now use JEXL [6] as well. JEXL should be
preferred since it allows method invocation and the ability to define
custom functions would probably be easier given that JEXL 1.1 (not yet
released) will support static method invocation. Migration from
EL-based SCXML documents to JEXL-based SCXML documents, in many cases,
is not much work. EL based documents make sense in servlet container
based usecases, specifically those that may be tied to JSP/JSF
technologies. Not sure if your usecase is so tied.
</sidebar>


>
> SUGGESTION/QUESTION (toggle hot deploy/performance):
> I think it would be beneficial to add in configurable hot-deploy/performance
> modes.  Hot-deploy would reload the engine document upon change and
> performance would not.  This likely would not be part of the commons
> contrib. but do you know how I could implement that.  The flexibility of
> scripting new cases in the XML is enticing but continual server reboots to
> clear memory hassle, especially for development.  Suggestions?
>
<snip/>

These are good points. If you're looking for hints, one possibility
might be to look at how servlet containers "listen to" updates to web
application descriptors (take Tomcat for instance, since we have the
source ;-). If this can be done concisely, it can definitely be part
of Commons SCXML, but its probably not on the 1.0 roadmap. If you have
ideas about this (or even otherwise), you can open another enhancement
request in bugzilla.

Furthermore, in theory, it is also possible to programmatically alter
the state machine's in memory representation (using the Commons SCXML
object model), and this opens up the topic of enabling "adaptive
behavior" -- and I find that quite interesting. To make that
practical, some utilities will need to be added to Commons SCXML so
its fairly straighforward for the user, such that most internal
wirings for the object model are taken care of automagically. This
should also be on the long term roadmap for Commons SCXML (another
enhancement request, I might open this one myself instead of asking
you to open all these ;-).


>
> SUGGESTION/QUESTION (performance/memory for executor store):
> If app runs a long time, executor store may become rather large.  Suggested
> implementation?  Currently Hashmap w/o worker for cleanup, ttl, timestamp.
> Curious if best with timestap, ttl and perhaps LRU LinkedList
> implementation?
>
<snap/>

We now use a stateless model for Commons SCXML, see issue 38311 [7]
for the details. This means the document needs to be parsed only once
(only one SCXML object is created), and the SCXMLExecutor's should be
made candidates for being collected when you're done with them (in the
worst case, they'll be lost as each session terminates/expires). So am
not sure if anything beyond that is needed. Are you having any memory
issues when using the latest nightlies?

-Rahul

(long, possibly fragmented, URLs below)

[1] http://jakarta.apache.org/commons/sandbox/scxml/issue-tracking.html
[2] http://jakarta.apache.org/commons/sandbox/scxml/
[3] http://jakarta.apache.org/commons/sandbox/scxml/apidocs/org/apache/commons/scxml/io/SCXMLDigester.html
[4] http://jakarta.apache.org/commons/sandbox/scxml/guide/custom-actions.html
[5] http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/tld-summary.html
[6] http://jakarta.apache.org/commons/jexl/
[7] http://issues.apache.org/bugzilla/show_bug.cgi?id=38311


>
> Mike
>
>
<snip/>

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


Re: [SCXML] variable scoping

Posted by "Mike Sparr - www.goomzee.com" <mi...@goomzee.com>.
Hi Rahul,

I have consolidated questions that have been looming below, plus response to
your input on variable scoping.


WILL CHECK SYNTAX BASED ON SUGGESTIONS.
Tomorrow I will upgrade our snapshot with your changes.  This message got
filtered as junk mail so I didn't see it until now.  Thanks for the input.
Yes, based upon spec I should've been able to lazily instantiate the vars
w/o expr="" but will test that out with this snapshot.  I did try the
<onentry><var...> and got exceptions but that could've been because I didn't
declare them as blank.  I think I used expr="''" and other variations to get
it to work.


SVN CHECKOUT?
The datamodel seems like best option so I'm looking forward to updating our
snapshot.  Offhand, do you know the svn command/url to check out your
latest?  First I'll test against your nightly binary tomorrow, but I have an
ANT build script for packaging everything so I want to pull down source.


XMLNS ON/OFF IN DIGESTER?
In addition, I recall a while back that we modified your source to exclude
the xmlns handling in the digester - what was your final solution to that?
Did you turn it off, leave it on or make it configurable via the factory
suggestion?


EL QUESTION (substring):
The voice browser being used (Nuance) had built-in grammars and leveraging
the currency grammar returns "USD20" for 20 dollars.  In the EL I've tried
various attempts to parseInt or substring or replace to no avail.  How would
I remove the currency code prefix using the EL in the framework?  Do you
have a document on available functions - I've tried JSP 2.0 functions and
they didn't exist and documentation on Commons EL usage resorts to JavaDoc
but little/no function reference.  Suggest Commons EL team copy PHP.net and
list all available functions with description/examples...


SUGGESTION/QUESTION (toggle hot deploy/performance):
I think it would be beneficial to add in configurable hot-deploy/performance
modes.  Hot-deploy would reload the engine document upon change and
performance would not.  This likely would not be part of the commons
contrib. but do you know how I could implement that.  The flexibility of
scripting new cases in the XML is enticing but continual server reboots to
clear memory hassle, especially for development.  Suggestions?


SUGGESTION/QUESTION (performance/memory for executor store):
If app runs a long time, executor store may become rather large.  Suggested
implementation?  Currently Hashmap w/o worker for cleanup, ttl, timestamp.
Curious if best with timestap, ttl and perhaps LRU LinkedList
implementation?


Mike




On 4/5/06 11:41 PM, "Rahul Akolkar" <ra...@gmail.com> wrote:

> On 4/5/06, Mike Sparr - www.goomzee.com <mi...@goomzee.com> wrote:
>> Can someone help with variables?  I want to declare some global variables
>> for the xml engine, then have various conditional events set the values of
>> those variables.  I would like to have access to those variables from one
>> transition event to the next.   I get the following errors:
>> 
>> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
>> null):
>> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
>> null):
>> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (toAccount =
>> null):
>> 
> <snip/>
> 
> Two things to do:
> 
> (1) Make sure the <var> elements are inside the <onentry> (or
> transition or onexit) -- which is where executable content is
> permissible. Which reminds me, I think a schema is now available, so
> its about time we start validating the documents in order to flag such
> things at parsing.
> 
> (2) Add an empty expr attribute (expr="") to the <var> elements, or
> wait for the next nightly (20060406) where this oddity will be fixed.
> 
> If that doesn't do it, please post a more complete snippet of the
> document, so we can look at this further.
> 
> -Rahul
> 
> 
>> =======
>> 
>> Tried:
>> 
>> <scxml>
>> <state id="logged_in">
>> ...
>> <var name="fromAccount" />
>> <var name="toAccount" />
>> 
>>     <transition event="banking.transfer" cond="${empty fromAccount and
>> empty toAccount}">
>>            <var name="cb" expr="${Conversation}" />
>>            <assign name="fromAccount" expr="${cb.request}" />
>>            <send target="http://localhost:8080/app" targettype="client"
>> event="banking.transfer" namelist="cb fromAccount toAccount" delay="0"
>> hints="" sendid="0009"><vxml version="2.0">
>> <form>
>> <field name="input">
>> <prompt>
>> To Account?
>> </prompt>
>> <grammar src="builtin:grammar/digits?length=7"></grammar>
>> <noinput><reprompt/></noinput><nomatch><reprompt/></nomatch>
>> </field>
>> <filled namelist="input">
>> <submit next="http://localhost:8080/app/Voice" namelist="input"/>
>> </filled>
>> </form>
>> </vxml>
>>            </send>
>>         <target next="logged_in" />
>>     </transition>
>> 
>> ======
>> 
> 
> ---------------------------------------------------------------------
> 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] variable scoping

Posted by Rahul Akolkar <ra...@gmail.com>.
On 4/5/06, Mike Sparr - www.goomzee.com <mi...@goomzee.com> wrote:
> Can someone help with variables?  I want to declare some global variables
> for the xml engine, then have various conditional events set the values of
> those variables.  I would like to have access to those variables from one
> transition event to the next.   I get the following errors:
>
> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
> null):
> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
> null):
> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (toAccount =
> null):
>
<snip/>

Two things to do:

(1) Make sure the <var> elements are inside the <onentry> (or
transition or onexit) -- which is where executable content is
permissible. Which reminds me, I think a schema is now available, so
its about time we start validating the documents in order to flag such
things at parsing.

(2) Add an empty expr attribute (expr="") to the <var> elements, or
wait for the next nightly (20060406) where this oddity will be fixed.

If that doesn't do it, please post a more complete snippet of the
document, so we can look at this further.

-Rahul


> =======
>
> Tried:
>
> <scxml>
> <state id="logged_in">
> ...
> <var name="fromAccount" />
> <var name="toAccount" />
>
>     <transition event="banking.transfer" cond="${empty fromAccount and
> empty toAccount}">
>            <var name="cb" expr="${Conversation}" />
>            <assign name="fromAccount" expr="${cb.request}" />
>            <send target="http://localhost:8080/app" targettype="client"
> event="banking.transfer" namelist="cb fromAccount toAccount" delay="0"
> hints="" sendid="0009"><vxml version="2.0">
> <form>
> <field name="input">
> <prompt>
> To Account?
> </prompt>
> <grammar src="builtin:grammar/digits?length=7"></grammar>
> <noinput><reprompt/></noinput><nomatch><reprompt/></nomatch>
> </field>
> <filled namelist="input">
> <submit next="http://localhost:8080/app/Voice" namelist="input"/>
> </filled>
> </form>
> </vxml>
>            </send>
>         <target next="logged_in" />
>     </transition>
>
> ======
>

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


[SCXML] variable scoping

Posted by "Mike Sparr - www.goomzee.com" <mi...@goomzee.com>.
Can someone help with variables?  I want to declare some global variables
for the xml engine, then have various conditional events set the values of
those variables.  I would like to have access to those variables from one
transition event to the next.   I get the following errors:

09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
null): 
09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
null): 
09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (toAccount =
null): 

=======

Tried:

<scxml>
<state id="logged_in">
...
<var name="fromAccount" />
<var name="toAccount" />
       
     <transition event="banking.transfer" cond="${empty fromAccount and
empty toAccount}">
            <var name="cb" expr="${Conversation}" />
            <assign name="fromAccount" expr="${cb.request}" />
            <send target="http://localhost:8080/app" targettype="client"
event="banking.transfer" namelist="cb fromAccount toAccount" delay="0"
hints="" sendid="0009"><vxml version="2.0">
<form>
<field name="input">
<prompt>
To Account?
</prompt>
<grammar src="builtin:grammar/digits?length=7"></grammar>
<noinput><reprompt/></noinput><nomatch><reprompt/></nomatch>
</field>
<filled namelist="input">
<submit next="http://localhost:8080/app/Voice" namelist="input"/>
</filled>
</form>
</vxml>
            </send>
         <target next="logged_in" />
     </transition>

======



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


Re: [SCXML] conditional logic; dynamically assign event

Posted by "Mike Sparr - www.goomzee.com" <mi...@goomzee.com>.
Never mind... I think the correct usage is to create multiple events of same
name with cond="${empty varName}">

....

Thanks!  Need more pepsi - I should've remembered that!




On 4/5/06 6:22 PM, "Mike Sparr - www.goomzee.com" <mi...@goomzee.com> wrote:

> 
> Can I dynamically assign and event name?
> 
> What is the suggested way to implement and incremental prompt, assign,
> transact?  For instance, let's say I send one prompt at a time but need from
> account, to account and amount before firing a transferFunds event:
> 
> I have another menu option transition even that fires off the request for
> FromAccount.  I would like to keep sending the same event until we
> incrementally fill the required fields for the transferFunds event.
> 
> ===
> 
> <var name="fromAccount" />
> <var name="toAccount" />
> <var name="amount" />
>        
>      <transition event="transfer">
>             <var name="cb" expr="${Conversation}" />
>             <var name="promptField" expr="'From Account?'" />
>             <var name="thisEvent" expr="'transfer'" />
>             <if cond="${empty fromAccount}">
>                     <assign name="fromAccount" expr="${cb.request}" />
>                     <assign name="promptField" expr="'To Account?'" />
>                     <assign name="thisEvent" expr="'transfer'" />
>                 <elseif cond="${empty toAccount}"/>
>                     <assign name="fromAccount" expr="${cb.request}" />
>                     <assign name="promptField" expr="'Amount?'" />
>                     <assign name="thisEvent" expr="'transferFunds'" />
>             </if>
>             <send target="http://localhost:8080/app" targettype="client"
> event="${thisEvent}" namelist="cb fromAccount toAccount amount">
> <vxml version="2.0">
> <form>
> <field name="input">
> <prompt>
> ${promptField}
> </prompt>
> <grammar src="builtin:grammar/digits?length=7"></grammar>
> <noinput><reprompt/></noinput><nomatch><reprompt/></nomatch>
> </field>
> <filled namelist="input">
> <submit next="http://localhost:8080/app/Voice" namelist="input"/>
> </filled>
> </form>
> </vxml>
>             </send>
>          <target next="state_login" />
>      </transition>
> 
> 
> 
> THANKS A BUNCH FOR ANY STEER ON HOW BEST TO HANDLE THIS SITUATION!!!
> 
> 
> Mike
> 
> 
> 
> ---------------------------------------------------------------------
> 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


[SCXML] conditional logic; dynamically assign event

Posted by "Mike Sparr - www.goomzee.com" <mi...@goomzee.com>.
Can I dynamically assign and event name?

What is the suggested way to implement and incremental prompt, assign,
transact?  For instance, let's say I send one prompt at a time but need from
account, to account and amount before firing a transferFunds event:

I have another menu option transition even that fires off the request for
FromAccount.  I would like to keep sending the same event until we
incrementally fill the required fields for the transferFunds event.

===

<var name="fromAccount" />
<var name="toAccount" />
<var name="amount" />
       
     <transition event="transfer">
            <var name="cb" expr="${Conversation}" />
            <var name="promptField" expr="'From Account?'" />
            <var name="thisEvent" expr="'transfer'" />
            <if cond="${empty fromAccount}">
                    <assign name="fromAccount" expr="${cb.request}" />
                    <assign name="promptField" expr="'To Account?'" />
                    <assign name="thisEvent" expr="'transfer'" />
                <elseif cond="${empty toAccount}"/>
                    <assign name="fromAccount" expr="${cb.request}" />
                    <assign name="promptField" expr="'Amount?'" />
                    <assign name="thisEvent" expr="'transferFunds'" />
            </if>
            <send target="http://localhost:8080/app" targettype="client"
event="${thisEvent}" namelist="cb fromAccount toAccount amount">
<vxml version="2.0">
<form>
<field name="input">
<prompt>
${promptField}
</prompt>
<grammar src="builtin:grammar/digits?length=7"></grammar>
<noinput><reprompt/></noinput><nomatch><reprompt/></nomatch>
</field>
<filled namelist="input">
<submit next="http://localhost:8080/app/Voice" namelist="input"/>
</filled>
</form>
</vxml>
            </send>
         <target next="state_login" />
     </transition>



THANKS A BUNCH FOR ANY STEER ON HOW BEST TO HANDLE THIS SITUATION!!!


Mike



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