Re: SCXML maven artifact

2023-07-27 Thread Gary Gregory
And yes, we use Jira for issue tracking.

Gary

On Thu, Jul 27, 2023, 9:16 AM proton_mail_bridge
 wrote:

> Hello, I am trying to use the latest maven artifact of commons-scxml2. The
> projects readme on GitHub suggests to use version 2.0-alpha-1, but [2.0-M1](
> https://mvnrepository.com/artifact/org.apache.commons/commons-scxml2/2.0-M1)
> (2014) is the latest version that’s indexed. Is there a way to use the more
> recent alpha build via maven without downloading the binaries?
>
> And is the projects JIRA the best way to see open issues? If there is any
> work blocking a more current release, I would be happy to contribute.
>
> - Jason


Re: SCXML maven artifact

2023-07-27 Thread Gary Gregory
Hi Jason,

The current version is in git master and the Maven snapshot repository (
https://repository.apache.org/snapshots/) as version 2.0-SNAPSHOT.

Gary

On Thu, Jul 27, 2023, 9:16 AM proton_mail_bridge
 wrote:

> Hello, I am trying to use the latest maven artifact of commons-scxml2. The
> projects readme on GitHub suggests to use version 2.0-alpha-1, but [2.0-M1](
> https://mvnrepository.com/artifact/org.apache.commons/commons-scxml2/2.0-M1)
> (2014) is the latest version that’s indexed. Is there a way to use the more
> recent alpha build via maven without downloading the binaries?
>
> And is the projects JIRA the best way to see open issues? If there is any
> work blocking a more current release, I would be happy to contribute.
>
> - Jason


Re: [SCXML] Support for Commons JEXL in SCXML

2019-07-15 Thread Woonsan Ko
Hi Diptendu,

I don't think the 'target' attribute is meant to be used with
expressional values. [1]
I guess you might want to try with transition elements with cond
attribute, which is expressional [1], instead.
For example,




Regards,

Woonsan

[1] https://www.w3.org/TR/scxml/#transition

On Mon, Jul 15, 2019 at 10:51 AM Diptendu Dutta
 wrote:
>
> Some thing like
>
> 
> 
> 
> 
> ..
>  
> ..
>   
>  
>
> does not work.
>
> *SEVERE: Transition target with ID "${startState}" not found*
>
> However, the spec at
> https://commons.apache.org/proper/commons-jexl/reference/syntax.html
> mentions
>
> If a variable user valued JEXL is present in the environment - whether as a
> local or global variable -, the format
>
> `Hello ${user}`
>
> will evaluate as
>
> Hello JEXL
>
> How can I make this work?
>
> Regards,
>
> Diptendu Dutta

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



Re: [SCXML] Problem with setting values in Context using 2.0-SNAPSHOT (works with 0.9)

2019-03-18 Thread Woonsan Ko
Hi Diptendu,

Please see my comments inline.

On Sat, Mar 16, 2019 at 8:19 AM Diptendu Dutta  wrote:
>
> I have the following code that is working in 0.9 but failing in 2.0-SNAPSHOT
> .
>
> SCXMLExecutor engine;
> Context rootContext;
> Evaluator evaluator;
>
> .
> rootContext = evaluator.newContext(null);
> engine.setRootContext(rootContext);
> engine.go();
>
> rootContext.set("intent", "StartBot");
> engine.triggerEvent("run", TriggerEvent.SIGNAL_EVENT);
>
>
> --
> http://www.w3.org/2005/07/scxml;
>   version="1.0"
>   datamodel="jexl"
>   initial="Start">
>
> 
> 
>  
> 
>
>  
>target="StartBot" />
>   
> 
>
>  
>   
>
>
>   
>   
>  
>
>  
> .
> --
> The StartBot state is not entered, rather the Default state is entered and
> the value
> of the "intent" datamodel item is printed as 'hello' rather than 'StartBot'
> as expected
>
> INFO: transition (event = run, cond = null, from = /Start, to = /Default)
> INFO: null: hello
>
> This same code is working with version 0.9.
>
> Do I have to do things differently with 2.0-SNAPHOT for it to work?

It looks like the evaluator in v2 is case-sensitive.
I think it would work with: cond="intent eq StartBot" -
'StartBot', not 'startBot'.

Regards,

Woonsan

>
> Regards,
>
> Diptendu Dutta

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



Re: [SCXML] Snapshot repository does not contain any JAR

2019-03-14 Thread sebb
Please note that SNAPSHOT releases are offered as-is.

There has been no QA and they are not supported.

The jars in the snapshot repository may be replaced or removed at any time.

They should only be used by developers wishing to help with testing
the code being developed.
They should never be used in a production environment.

On Thu, 14 Mar 2019 at 09:47, Gilles Sadowski  wrote:
>
> Le jeu. 14 mars 2019 à 07:54, Diptendu Dutta
>  a écrit :
> >
> > The SCXML snapshot repository does not contain any JAR files,
>
> https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-scxml2/2.0-SNAPSHOT/
>
> HTH,
> Gilles
>
> > they only have MD5 and SHA1 signatures.
> >
> > https://repository.apache.org/content/groups/snapshots/commons-scxml/commons-scxml/
> >
> > https://repository.apache.org/content/groups/snapshots/commons-scxml/commons-scxml/0.10-SNAPSHOT/
> >
> > The 2.0-M1 Jar is available at
> > https://mvnrepository.com/artifact/org.apache.commons/commons-scxml2
> >
> > However I am trying to find the SCXML 2.0-SNAPSHOT JAR since it
> > is supposed to include a fix for a bug:
> > --
> >
> > Hi Diptendu,
> >
> > Hmm... I think I stepped off on the wrong foot, and you're right: It
> > seems failing with 2.0-M1 tag.
> > When I execute the same thing [1] with the latest master branch
> > (2.0-SNAPSHOT), it works fine.
> > So, I assume it was fixed intentionally or it just cannot occur any
> > more as of SCXML-243.
> >
> > Regards,
> >
> > Woonsan
> >
> > 
> >
> >
> > Regards,
> >
> > Diptendu Dutta
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] Snapshot repository does not contain any JAR

2019-03-14 Thread Gilles Sadowski
Le jeu. 14 mars 2019 à 07:54, Diptendu Dutta
 a écrit :
>
> The SCXML snapshot repository does not contain any JAR files,

https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-scxml2/2.0-SNAPSHOT/

HTH,
Gilles

> they only have MD5 and SHA1 signatures.
>
> https://repository.apache.org/content/groups/snapshots/commons-scxml/commons-scxml/
>
> https://repository.apache.org/content/groups/snapshots/commons-scxml/commons-scxml/0.10-SNAPSHOT/
>
> The 2.0-M1 Jar is available at
> https://mvnrepository.com/artifact/org.apache.commons/commons-scxml2
>
> However I am trying to find the SCXML 2.0-SNAPSHOT JAR since it
> is supposed to include a fix for a bug:
> --
>
> Hi Diptendu,
>
> Hmm... I think I stepped off on the wrong foot, and you're right: It
> seems failing with 2.0-M1 tag.
> When I execute the same thing [1] with the latest master branch
> (2.0-SNAPSHOT), it works fine.
> So, I assume it was fixed intentionally or it just cannot occur any
> more as of SCXML-243.
>
> Regards,
>
> Woonsan
>
> 
>
>
> Regards,
>
> Diptendu Dutta

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



Re: [SCXML] Using to call a REST API

2019-03-11 Thread Woonsan Ko
Hi Diptendu,

On Mon, Mar 11, 2019 at 2:06 AM Diptendu Dutta  wrote:
>
> Is it possible to use the  tag to call a REST API?

Possible.

>
> How would one specify the various attributes such as method (GET/POST),
> headers, body, etc.?

You can pass any data in  to the target, and your
EventDispatcher may interpret the data to invoke an external service.

>
> Is there any example code that I can consult?

WizardsTest.java [1], to handle a custom type of send event used in
wizard-02.xml [2], registers a custom EventDispatcher which can read
type, target and data, and possibly invoke an external service.

FWIW, this is beyond the question, but it might be interesting to
implement a generic EventDispatcher to integrate with Apache Camel,
simply dispatching to a specific route based on  attributes.
e.g, type="camel" data="...", where data is passed to a Camel route as
message body.

Regards,

Woonsan

[1] 
https://github.com/apache/commons-scxml/blob/master/src/test/java/org/apache/commons/scxml2/WizardsTest.java#L62
[2] 
https://github.com/apache/commons-scxml/blob/master/src/test/java/org/apache/commons/scxml2/env/jexl/wizard-02.xml#L43

>
> Regards,
>
> Diptendu Dutta

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



Re: [SCXML] tag usage is giving location error

2019-03-01 Thread Woonsan Ko
Hi Diptendu,

Hmm... I think I stepped off on the wrong foot, and you're right: It
seems failing with 2.0-M1 tag.
When I execute the same thing [1] with the latest master branch
(2.0-SNAPSHOT), it works fine.
So, I assume it was fixed intentionally or it just cannot occur any
more as of SCXML-243.

Regards,

Woonsan

[1] https://github.com/woonsan/commons-scxml-examples/tree/master/hello-world
[2] https://issues.apache.org/jira/browse/SCXML-243

On Fri, Mar 1, 2019 at 5:27 AM Diptendu Dutta  wrote:
>
> Do simple assignments of the form 
> work in commons scxml?
>
> I have this state machine description:
>
> http://www.w3.org/2005/07/scxml;
>   version="1.0"
>   initial="Start">
>
> 
> 
> 
> 
> 
>
>  
>   
>
>   
>   
>   
>  
>
>  
>   
>
> />
>   
>   
>  
>
>
> INFO: transition (event = what-is-my-name, cond = null, from = /Start,
> to = /WhatIsMyName)
> Feb 28, 2019 9:04:53 PM org.apache.commons.scxml2.SCXMLExecutionContext 
> execute
> INFO: null: What is my name
> Feb 28, 2019 9:04:53 PM
> org.apache.commons.scxml2.env.SimpleErrorReporter
> handleErrorMessageWARNING: EXPRESSION_ERROR
> (evalLocation('currentResponse'): java.lang.String cannot be cast to
> org.w3c.dom.Node): Expression error inside /WhatIsMyNameFeb 28, 2019
> 9:04:53 PM org.apache.commons.scxml2.env.SimpleSCXMLListener onEntry
> INFO: enter /WhatIsMyName
>
> I have tried with both commons scxml version 0.9 as well as 2.0
>
> Regards,
>
> Diptendu Dutta

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



Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-12-04 Thread r.c.hoekstra

Hi Woonsan,

thanks for the thinking aloud, I really appreciate it..  Response below.


Regarding the data model, have you tried "Null Data Model" [1] option?
>From the source, it just skips cloning if it is using that option.
org.apache.commons.scxml2.SCInstance#cloneDatamodel(Datamodel,
Context, Evaluator, ErrorReporter) for instance.
H interesting. We use a very basic form of scripting, but the rest 
we basically don't use. Perhaps with some

redesigning the null data model option would do.
Does it differ a lot, in terms of speed?



Regarding your usages, is your model a set of simple states with bunch
of context values (as state attributes), no parallel states, with
simple events, transitions and some scripts, basically?
Usually it is a simple set of states, but we use parallel states quite a 
lot. Parallel states turned in very handy to model for example
multiple diseases, or a disease and socio-economic "migration" inside a 
population.
The events are quite simple, but there can be a bunch of transitions 
from each state. Scripts are used, but very basic.


best, Rinke



Regards,

Woonsan

[1] https://www.w3.org/TR/scxml/#minimal-profile




Also, I'm personally doubtful to try to improve SCXML project to cover
the simulation use cases even in the future. It is a reference
implementation and so it has to keep all the features in the spec, and
so on. Long-time less-activeness in this community is another thing.

Regards,

Woonsan


Our preference would be to find someone who has developed for the commons
scxml project, or who is at least an experienced user.

In case of anyone interested please reply via this list and we can get
into
contact about the details.

best regards,

Rinke Hoekstra

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




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


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





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



Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-12-04 Thread r.c.hoekstra

Hi Jake,

thanks for your response.
I'll look into SCION too; even if we won't use it it might bring some 
inspiration on how to tackle things.


on scaling:
we are currently planning to experiment with running it on a 
supercomputer, which also has its disadvantages (planning, etc).


On serialization: that will most likely solve memory problems, but I 
doubt that it will be faster. But I must confess I have no experience 
with it. The suggestions are interesting enough to do some more 
exploration.


thanks,

Rinke


On 30-11-17 15:51, Jacob Beard wrote:

Hi Rinke,

SCION  is designed to support 
expensive compilation of an in-memory model, followed by cheap 
instantiation of new instances. However, as you can see in Stefan's 
results, its runtime performance is currently much slower than 
alternatives. It's hard to imagine a faster runtime than generated C 
code, which uscxml appears to support.


As Martin Gainty suggested, to do truly massive simulations supporting 
millions of instances, you may need to scale your workload 
horizontally across multiple servers. I think there are two approaches 
to horizontally distributed state machine simulation. The first is to 
assign each state machine instance to a dedicated machine, where state 
will be kept in memory until it reaches its final state and can be 
garbage collected. The second approach is to serialize each state 
machine state to a database after processing an event; and re-hydrate 
the state machine instance from the state stored in the database on 
processing the next event. This second approach has been used 
successfully to scale simulation across a cluster.


Different SCXML implementations have varying levels of support for 
serializing state machine instances. For example, SCION supports 
serialization 
 
directly, and this can also be achieved 
 with SCXML Commons.


Hope this helps. Good luck,

Jake



On 11/30/2017 04:27 AM, r.c.hoekstra wrote:

Hi Jake,

thanks for your reaction. That is a really useful comparison. And I 
can see that Apache commons SCXML isn't doing that bad, though the 
scale is of course logarithmic.


Unfortunately the benchmarking didn't test our use case:  we need to 
fire up many instances of the same (relatively simple) scxml model, 
and if instantiating is relatively expensive, that might change the 
picture completely.


I'll look into uscxml and do some speed testing on that.

best, Rinke




On 29-11-17 20:22, Jacob Beard wrote:

Hi,

I thought you might be interested in Stefan Radomski's work on 
profiling different SCXML implementations:


http://lists.w3.org/Archives/Public/www-voice/2017JulSep/.html

https://github.com/tklab-tud/uscxml/blob/master/docs/BENCHMARKS.md

This indicates that the uscxml implementation is pretty fast. It is 
written in C++, so you would need to write additional code around it 
to get it to work within the context of your Java programming 
environment, but this might be faster than trying to improve the 
performance of Apache Commons SCXML by an order of magnitude.


I hope this helps. Thanks,

Jake


On 11/29/2017 06:56 AM, r.c.hoekstra wrote:

Hi List,

We are working at the ErasmusMC hospital at Rotterdam, Netherlands, 
on scientific simulations on the spread of infectious diseases 
through human populations.

In this project we use Apache Commons SCXML to model diseases.

However, the problem with the present implementation is that it is 
too slow for us. We would need a version that is optimized for 
being instantiated 100 times in a running simulation.


For the coming 2 or 3 months we have money available to pay someone 
who could create an adapted, descaled version of apache commons 
scxml. The goal is to make it much faster, either by optimizing, 
rewriting, and dispose of elements not needed for us.


Our preference would be to find someone who has developed for the 
commons scxml project, or who is at least an experienced user.


In case of anyone interested please reply via this list and we can 
get into contact about the details.


best regards,

Rinke Hoekstra







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







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



Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-12-01 Thread Woonsan Ko
Hi Rinke,

Thanks a lot for the info! Please see my comments inline.

On Thu, Nov 30, 2017 at 4:50 AM, r.c.hoekstra  wrote:
> On 30-11-17 01:49, Woonsan Ko wrote:
>
> Hi Woonsan,
>
> I'll go through your comments in the text below.
>
>> On Wed, Nov 29, 2017 at 6:56 AM, r.c.hoekstra 
>> wrote:
>>>
>>> Hi List,
>>>
>>> We are working at the ErasmusMC hospital at Rotterdam, Netherlands, on
>>> scientific simulations on the spread of infectious diseases through human
>>> populations.
>>> In this project we use Apache Commons SCXML to model diseases.
>>
>> Just out of curiosity, would you mind sharing the reasons, in higher
>> level, why SCXML library was chosen for the simulation in the first
>> place? There are many tools and libs, specialized in simulation, such
>> as MASON. Was it mainly because of the declarative way of SCXML or
>> scriptability (e.g, in JEXL) or both? Is there any other background
>> reason?
>
> Yes. The declarativeness was really important. We needed a way to declare
> the disease processes from state to state,
> with transitions. And as we were already using other xml files to define
> other input (population, etc), it fitted the rest
> of the input perfectly.
> Besides that, we also use the scripting. We use JEXL for that.
>
>> Is it also a considerable option for you to use one of those
>> simulation-specialized tools or libs instead of SCXML if it can meets
>> the requirements?
>
> Yes we looked into a few of those; I know there are many of them. For
> various reasons it mostly prooved better to develop our own libraries.
> But I must confess that I didn't look in those libraries for scxml-like
> features.
> I supposed that it would not support that.
>>
>>
>>> However, the problem with the present implementation is that it is too
>>> slow
>>> for us. We would need a version that is optimized for being instantiated
>>> 100 times in a running simulation.
>>
>> It sounds really really slow, and the expectation is like 10+ days vs
>> 1 sec. And is it concerned more on *loading* time before *execution*,
>> or both?
>
>
> Well, a million might be a bit exagerated for now, but eventually that is
> what we'd like. A run with about 50.000 takes
> 2 hours or so to run, if I remember it well. We'd like to scale that up to
> at least a few hundreds of thousands, without
> having to wait for hours or without the JVM crashing on out of memory
> exceptions.
> And indeed, both loading and execution do matter. A state machine is
> attached to a person, and persons may be born
> during a simulation, so that involves instantiating/loading a new state
> machine. But then, the runtime of a simulation is
> no extremely long in comparison to the life expectancy of persons (about 200
> years or so).

So, I assume you have your own simulation runtime engine
implementation which instantiates and executes environments and
agents. And each agent instance in your project is a SCXML state
machine, right?
I'm not an expert on this simulation thing and tools, but just
thinking aloud that it should also be possible to use an external
simulation tool's runtime engine (instead of your custom runtime
engine) and implement agents, embedding SCXML stuffs, based on their
API. I'm just wondering if it is a feasible idea and if there's a very
extensible tool meeting your needs. In other words, it could be about
creating a new bridging library to support smaller set of SCXML for
specific simulation tools (not improving/rewriting/forking hugely in
SCXML project). Again, just thinking aloud...

>
>
>>
>>> For the coming 2 or 3 months we have money available to pay someone who
>>> could create an adapted, descaled version of apache commons scxml. The
>>> goal
>>> is to make it much faster, either by optimizing, rewriting, and dispose
>>> of
>>> elements not needed for us.
>>
>> To be honest, in my gut feeling, it seems infeasible to improve or
>> rewrite the SCXML library in the shorter term to meet the expectation.
>> To me, SCXML in both spec and implementation, doesn't seem to be
>> designed for that kind of highly capable simulation use cases. It's
>> just too heavy and too much feature driven, IMHO, for that kind of use
>> cases. Please correct me if I'm wrong.
>
> No, I think you're right. It isn't designed to be instantiated many times.
> Maybe my wording was not chosen well enough. We're not exactly interested in
> rewriting the SCXML library. There are quite some features of it we don't
> use at all, for
> example the data model. We would want a stripped down "version" which is
> designed
> for efficiently firing many copies, which uses the declarative features, but
> which has dropped
> features which we didn't use anyway. If that still would meet the official
> set of features that
> defines scxml isn't really a concern.

Regarding the data model, have you tried "Null Data Model" [1] option?
>From the source, it just skips cloning if it is using that option.

Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-11-30 Thread mike shugar
Hi Martin,

It sounds like you want a discrete event simulation with script implemented 
as a large population of state machines.

Are you able to post more details about your simulation requirements? You 
may be able to achieve them with a different simulation approach or tool.

For example,
- do individuals have a location and movement that affects disease 
transmission?
- how many diseases will be simulated at time?
- do diseases combine to produce different behavior in individuals?
- is numeric simulation (eg system dynamics) ruled out?

Mike





- Original Message - 
From: "Martin Gainty" <mgai...@hotmail.com>
To: "Commons Users List" <user@commons.apache.org>
Sent: Thursday, November 30, 2017 7:26 AM
Subject: Re: [scxml] looking for developer for adaptations on Commons SCXML





From: r.c.hoekstra <r.c.hoeks...@scarlet.nl>
Sent: Thursday, November 30, 2017 4:50 AM
To: Commons Users List
Subject: Re: [scxml] looking for developer for adaptations on Commons SCXML

On 30-11-17 01:49, Woonsan Ko wrote:

Hi Woonsan,

I'll go through your comments in the text below.

> On Wed, Nov 29, 2017 at 6:56 AM, r.c.hoekstra <r.c.hoeks...@scarlet.nl> 
> wrote:
>> Hi List,
>>
>> We are working at the ErasmusMC hospital at Rotterdam, Netherlands, on
>> scientific simulations on the spread of infectious diseases through human
>> populations.
>> In this project we use Apache Commons SCXML to model diseases.
> Just out of curiosity, would you mind sharing the reasons, in higher
> level, why SCXML library was chosen for the simulation in the first
> place? There are many tools and libs, specialized in simulation, such
> as MASON. Was it mainly because of the declarative way of SCXML or
> scriptability (e.g, in JEXL) or both? Is there any other background
> reason?
Yes. The declarativeness was really important. We needed a way to
declare the disease processes from state to state,
with transitions. And as we were already using other xml files to define
other input (population, etc), it fitted the rest
of the input perfectly.
Besides that, we also use the scripting. We use JEXL for that.

> Is it also a considerable option for you to use one of those
> simulation-specialized tools or libs instead of SCXML if it can meets
> the requirements?
Yes we looked into a few of those; I know there are many of them. For
various reasons it mostly prooved better to develop our own libraries.
But I must confess that I didn't look in those libraries for scxml-like
features.
I supposed that it would not support that.
>
>> However, the problem with the present implementation is that it is too 
>> slow
>> for us. We would need a version that is optimized for being instantiated
>> 100 times in a running simulation.
> It sounds really really slow, and the expectation is like 10+ days vs
> 1 sec. And is it concerned more on *loading* time before *execution*,
> or both?

Well, a million might be a bit exagerated for now, but eventually that
is what we'd like. A run with about 50.000 takes
2 hours or so to run, if I remember it well. We'd like to scale that up
to at least a few hundreds of thousands, without
having to wait for hours or without the JVM crashing on out of memory
exceptions.
And indeed, both loading and execution do matter. A state machine is
attached to a person, and persons may be born
during a simulation, so that involves instantiating/loading a new state
machine. But then, the runtime of a simulation is
no extremely long in comparison to the life expectancy of persons (about
200 years or so).


>
>> For the coming 2 or 3 months we have money available to pay someone who
>> could create an adapted, descaled version of apache commons scxml. The 
>> goal
>> is to make it much faster, either by optimizing, rewriting, and dispose 
>> of
>> elements not needed for us.
> To be honest, in my gut feeling, it seems infeasible to improve or
> rewrite the SCXML library in the shorter term to meet the expectation.
> To me, SCXML in both spec and implementation, doesn't seem to be
> designed for that kind of highly capable simulation use cases. It's
> just too heavy and too much feature driven, IMHO, for that kind of use
> cases. Please correct me if I'm wrong.
No, I think you're right. It isn't designed to be instantiated many times.
Maybe my wording was not chosen well enough. We're not exactly
interested in
rewriting the SCXML library. There are quite some features of it we
don't use at all, for
example the data model. We would want a stripped down "version" which is
designed
for efficiently firing many copies, which uses the declarative features,
but which has dropped
features which we didn't use anyway. If that still would meet the
official set of features that
defines scxml is

Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-11-30 Thread Martin Gainty



From: r.c.hoekstra <r.c.hoeks...@scarlet.nl>
Sent: Thursday, November 30, 2017 4:50 AM
To: Commons Users List
Subject: Re: [scxml] looking for developer for adaptations on Commons SCXML

On 30-11-17 01:49, Woonsan Ko wrote:

Hi Woonsan,

I'll go through your comments in the text below.

> On Wed, Nov 29, 2017 at 6:56 AM, r.c.hoekstra <r.c.hoeks...@scarlet.nl> wrote:
>> Hi List,
>>
>> We are working at the ErasmusMC hospital at Rotterdam, Netherlands, on
>> scientific simulations on the spread of infectious diseases through human
>> populations.
>> In this project we use Apache Commons SCXML to model diseases.
> Just out of curiosity, would you mind sharing the reasons, in higher
> level, why SCXML library was chosen for the simulation in the first
> place? There are many tools and libs, specialized in simulation, such
> as MASON. Was it mainly because of the declarative way of SCXML or
> scriptability (e.g, in JEXL) or both? Is there any other background
> reason?
Yes. The declarativeness was really important. We needed a way to
declare the disease processes from state to state,
with transitions. And as we were already using other xml files to define
other input (population, etc), it fitted the rest
of the input perfectly.
Besides that, we also use the scripting. We use JEXL for that.

> Is it also a considerable option for you to use one of those
> simulation-specialized tools or libs instead of SCXML if it can meets
> the requirements?
Yes we looked into a few of those; I know there are many of them. For
various reasons it mostly prooved better to develop our own libraries.
But I must confess that I didn't look in those libraries for scxml-like
features.
I supposed that it would not support that.
>
>> However, the problem with the present implementation is that it is too slow
>> for us. We would need a version that is optimized for being instantiated
>> 100 times in a running simulation.
> It sounds really really slow, and the expectation is like 10+ days vs
> 1 sec. And is it concerned more on *loading* time before *execution*,
> or both?

Well, a million might be a bit exagerated for now, but eventually that
is what we'd like. A run with about 50.000 takes
2 hours or so to run, if I remember it well. We'd like to scale that up
to at least a few hundreds of thousands, without
having to wait for hours or without the JVM crashing on out of memory
exceptions.
And indeed, both loading and execution do matter. A state machine is
attached to a person, and persons may be born
during a simulation, so that involves instantiating/loading a new state
machine. But then, the runtime of a simulation is
no extremely long in comparison to the life expectancy of persons (about
200 years or so).


>
>> For the coming 2 or 3 months we have money available to pay someone who
>> could create an adapted, descaled version of apache commons scxml. The goal
>> is to make it much faster, either by optimizing, rewriting, and dispose of
>> elements not needed for us.
> To be honest, in my gut feeling, it seems infeasible to improve or
> rewrite the SCXML library in the shorter term to meet the expectation.
> To me, SCXML in both spec and implementation, doesn't seem to be
> designed for that kind of highly capable simulation use cases. It's
> just too heavy and too much feature driven, IMHO, for that kind of use
> cases. Please correct me if I'm wrong.
No, I think you're right. It isn't designed to be instantiated many times.
Maybe my wording was not chosen well enough. We're not exactly
interested in
rewriting the SCXML library. There are quite some features of it we
don't use at all, for
example the data model. We would want a stripped down "version" which is
designed
for efficiently firing many copies, which uses the declarative features,
but which has dropped
features which we didn't use anyway. If that still would meet the
official set of features that
defines scxml isn't really a concern.

MG>*if* SCXML/JEXL is pegging 1+ JVM which may cause OOM or Stackoverflow errors
MG>as long as your SCXML/JEXL work-units are wholly-contained and atomic maybe 
zookeeper
MG>can be implemented to execute and coordinate these long-running simulations?
MG>https://zookeeper.apache.org/doc/trunk/zookeeperOver.html#ch_DesignOverview
ZooKeeper Architecture - Apache ZooKeeper - 
Home<https://zookeeper.apache.org/doc/trunk/zookeeperOver.html#ch_DesignOverview>
zookeeper.apache.org
ZooKeeper is a distributed, open-source coordination service for distributed 
applications. It exposes a simple set of primitives that distributed 
applications can ...




> Also, I'm personally doubtful to try to improve SCXML project to cover
> the simulation use cases even in the future. It is a reference
> implementation and so it has 

Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-11-30 Thread r.c.hoekstra

On 30-11-17 01:49, Woonsan Ko wrote:

Hi Woonsan,

I'll go through your comments in the text below.


On Wed, Nov 29, 2017 at 6:56 AM, r.c.hoekstra  wrote:

Hi List,

We are working at the ErasmusMC hospital at Rotterdam, Netherlands, on
scientific simulations on the spread of infectious diseases through human
populations.
In this project we use Apache Commons SCXML to model diseases.

Just out of curiosity, would you mind sharing the reasons, in higher
level, why SCXML library was chosen for the simulation in the first
place? There are many tools and libs, specialized in simulation, such
as MASON. Was it mainly because of the declarative way of SCXML or
scriptability (e.g, in JEXL) or both? Is there any other background
reason?
Yes. The declarativeness was really important. We needed a way to 
declare the disease processes from state to state,
with transitions. And as we were already using other xml files to define 
other input (population, etc), it fitted the rest

of the input perfectly.
Besides that, we also use the scripting. We use JEXL for that.


Is it also a considerable option for you to use one of those
simulation-specialized tools or libs instead of SCXML if it can meets
the requirements?
Yes we looked into a few of those; I know there are many of them. For 
various reasons it mostly prooved better to develop our own libraries.
But I must confess that I didn't look in those libraries for scxml-like 
features.

I supposed that it would not support that.



However, the problem with the present implementation is that it is too slow
for us. We would need a version that is optimized for being instantiated
100 times in a running simulation.

It sounds really really slow, and the expectation is like 10+ days vs
1 sec. And is it concerned more on *loading* time before *execution*,
or both?


Well, a million might be a bit exagerated for now, but eventually that 
is what we'd like. A run with about 50.000 takes
2 hours or so to run, if I remember it well. We'd like to scale that up 
to at least a few hundreds of thousands, without
having to wait for hours or without the JVM crashing on out of memory 
exceptions.
And indeed, both loading and execution do matter. A state machine is 
attached to a person, and persons may be born
during a simulation, so that involves instantiating/loading a new state 
machine. But then, the runtime of a simulation is
no extremely long in comparison to the life expectancy of persons (about 
200 years or so).






For the coming 2 or 3 months we have money available to pay someone who
could create an adapted, descaled version of apache commons scxml. The goal
is to make it much faster, either by optimizing, rewriting, and dispose of
elements not needed for us.

To be honest, in my gut feeling, it seems infeasible to improve or
rewrite the SCXML library in the shorter term to meet the expectation.
To me, SCXML in both spec and implementation, doesn't seem to be
designed for that kind of highly capable simulation use cases. It's
just too heavy and too much feature driven, IMHO, for that kind of use
cases. Please correct me if I'm wrong.

No, I think you're right. It isn't designed to be instantiated many times.
Maybe my wording was not chosen well enough. We're not exactly 
interested in
rewriting the SCXML library. There are quite some features of it we 
don't use at all, for
example the data model. We would want a stripped down "version" which is 
designed
for efficiently firing many copies, which uses the declarative features, 
but which has dropped
features which we didn't use anyway. If that still would meet the 
official set of features that

defines scxml isn't really a concern.



Also, I'm personally doubtful to try to improve SCXML project to cover
the simulation use cases even in the future. It is a reference
implementation and so it has to keep all the features in the spec, and
so on. Long-time less-activeness in this community is another thing.

Regards,

Woonsan


Our preference would be to find someone who has developed for the commons
scxml project, or who is at least an experienced user.

In case of anyone interested please reply via this list and we can get into
contact about the details.

best regards,

Rinke Hoekstra

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





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



Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-11-30 Thread r.c.hoekstra

Hi Jake,

thanks for your reaction. That is a really useful comparison. And I can 
see that Apache commons SCXML isn't doing that bad, though the scale is 
of course logarithmic.


Unfortunately the benchmarking didn't test our use case:  we need to 
fire up many instances of the same (relatively simple) scxml model, and 
if instantiating is relatively expensive, that might change the picture 
completely.


I'll look into uscxml and do some speed testing on that.

best, Rinke




On 29-11-17 20:22, Jacob Beard wrote:

Hi,

I thought you might be interested in Stefan Radomski's work on 
profiling different SCXML implementations:


http://lists.w3.org/Archives/Public/www-voice/2017JulSep/.html

https://github.com/tklab-tud/uscxml/blob/master/docs/BENCHMARKS.md

This indicates that the uscxml implementation is pretty fast. It is 
written in C++, so you would need to write additional code around it 
to get it to work within the context of your Java programming 
environment, but this might be faster than trying to improve the 
performance of Apache Commons SCXML by an order of magnitude.


I hope this helps. Thanks,

Jake


On 11/29/2017 06:56 AM, r.c.hoekstra wrote:

Hi List,

We are working at the ErasmusMC hospital at Rotterdam, Netherlands, 
on scientific simulations on the spread of infectious diseases 
through human populations.

In this project we use Apache Commons SCXML to model diseases.

However, the problem with the present implementation is that it is 
too slow for us. We would need a version that is optimized for being 
instantiated 100 times in a running simulation.


For the coming 2 or 3 months we have money available to pay someone 
who could create an adapted, descaled version of apache commons 
scxml. The goal is to make it much faster, either by optimizing, 
rewriting, and dispose of elements not needed for us.


Our preference would be to find someone who has developed for the 
commons scxml project, or who is at least an experienced user.


In case of anyone interested please reply via this list and we can 
get into contact about the details.


best regards,

Rinke Hoekstra







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



Re: [scxml] looking for developer for adaptations on Commons SCXML

2017-11-29 Thread Woonsan Ko
On Wed, Nov 29, 2017 at 6:56 AM, r.c.hoekstra  wrote:
> Hi List,
>
> We are working at the ErasmusMC hospital at Rotterdam, Netherlands, on
> scientific simulations on the spread of infectious diseases through human
> populations.
> In this project we use Apache Commons SCXML to model diseases.

Just out of curiosity, would you mind sharing the reasons, in higher
level, why SCXML library was chosen for the simulation in the first
place? There are many tools and libs, specialized in simulation, such
as MASON. Was it mainly because of the declarative way of SCXML or
scriptability (e.g, in JEXL) or both? Is there any other background
reason?
Is it also a considerable option for you to use one of those
simulation-specialized tools or libs instead of SCXML if it can meets
the requirements?

>
> However, the problem with the present implementation is that it is too slow
> for us. We would need a version that is optimized for being instantiated
> 100 times in a running simulation.

It sounds really really slow, and the expectation is like 10+ days vs
1 sec. And is it concerned more on *loading* time before *execution*,
or both?

>
> For the coming 2 or 3 months we have money available to pay someone who
> could create an adapted, descaled version of apache commons scxml. The goal
> is to make it much faster, either by optimizing, rewriting, and dispose of
> elements not needed for us.

To be honest, in my gut feeling, it seems infeasible to improve or
rewrite the SCXML library in the shorter term to meet the expectation.
To me, SCXML in both spec and implementation, doesn't seem to be
designed for that kind of highly capable simulation use cases. It's
just too heavy and too much feature driven, IMHO, for that kind of use
cases. Please correct me if I'm wrong.
Also, I'm personally doubtful to try to improve SCXML project to cover
the simulation use cases even in the future. It is a reference
implementation and so it has to keep all the features in the spec, and
so on. Long-time less-activeness in this community is another thing.

Regards,

Woonsan

>
> Our preference would be to find someone who has developed for the commons
> scxml project, or who is at least an experienced user.
>
> In case of anyone interested please reply via this list and we can get into
> contact about the details.
>
> best regards,
>
> Rinke Hoekstra

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



Re: [SCXML] Question on Invoker Interface

2016-10-17 Thread Woonsan Ko
Please do not cross post a message and it is better to direct your
comments to the list in general. See more tips here:
http://www.apache.org/dev/contrib-email-tips

On Thu, Oct 13, 2016 at 6:09 PM, Prathib Kumar  wrote:
> Hi Woonsan,
>
> As you have suggested I have picked the M1 release from
> http://maven.onehippo.com/maven2/org/apache/commons/commons-scxml2/2.0-M1/
> but it looks like on the M1 release, setParentSCXMLExecutor() API is missing
> in the interface where as I could see it in the latest git repo.

I didn't suggest that. I just gave an example on how my organization
does in my reply to your personal e-mail question, trying to give you
a hint (e.g, you can deploy a tag or revision onto the repository of
your own).

>
> Do we have any tag'ed version which contains the latest version of this
> interface ?

No tag, no release yet.

Woonsan

>
> This API is very significant for us as the invoker would need to be aware of
> the executor to trigger the events on successful execution of the job.
>
> Regards
> Prathib Kumar.

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



Re: [SCXML] How to obtain a collection of valid events

2016-05-23 Thread Woonsan Ko
On Fri, May 20, 2016 at 9:36 PM, Mansour Al Akeel
 wrote:
> Woonsan,
> Thank you for replying.
> From what you said, I can conclude that this is not supported or
> offered by SCXML. Am I right here?
If you mean finding available event names/patterns (see 3.12.1 in
https://www.w3.org/TR/scxml/#events) for a transition, there seems to
be no convenient method unless you implement a utility method by
yourself based on SCXMLSemanticsImpl.
But, basically the specification is more complex than your simple use
case. I guess that's why there has been no convenient utility yet.

> AFAIR an FSM should report if the token is recognized or not, and not
> just complete the transition/ignore the token silently.. If I am right
> here as well, then this use case is not specific to me.
Error reporting is a bit different from your use case, in my view.
I'm not really sure that SCXMLExecutor should report an error at the
moment when it cannot find any transition associated. I couldn't find
anything clear about that in the specification. If you find something,
please let us know. ;-)

> Do you see in the future, this will be supported by SCXML ? Should we
> open a JIRA ticket ?
commons-scxml has org.apache.commons.scxml2.ErrorReporter interface
which can be set through
org.apache.commons.scxml2.SCXMLExecutor.setErrorReporter(ErrorReporter).
Again, I'm not really sure it has to report an error when not finding
a transition to proceed on an event. It doesn't sound like an error to
me, but maybe a warning in that case.
What do others think?

Regards,

Woonsan

>
> Thank you
>
>
> On Mon, May 16, 2016 at 10:04 AM, Woonsan Ko  wrote:
>> Hi Mansour,
>>
>> I don't see any convenient method to easily figure out what are
>> available event names for transitions like your use case needs.
>> All the knowledge about that is encapsulated in
>> org.apache.commons.scxml2.semantics.SCXMLSemanticsImpl internally, so
>> you might want to take a look at it. SCXMLSemantics is not exposed to
>> applications from the execution context.
>>
>> Regards,
>>
>> Woonsan
>>
>>
>> On Sat, May 14, 2016 at 9:19 AM, Mansour Al Akeel
>>  wrote:
>>> Hello all,
>>>
>>> Based on my understanding, a state machine provides feedback about the
>>> input. If the token is not recognized, it should report this.
>>>
>>> I am prototyping in SCXML, and trying to find a way to find if the
>>> supplied event/token is recognized or not. I am unable to find a way
>>> to tell. May be someone else had luck with this, and can share the way
>>> with me.
>>>
>>> So my question is, I am working in an AbstractStateMachine, and I have
>>> an instance of SCXMLExcutor obtained from getEngine(). How can I find
>>> the valid inputs ??
>>>
>>>
>>> Thank you
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: user-h...@commons.apache.org
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] How to obtain a collection of valid events

2016-05-20 Thread Mansour Al Akeel
Woonsan,
Thank you for replying.
>From what you said, I can conclude that this is not supported or
offered by SCXML. Am I right here?
AFAIR an FSM should report if the token is recognized or not, and not
just complete the transition/ignore the token silently.. If I am right
here as well, then this use case is not specific to me.
Do you see in the future, this will be supported by SCXML ? Should we
open a JIRA ticket ?

Thank you


On Mon, May 16, 2016 at 10:04 AM, Woonsan Ko  wrote:
> Hi Mansour,
>
> I don't see any convenient method to easily figure out what are
> available event names for transitions like your use case needs.
> All the knowledge about that is encapsulated in
> org.apache.commons.scxml2.semantics.SCXMLSemanticsImpl internally, so
> you might want to take a look at it. SCXMLSemantics is not exposed to
> applications from the execution context.
>
> Regards,
>
> Woonsan
>
>
> On Sat, May 14, 2016 at 9:19 AM, Mansour Al Akeel
>  wrote:
>> Hello all,
>>
>> Based on my understanding, a state machine provides feedback about the
>> input. If the token is not recognized, it should report this.
>>
>> I am prototyping in SCXML, and trying to find a way to find if the
>> supplied event/token is recognized or not. I am unable to find a way
>> to tell. May be someone else had luck with this, and can share the way
>> with me.
>>
>> So my question is, I am working in an AbstractStateMachine, and I have
>> an instance of SCXMLExcutor obtained from getEngine(). How can I find
>> the valid inputs ??
>>
>>
>> Thank you
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] How to obtain a collection of valid events

2016-05-16 Thread Woonsan Ko
Hi Mansour,

I don't see any convenient method to easily figure out what are
available event names for transitions like your use case needs.
All the knowledge about that is encapsulated in
org.apache.commons.scxml2.semantics.SCXMLSemanticsImpl internally, so
you might want to take a look at it. SCXMLSemantics is not exposed to
applications from the execution context.

Regards,

Woonsan


On Sat, May 14, 2016 at 9:19 AM, Mansour Al Akeel
 wrote:
> Hello all,
>
> Based on my understanding, a state machine provides feedback about the
> input. If the token is not recognized, it should report this.
>
> I am prototyping in SCXML, and trying to find a way to find if the
> supplied event/token is recognized or not. I am unable to find a way
> to tell. May be someone else had luck with this, and can share the way
> with me.
>
> So my question is, I am working in an AbstractStateMachine, and I have
> an instance of SCXMLExcutor obtained from getEngine(). How can I find
> the valid inputs ??
>
>
> Thank you
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] Next states

2016-05-06 Thread Woonsan Ko
On Fri, May 6, 2016 at 2:56 AM, Mansour Al Akeel
 wrote:
> Thank you Woonsan,
> The use case is to report transition failure or invalid path.
> Using the listener is good, but it wont be triggered unless the
> transition happens.
> For example this was written to test commons SCXML 1:
>
> @Override
> public boolean fireEvent(String event) {
> List lst = 
> this.getCurrentState().getTransitionsList(event);
> if (lst == null) {
> System.out.println("unknown event: " + event);
> return false;  // this should return true if final only
> }
> State before = this.getCurrentState();
> boolean evnetFired = super.fireEvent(event);
>
> State after = this.getCurrentState();
>
> if (after.equals(before)) {
>
> Status stauts = this.getEngine().getCurrentStatus();
>
> Set valid = stauts.getStates();
>
> System.out.println("We are in " + before.getId() + ".
> Possible next states: ");
>
> for (Transition transition : lst) {
> System.out.println(transition.getTarget().getId());
> }
>
> List transitionList =
> this.getCurrentState().getTransitionsList();
>
> for (Transition transition : transitionList) {
> System.out.println(transition.getTarget().getId());
> }
> // throw new
> // IllegalStateException("Can not complete transition while in " +
> // before.getId());
> } else {
> System.out.println("succefully switched state " +
> before.getId() + " -> " + after.getId());
> }
> return evnetFired;
> }
>
>
> Is there a way to translate it to 2 ?

I guess the main change and challenge in API now is that you cannot
use #getCurrentState() any more.
Ate refactored a lot with SCXML-196, 197 and 200 in this (SCXML semantics) area.
For example, #getCurrentState() seems quite confusing because in SCXML
multiple states can be active at the same time. e.g, in parallel
states.
I guess that's why the old API cannot be supported any more.
So, you need to try with SCXMLExecutor#getStatus(), Status#getStates()
and Status#getActiveStates() to figure out which state you need to get
in your implementation. Please see each javadoc description.

Regards,

Woonsan

> Thank you
>
>
> On Wed, May 4, 2016 at 11:58 AM, Woonsan Ko  wrote:
>> Not sure about the use case, but maybe you can add a listener
>> (AbstractStateMachine#getEngine()#addListener(stateMachine, new
>> MyListener())).
>> If you get a TransitionalState in your listener, you may possibly get
>> all the available Transitions and TransitionTargets.
>>
>> Regards,
>>
>> Woonsan
>>
>>
>> On Sun, May 1, 2016 at 8:19 PM, Mansour Al Akeel
>>  wrote:
>>> Is there a way to get the next valid states or transitions ?
>>> I am working with AbstractStateMachine
>>>
>>> Thank you
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: user-h...@commons.apache.org
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] Next states

2016-05-06 Thread Mansour Al Akeel
Thank you Woonsan,
The use case is to report transition failure or invalid path.
Using the listener is good, but it wont be triggered unless the
transition happens.
For example this was written to test commons SCXML 1:

@Override
public boolean fireEvent(String event) {
List lst = this.getCurrentState().getTransitionsList(event);
if (lst == null) {
System.out.println("unknown event: " + event);
return false;  // this should return true if final only
}
State before = this.getCurrentState();
boolean evnetFired = super.fireEvent(event);

State after = this.getCurrentState();

if (after.equals(before)) {

Status stauts = this.getEngine().getCurrentStatus();

Set valid = stauts.getStates();

System.out.println("We are in " + before.getId() + ".
Possible next states: ");

for (Transition transition : lst) {
System.out.println(transition.getTarget().getId());
}

List transitionList =
this.getCurrentState().getTransitionsList();

for (Transition transition : transitionList) {
System.out.println(transition.getTarget().getId());
}
// throw new
// IllegalStateException("Can not complete transition while in " +
// before.getId());
} else {
System.out.println("succefully switched state " +
before.getId() + " -> " + after.getId());
}
return evnetFired;
}


Is there a way to translate it to 2 ?
Thank you


On Wed, May 4, 2016 at 11:58 AM, Woonsan Ko  wrote:
> Not sure about the use case, but maybe you can add a listener
> (AbstractStateMachine#getEngine()#addListener(stateMachine, new
> MyListener())).
> If you get a TransitionalState in your listener, you may possibly get
> all the available Transitions and TransitionTargets.
>
> Regards,
>
> Woonsan
>
>
> On Sun, May 1, 2016 at 8:19 PM, Mansour Al Akeel
>  wrote:
>> Is there a way to get the next valid states or transitions ?
>> I am working with AbstractStateMachine
>>
>> Thank you
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] Next states

2016-05-04 Thread Woonsan Ko
Not sure about the use case, but maybe you can add a listener
(AbstractStateMachine#getEngine()#addListener(stateMachine, new
MyListener())).
If you get a TransitionalState in your listener, you may possibly get
all the available Transitions and TransitionTargets.

Regards,

Woonsan


On Sun, May 1, 2016 at 8:19 PM, Mansour Al Akeel
 wrote:
> Is there a way to get the next valid states or transitions ?
> I am working with AbstractStateMachine
>
> Thank you
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] Any release date

2016-05-04 Thread Woonsan Ko
Hi Mansour,

Sorry for late response.
There are some (radical) changes needed for 2.0, so it's getting
delayed. You can find more detail from Ate's message:
- http://markmail.org/thread/bb4ihxzhtprv675c

Regards,

Woonsan


On Sat, Apr 30, 2016 at 7:40 PM, Mansour Al Akeel
 wrote:
> Hello all,
>
> The website shows the latest unstable version is 2.0-SNAPSHOT.
>
> I am not sure the date the snapshot was updated but I can see
> extensive activity:
>
> https://git1-us-west.apache.org/repos/asf?p=commons-scxml.git
>
> Thanks to the development team. Are there any plans to release it any
> time soon ?
>
> Thank you
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] Next states

2016-05-02 Thread Mansour Al Akeel
Thank you Benedikt.


On Mon, May 2, 2016 at 6:47 AM, Benedikt Ritter  wrote:
> Hello Mansour,
>
> Mansour Al Akeel  schrieb am Mo., 2. Mai 2016 um
> 02:19 Uhr:
>
>> Is there a way to get the next valid states or transitions ?
>> I am working with AbstractStateMachine
>>
>
> I think Woosan and Ate are the ones who have worked mostly on SCXML. Maybe
> they can help...
>
> Benedikt
>
>
>>
>> Thank you
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>>

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



Re: [SCXML] Next states

2016-05-02 Thread Benedikt Ritter
Hello Mansour,

Mansour Al Akeel  schrieb am Mo., 2. Mai 2016 um
02:19 Uhr:

> Is there a way to get the next valid states or transitions ?
> I am working with AbstractStateMachine
>

I think Woosan and Ate are the ones who have worked mostly on SCXML. Maybe
they can help...

Benedikt


>
> Thank you
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>


Re: scxml: nested custom actions

2016-03-24 Thread Woonsan Ko
Hi Rinke / Ate,

It looks like it has been changed as of SCXML-213 [1] with commit
eba2b2899787ef0476c1dd8852aba5b0adb4f5f3.
SCXMLReader#readCustomAction() seems to ignore the possibility of
nested custom actions by invoking #skipToEndElement(reader).
@Ate, is it probably a regression? (custom actions are commons-scxml
specific, not having to be compliant with scxml spec)

Regards,

Woonsan

[1] https://issues.apache.org/jira/browse/SCXML-213

On Thu, Mar 17, 2016 at 5:03 PM, R.C. Hoekstra
 wrote:
> Hi Ate, Woonsan,
>
> Is there a way to access nested child actions from a parent custom action in 
> scxml?
>
> In version scxml-2.0-M1 I could do this in the onexecute of a custom action:
>
> for (Action action : getParent().getActions()) {
>if (action instanceof MyChildAction) {
>   // do things with child action
>
>
> In M1 the Executable.getActions() would list all actions, also the nested 
> child actions contained in a parent action.  In the most recent code the 
> Executable.getActions() only lists the parent action, NOT it's children.
>
>
> I want to do something like this:
>
> 
>  
> 
> 
>  
> 
>
> So how to access the childActions from the parentAction's onExecute?
>
>
> thanks in advance,
>
> Rinke
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: SCXML project

2016-02-01 Thread Ate Douma

Hi Martin,

I've disabled JDK 8 javadoc doclint which should 'fix' your below problem.

BTW: can you please use properly wrapped/formatted plain text for your email?
Like your previous message, content below is pretty much unreadable ...

Ate

On 2016-01-28 14:32, Martin Gainty wrote:

Hi Atecurrently testing what happens when log4j.properties or log4j.xml is 
missing (cured by inserting a working log4j.properties into scxml classpath)
I am currently experiencing this failure:
Javadoc failure with:

Caused by: org.apache.maven.plugin.MojoExecutionException: Error generating 
maven-javadoc-plugin:2.10.3:javadoc:Exit code: 1 - 
\scxml\src\main\java\org\apache\commons\scxml2\SCInstanceObjectInputStream.java:80: error: 
unexpected end tag:  * 
Here is the code:
  /** * Set custom class resolver callback, or null when no longer needed. *  * Typically 
usage: *  * private void readObject(ObjectInputStream in) throws 
IOException,ClassNotFoundException { * ClassResolver currentClassResolver = null; * try { * 
if (in instanceof SCInstanceObjectInputStream) { * currentClassResolver = 
((SCInstanceObjectInputStream)in).setClassResolver(customClassResolver); * } * ... // read 
Object(s) * } * finally { * if (in instanceof SCInstanceObjectInputStream) { *  
   ((SCInstanceObjectInputStream)in).setClassResolver(currentClassResolver); * } * } * 
} *  *  * @see 
org.apache.commons.scxml2.env.groovy.GroovyContext#readObject(ObjectInputStream) * @param classResolver custom 
class resolver */public ClassResolver setClassResolver(ClassResolver classResolver) {

   ClassResolver old = this.classResolver;this.classResolver = 
classResolver;return old;}

fubars javadoc and fails the build..for now i can comment out the  and  
inside comments to bypass

Suggestions are welcomethanksMartin
__




Subject: Re: SCXML project
To: user@commons.apache.org
From: a...@douma.nu
Date: Wed, 27 Jan 2016 22:10:50 +0100

On 2016-01-26 22:36, Martin Gainty wrote:


mvn package doesnt package (testcase fails) currently
   
  
  java.lang.NullPointerException: null at

org.apache.commons.logging.impl.SLF4JLog.isDebugEnabled(SLF4JLog.java:49) at

org.apache.commons.scxml2.env.SimpleContext.setLocal(SimpleContext.java:178) at

org.apache.commons.scxml2.SCXMLExecutionContext.initializeIOProcessors(SCXMLExecutionContext.java:358)
 at

org.apache.commons.scxml2.SCXMLExecutionContext.attachInstance(SCXMLExecutionContext.java:397)
 at

org.apache.commons.scxml2.SCXMLExecutor.attachInstance(SCXMLExecutor.java:398) 
at

org.apache.commons.scxml2.SCXMLTestHelper.testInstanceSerializability(SCXMLTestHelper.java:258)
 at

org.apache.commons.scxml2.SCXMLExecutorTest.testSCXMLExecutorTransitions02Sample(SCXMLExecutorTest.java:139)

correct this small bug lurking in 
org.apache.commons.scxml2.env.SimpleContext.java

   /**
   * Assigns a new value to an existing variable or creates a new one.
   * The method allows to shaddow a variable of the same name up the
   * Context chain.
   *
   * @param name The variable name
   * @param value The variable value
   * @see org.apache.commons.scxml2.Context#setLocal(String, Object)
   * as someone forgot to initialize log toss a System.out.println
   */
   public void setLocal(final String name, final Object value) {
   getVars().put(name, value);
   try {
   if (log.isDebugEnabled()) {
   log.debug(name + " = " + String.valueOf(value));
   }
   }
   catch(NullPointerException npe) {
   System.out.println("SimpleContext::setLocal log.isDebugEnabled() where log="+log+" 
name="+name+" throws NPE");
   }
   }

*Obrigado Guilherme*
Martín


AFAICT the above NPE only can occur when configuring an invalid/wrong logging
class (like in the pom.xml for the maven-surefire-plugin) and/or through
explicitly set the the Log instance to null in SimpleContext.java.

When using a clean checkout/clone of the current SCXML git repository (master)
this definitely is not the case, and mvn package works just fine.

So possibly you have local modifications, either to the pom.xml logging
configuration or otherwise causing this exception?

Regards, Ate




Date: Mon, 25 Jan 2016 23:42:01 -0200
Subject: Re: SCXML project
From: guilhermecgss...@gmail.com
To: user@commons.apache.org

Ok Folks,


I will evaluate SCXML.

BTW, I found these paper and it sounds interesting:

http://cdn.intechopen.com/pdfs-wm/46457.pdf

It looks like it exports Stateflow to SCXML


MG>will Stateflow support Harel FSM?
MG>Please confirmMG>Obrigado!


On Sun, Jan 24, 2016 at 10:32 AM, Martin Gainty <mgai...

RE: SCXML project

2016-02-01 Thread Martin Gainty






> Subject: Re: SCXML project
> To: user@commons.apache.org
> From: a...@douma.nu
> Date: Mon, 1 Feb 2016 23:34:39 +0100
> 
> Hi Martin,
> 
> I've disabled JDK 8 javadoc doclint which should 'fix' your below problem.
> 
> BTW: can you please use properly wrapped/formatted plain text for your email?
> Like your previous message, content below is pretty much unreadable ...

MG>this is a freebie emailer I picked up in 96 whose primary format is HtmL and 
not plain text
MG>for paying work I use mgaint...@gmail.com (I also have mail username on my 
own site which supports plain text)
MG>Thanks Ate
> 
> Ate
> 
> On 2016-01-28 14:32, Martin Gainty wrote:
>> Hi Atecurrently testing what happens when log4j.properties or log4j.xml is 
>> missing (cured by inserting a working log4j.properties into scxml classpath)
>> I am currently experiencing this failure:
>> Javadoc failure with:
>>
>> Caused by: org.apache.maven.plugin.MojoExecutionException: Error generating 
>> maven-javadoc-plugin:2.10.3:javadoc:Exit code: 1 - 
>> \scxml\src\main\java\org\apache\commons\scxml2\SCInstanceObjectInputStream.java:80:
>>  error: unexpected end tag:  * 
>> Here is the code:
>> /** * Set custom class resolver callback, or null when no longer needed. *  
>> * Typically usage: *  * private void readObject(ObjectInputStream in) throws 
>> IOException,ClassNotFoundException { * ClassResolver currentClassResolver = 
>> null; * try { * if (in instanceof SCInstanceObjectInputStream) { * 
>> currentClassResolver = 
>> ((SCInstanceObjectInputStream)in).setClassResolver(customClassResolver); * } 
>> * ... // read Object(s) * } * finally { * if (in instanceof 
>> SCInstanceObjectInputStream) { * 
>> ((SCInstanceObjectInputStream)in).setClassResolver(currentClassResolver); * 
>> } * } * } *  * 
 * @see 
org.apache.commons.scxml2.env.groovy.GroovyContext#readObject(ObjectInputStream)
 * @param classResolver custom class resolver */ public ClassResolver 
setClassResolver(ClassResolver classResolver) {
> ClassResolver old = this.classResolver; this.classResolver = classResolver; 
> return old; }
>> fubars javadoc and fails the build..for now i can comment out the  and 
 inside comments to bypass
>>
>> Suggestions are welcomethanksMartin
>> __
>>
>>
>>
>>> Subject: Re: SCXML project
>>> To: user@commons.apache.org
>>> From: a...@douma.nu
>>> Date: Wed, 27 Jan 2016 22:10:50 +0100
>>>
>>> On 2016-01-26 22:36, Martin Gainty wrote:
>>>>
>>>> mvn package doesnt package (testcase fails) currently
>>>> 
>>>> 
>>>> java.lang.NullPointerException: null at
>>>> org.apache.commons.logging.impl.SLF4JLog.isDebugEnabled(SLF4JLog.java:49) 
>>>> at
>>>> org.apache.commons.scxml2.env.SimpleContext.setLocal(SimpleContext.java:178)
>>>>  at
>>>> org.apache.commons.scxml2.SCXMLExecutionContext.initializeIOProcessors(SCXMLExecutionContext.java:358)
>>>>  at
>>>> org.apache.commons.scxml2.SCXMLExecutionContext.attachInstance(SCXMLExecutionContext.java:397)
>>>>  at
>>>> org.apache.commons.scxml2.SCXMLExecutor.attachInstance(SCXMLExecutor.java:398)
>>>>  at
>>>> org.apache.commons.scxml2.SCXMLTestHelper.testInstanceSerializability(SCXMLTestHelper.java:258)
>>>>  at
>>>> org.apache.commons.scxml2.SCXMLExecutorTest.testSCXMLExecutorTransitions02Sample(SCXMLExecutorTest.java:139)
>>>>
>>>> correct this small bug lurking in 
>>>> org.apache.commons.scxml2.env.SimpleContext.java
>>>>
>>>> /**
>>>> * Assigns a new value to an existing variable or creates a new one.
>>>> * The method allows to shaddow a variable of the same name up the
>>>> * Context chain.
>>>> *
>>>> * @param name The variable name
>>>> * @param value The variable value
>>>> * @see org.apache.commons.scxml2.Context#setLocal(String, Object)
>>>> * as someone forgot to initialize log toss a System.out.println
>>>> */
>>>> public void setLocal(final String name, final Object value) {
>>>> getVars().put(name, value);
>>>> try {
>>>> if (log.isDebugEnabled()) {
>>>> log.debug(name + " = " + String.valueOf(value));
>>>> }
>>>> }
>>>> catch(NullPointerException npe) {
>>>> System.out.println("SimpleContext::setLocal log.isDebugEnabled() where 
>>>> log="+log+" name="+name

RE: SCXML project

2016-01-28 Thread Martin Gainty
Hi Atecurrently testing what happens when log4j.properties or log4j.xml is 
missing (cured by inserting a working log4j.properties into scxml classpath)
I am currently experiencing this failure:
Javadoc failure with:

Caused by: org.apache.maven.plugin.MojoExecutionException: Error generating 
maven-javadoc-plugin:2.10.3:javadoc:Exit code: 1 - 
\scxml\src\main\java\org\apache\commons\scxml2\SCInstanceObjectInputStream.java:80:
 error: unexpected end tag:  * 
Here is the code:
 /** * Set custom class resolver callback, or null when no longer needed.   
  *  * Typically usage: *  * private void 
readObject(ObjectInputStream in) throws IOException,ClassNotFoundException {
 * ClassResolver currentClassResolver = null; * try { * 
if (in instanceof SCInstanceObjectInputStream) { * 
currentClassResolver = 
((SCInstanceObjectInputStream)in).setClassResolver(customClassResolver); *  
   } * ... // read Object(s) * } * finally {
 * if (in instanceof SCInstanceObjectInputStream) { * 
((SCInstanceObjectInputStream)in).setClassResolver(currentClassResolver); * 
} * } * } *  *  * @see 
org.apache.commons.scxml2.env.groovy.GroovyContext#readObject(ObjectInputStream)
 * @param classResolver custom class resolver */public 
ClassResolver setClassResolver(ClassResolver classResolver) {
ClassResolver old = this.classResolver;this.classResolver = 
classResolver;return old;}
fubars javadoc and fails the build..for now i can comment out the  and  
inside comments to bypass

Suggestions are welcomethanksMartin 
__ 




> Subject: Re: SCXML project
> To: user@commons.apache.org
> From: a...@douma.nu
> Date: Wed, 27 Jan 2016 22:10:50 +0100
> 
> On 2016-01-26 22:36, Martin Gainty wrote:
> >
> > mvn package doesnt package (testcase fails) currently
> >> classname="org.apache.commons.scxml2.SCXMLExecutorTest" time="0.03">
> >  
> >  java.lang.NullPointerException: null at
> >
> > org.apache.commons.logging.impl.SLF4JLog.isDebugEnabled(SLF4JLog.java:49) at
> >
> > org.apache.commons.scxml2.env.SimpleContext.setLocal(SimpleContext.java:178)
> >  at
> >
> > org.apache.commons.scxml2.SCXMLExecutionContext.initializeIOProcessors(SCXMLExecutionContext.java:358)
> >  at
> >
> > org.apache.commons.scxml2.SCXMLExecutionContext.attachInstance(SCXMLExecutionContext.java:397)
> >  at
> >
> > org.apache.commons.scxml2.SCXMLExecutor.attachInstance(SCXMLExecutor.java:398)
> >  at
> >
> > org.apache.commons.scxml2.SCXMLTestHelper.testInstanceSerializability(SCXMLTestHelper.java:258)
> >  at
> >
> > org.apache.commons.scxml2.SCXMLExecutorTest.testSCXMLExecutorTransitions02Sample(SCXMLExecutorTest.java:139)
> >
> > correct this small bug lurking in 
> > org.apache.commons.scxml2.env.SimpleContext.java
> >
> >   /**
> >   * Assigns a new value to an existing variable or creates a new one.
> >   * The method allows to shaddow a variable of the same name up the
> >   * Context chain.
> >   *
> >   * @param name The variable name
> >   * @param value The variable value
> >   * @see org.apache.commons.scxml2.Context#setLocal(String, Object)
> >   * as someone forgot to initialize log toss a System.out.println
> >   */
> >   public void setLocal(final String name, final Object value) {
> >   getVars().put(name, value);
> >   try {
> >   if (log.isDebugEnabled()) {
> >   log.debug(name + " = " + String.valueOf(value));
> >   }
> >   }
> >   catch(NullPointerException npe) {
> >   System.out.println("SimpleContext::setLocal log.isDebugEnabled() 
> > where log="+log+" name="+name+" throws NPE");
> >   }
> >   }
> >
> > *Obrigado Guilherme*
> > Martín
> 
> AFAICT the above NPE only can occur when configuring an invalid/wrong logging 
> class (like in the pom.xml for the maven-surefire-plugin) and/or through 
> explicitly set the the Log instance to null in SimpleContext.java.
> 
> When using a clean checkout/clone of the current SCXML git repository 
> (master) 
> this definitely is not the case, and mvn package works just fine.
> 
> So possibly you have local modifications, either to the pom.xml logging 
> configuration or otherwise causing this exception?
> 
> Rega

Re: SCXML project

2016-01-27 Thread Ate Douma

On 2016-01-26 22:36, Martin Gainty wrote:


mvn package doesnt package (testcase fails) currently
  
 
 java.lang.NullPointerException: null at
   
org.apache.commons.logging.impl.SLF4JLog.isDebugEnabled(SLF4JLog.java:49) at
   
org.apache.commons.scxml2.env.SimpleContext.setLocal(SimpleContext.java:178) at
   
org.apache.commons.scxml2.SCXMLExecutionContext.initializeIOProcessors(SCXMLExecutionContext.java:358)
 at
   
org.apache.commons.scxml2.SCXMLExecutionContext.attachInstance(SCXMLExecutionContext.java:397)
 at
   
org.apache.commons.scxml2.SCXMLExecutor.attachInstance(SCXMLExecutor.java:398) 
at
   
org.apache.commons.scxml2.SCXMLTestHelper.testInstanceSerializability(SCXMLTestHelper.java:258)
 at
   
org.apache.commons.scxml2.SCXMLExecutorTest.testSCXMLExecutorTransitions02Sample(SCXMLExecutorTest.java:139)

correct this small bug lurking in 
org.apache.commons.scxml2.env.SimpleContext.java

  /**
  * Assigns a new value to an existing variable or creates a new one.
  * The method allows to shaddow a variable of the same name up the
  * Context chain.
  *
  * @param name The variable name
  * @param value The variable value
  * @see org.apache.commons.scxml2.Context#setLocal(String, Object)
  * as someone forgot to initialize log toss a System.out.println
  */
  public void setLocal(final String name, final Object value) {
  getVars().put(name, value);
  try {
  if (log.isDebugEnabled()) {
  log.debug(name + " = " + String.valueOf(value));
  }
  }
  catch(NullPointerException npe) {
  System.out.println("SimpleContext::setLocal log.isDebugEnabled() where log="+log+" 
name="+name+" throws NPE");
  }
  }

*Obrigado Guilherme*
Martín


AFAICT the above NPE only can occur when configuring an invalid/wrong logging 
class (like in the pom.xml for the maven-surefire-plugin) and/or through 
explicitly set the the Log instance to null in SimpleContext.java.


When using a clean checkout/clone of the current SCXML git repository (master) 
this definitely is not the case, and mvn package works just fine.


So possibly you have local modifications, either to the pom.xml logging 
configuration or otherwise causing this exception?


Regards, Ate




Date: Mon, 25 Jan 2016 23:42:01 -0200
Subject: Re: SCXML project
From: guilhermecgss...@gmail.com
To: user@commons.apache.org

Ok Folks,


I will evaluate SCXML.

BTW, I found these paper and it sounds interesting:

http://cdn.intechopen.com/pdfs-wm/46457.pdf

It looks like it exports Stateflow to SCXML


MG>will Stateflow support Harel FSM?
MG>Please confirmMG>Obrigado!


On Sun, Jan 24, 2016 at 10:32 AM, Martin Gainty <mgai...@hotmail.com> wrote:


+1
Thanks Gary!
Martin Gainty
__





Date: Sat, 23 Jan 2016 14:07:08 -0800
Subject: Re: SCXML project
From: garydgreg...@gmail.com
To: user@commons.apache.org

Guilherme,

I have not seen much activity. We are all volunteers here, if you want

the

project to move forward, feel free to talk on this list, create Jiras,

and

provide patches.

Gary
On Jan 22, 2016 8:58 AM, "Guilherme Silveira" <

guilhermecgss...@gmail.com>

wrote:


Hi Folks

I am new to FSM and new to SCXML.On the other hand, I am expert in
Simulink, expert in Java and expert in model based systems engineering.

I am currently evaluating SCXML and I would like a*honest, non biased
opinion *on the status of SCXML project.

What I would like to assert if this project has a future, the number of
developers, if the SCXML specification will ever reach a stable
statusand so on

So far, I have noticed few integrations with proprietary softwares
Simulink Stateflow does not export to SCXML, neither does IBM Rhapsody.

How difficult would it be to create custom tool for these

integrations? And

most important, is it REALLY possible to implement in Java all the
functionalities of Simulink Stateflow, without any drawback, with a
friendly user experience and a steep learning curve?

ps: I am not from telecom industry












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



RE: SCXML project

2016-01-26 Thread Martin Gainty



mvn package doesnt package (testcase fails) currently  java.lang.NullPointerException: null at 
org.apache.commons.logging.impl.SLF4JLog.isDebugEnabled(SLF4JLog.java:49)at 
org.apache.commons.scxml2.env.SimpleContext.setLocal(SimpleContext.java:178) at 
org.apache.commons.scxml2.SCXMLExecutionContext.initializeIOProcessors(SCXMLExecutionContext.java:358)
   at 
org.apache.commons.scxml2.SCXMLExecutionContext.attachInstance(SCXMLExecutionContext.java:397)
   at 
org.apache.commons.scxml2.SCXMLExecutor.attachInstance(SCXMLExecutor.java:398)  
 at 
org.apache.commons.scxml2.SCXMLTestHelper.testInstanceSerializability(SCXMLTestHelper.java:258)
  at 
org.apache.commons.scxml2.SCXMLExecutorTest.testSCXMLExecutorTransitions02Sample(SCXMLExecutorTest.java:139)

correct this small bug lurking in 
org.apache.commons.scxml2.env.SimpleContext.java
   /** * Assigns a new value to an existing variable or creates a new one.  
   * The method allows to shaddow a variable of the same name up the * 
Context chain. * * @param name The variable name * @param value The 
variable value * @see org.apache.commons.scxml2.Context#setLocal(String, 
Object) * as someone forgot to initialize log toss a System.out.println 
*/public void setLocal(final String name, final Object value){
getVars().put(name, value);try{   if 
(log.isDebugEnabled())   {   
log.debug(name + " = " + String.valueOf(value));}   
}   catch(NullPointerException npe) {   
System.out.println("SimpleContext::setLocal log.isDebugEnabled() where 
log="+log+" name="+name+" throws NPE");  }}
*Obrigado Guilherme*
Martín

> Date: Mon, 25 Jan 2016 23:42:01 -0200
> Subject: Re: SCXML project
> From: guilhermecgss...@gmail.com
> To: user@commons.apache.org
> 
> Ok Folks,
> 
> 
> I will evaluate SCXML.
> 
> BTW, I found these paper and it sounds interesting:
> 
> http://cdn.intechopen.com/pdfs-wm/46457.pdf
> 
> It looks like it exports Stateflow to SCXML

MG>will Stateflow support Harel FSM?
MG>Please confirmMG>Obrigado!
> 
> On Sun, Jan 24, 2016 at 10:32 AM, Martin Gainty <mgai...@hotmail.com> wrote:
> 
> > +1
> > Thanks Gary!
> > Martin Gainty
> > __
> >
> >
> >
> >
> > > Date: Sat, 23 Jan 2016 14:07:08 -0800
> > > Subject: Re: SCXML project
> > > From: garydgreg...@gmail.com
> > > To: user@commons.apache.org
> > >
> > > Guilherme,
> > >
> > > I have not seen much activity. We are all volunteers here, if you want
> > the
> > > project to move forward, feel free to talk on this list, create Jiras,
> > and
> > > provide patches.
> > >
> > > Gary
> > > On Jan 22, 2016 8:58 AM, "Guilherme Silveira" <
> > guilhermecgss...@gmail.com>
> > > wrote:
> > >
> > > > Hi Folks
> > > >
> > > > I am new to FSM and new to SCXML.On the other hand, I am expert in
> > > > Simulink, expert in Java and expert in model based systems engineering.
> > > >
> > > > I am currently evaluating SCXML and I would like a*honest, non biased
> > > > opinion *on the status of SCXML project.
> > > >
> > > > What I would like to assert if this project has a future, the number of
> > > > developers, if the SCXML specification will ever reach a stable
> > > > statusand so on
> > > >
> > > > So far, I have noticed few integrations with proprietary softwares
> > > > Simulink Stateflow does not export to SCXML, neither does IBM Rhapsody.
> > > >
> > > > How difficult would it be to create custom tool for these
> > integrations? And
> > > > most important, is it REALLY possible to implement in Java all the
> > > > functionalities of Simulink Stateflow, without any drawback, with a
> > > > friendly user experience and a steep learning curve?
> > > >
> > > > ps: I am not from telecom industry
> > > >
> >
> >

  

Re: SCXML project

2016-01-25 Thread Guilherme Silveira
Ok Folks,


I will evaluate SCXML.

BTW, I found these paper and it sounds interesting:

http://cdn.intechopen.com/pdfs-wm/46457.pdf

It looks like it exports Stateflow to SCXML

On Sun, Jan 24, 2016 at 10:32 AM, Martin Gainty <mgai...@hotmail.com> wrote:

> +1
> Thanks Gary!
> Martin Gainty
> __
>
>
>
>
> > Date: Sat, 23 Jan 2016 14:07:08 -0800
> > Subject: Re: SCXML project
> > From: garydgreg...@gmail.com
> > To: user@commons.apache.org
> >
> > Guilherme,
> >
> > I have not seen much activity. We are all volunteers here, if you want
> the
> > project to move forward, feel free to talk on this list, create Jiras,
> and
> > provide patches.
> >
> > Gary
> > On Jan 22, 2016 8:58 AM, "Guilherme Silveira" <
> guilhermecgss...@gmail.com>
> > wrote:
> >
> > > Hi Folks
> > >
> > > I am new to FSM and new to SCXML.On the other hand, I am expert in
> > > Simulink, expert in Java and expert in model based systems engineering.
> > >
> > > I am currently evaluating SCXML and I would like a*honest, non biased
> > > opinion *on the status of SCXML project.
> > >
> > > What I would like to assert if this project has a future, the number of
> > > developers, if the SCXML specification will ever reach a stable
> > > statusand so on
> > >
> > > So far, I have noticed few integrations with proprietary softwares
> > > Simulink Stateflow does not export to SCXML, neither does IBM Rhapsody.
> > >
> > > How difficult would it be to create custom tool for these
> integrations? And
> > > most important, is it REALLY possible to implement in Java all the
> > > functionalities of Simulink Stateflow, without any drawback, with a
> > > friendly user experience and a steep learning curve?
> > >
> > > ps: I am not from telecom industry
> > >
>
>


RE: SCXML project

2016-01-24 Thread Martin Gainty
+1
Thanks Gary!
Martin Gainty 
__ 




> Date: Sat, 23 Jan 2016 14:07:08 -0800
> Subject: Re: SCXML project
> From: garydgreg...@gmail.com
> To: user@commons.apache.org
> 
> Guilherme,
> 
> I have not seen much activity. We are all volunteers here, if you want the
> project to move forward, feel free to talk on this list, create Jiras, and
> provide patches.
> 
> Gary
> On Jan 22, 2016 8:58 AM, "Guilherme Silveira" <guilhermecgss...@gmail.com>
> wrote:
> 
> > Hi Folks
> >
> > I am new to FSM and new to SCXML.On the other hand, I am expert in
> > Simulink, expert in Java and expert in model based systems engineering.
> >
> > I am currently evaluating SCXML and I would like a*honest, non biased
> > opinion *on the status of SCXML project.
> >
> > What I would like to assert if this project has a future, the number of
> > developers, if the SCXML specification will ever reach a stable
> > statusand so on
> >
> > So far, I have noticed few integrations with proprietary softwares
> > Simulink Stateflow does not export to SCXML, neither does IBM Rhapsody.
> >
> > How difficult would it be to create custom tool for these integrations? And
> > most important, is it REALLY possible to implement in Java all the
> > functionalities of Simulink Stateflow, without any drawback, with a
> > friendly user experience and a steep learning curve?
> >
> > ps: I am not from telecom industry
> >
  

Re: SCXML project

2016-01-23 Thread Gary Gregory
Guilherme,

I have not seen much activity. We are all volunteers here, if you want the
project to move forward, feel free to talk on this list, create Jiras, and
provide patches.

Gary
On Jan 22, 2016 8:58 AM, "Guilherme Silveira" 
wrote:

> Hi Folks
>
> I am new to FSM and new to SCXML.On the other hand, I am expert in
> Simulink, expert in Java and expert in model based systems engineering.
>
> I am currently evaluating SCXML and I would like a*honest, non biased
> opinion *on the status of SCXML project.
>
> What I would like to assert if this project has a future, the number of
> developers, if the SCXML specification will ever reach a stable
> statusand so on
>
> So far, I have noticed few integrations with proprietary softwares
> Simulink Stateflow does not export to SCXML, neither does IBM Rhapsody.
>
> How difficult would it be to create custom tool for these integrations? And
> most important, is it REALLY possible to implement in Java all the
> functionalities of Simulink Stateflow, without any drawback, with a
> friendly user experience and a steep learning curve?
>
> ps: I am not from telecom industry
>


[SCXML] Re: SCXML project

2016-01-22 Thread Jacob Beard
Hi Guilherme,

I have used SCXML for use cases outside of telecom, including to control 
hardware in industrial systems. Semantically, SCXML has most of the features of 
Statecharts, the language upon which Stateflow is based, and it works well for 
this use case.

Unlike Stateflow, SCXML does not have a dedicated graphical IDE. The 
development I have done has primarily involved editing SCXML by hand, and 
applying automated visualization using D3. I have heard of other SCXML 
developers doing the same. I believe MagicDraw 

 supports SCXML, but I have not tried it. 

There are also semantic difference between SCXML and Stateflow. For example, 
transition priority: Stateflow uses a graphical syntax, based on a clockwise 

 ordering, while SCXML relies on document order of the transition nodes in the 
XML document.

It would be interesting to combine an SCXML engine with open source software 
for modeling system dynamics, such as Modelica   
Xcos , or Minsky 
, to create an open stack of 
simulation software.

Please feel free to reach me with any questions. Thank you,

Jacob Beard

> On Jan 22, 2016, at 11:58 AM, Guilherme Silveira  
> wrote:
> 
> Hi Folks
> 
> I am new to FSM and new to SCXML.On the other hand, I am expert in
> Simulink, expert in Java and expert in model based systems engineering.
> 
> I am currently evaluating SCXML and I would like a*honest, non biased
> opinion *on the status of SCXML project.
> 
> What I would like to assert if this project has a future, the number of
> developers, if the SCXML specification will ever reach a stable
> statusand so on
> 
> So far, I have noticed few integrations with proprietary softwares
> Simulink Stateflow does not export to SCXML, neither does IBM Rhapsody.
> 
> How difficult would it be to create custom tool for these integrations? And
> most important, is it REALLY possible to implement in Java all the
> functionalities of Simulink Stateflow, without any drawback, with a
> friendly user experience and a steep learning curve?
> 
> ps: I am not from telecom industry



Re: [scxml] update and progress?

2015-12-07 Thread Ate Douma

On 2015-12-04 16:21, R.C. Hoekstra wrote:

Hi Ate,

thanks for answering.

As for the datamodel...
Well, I put the stuff in our project which depended on the datamodel on hold. 
We wanted to apply a datamodel in order to separate the state flow logic and 
the numbers used in it, but we haven't done that up to now, because I was 
afraid that the datamodel on scxml commons would become subject of serious 
changes.

So for us it's still very flexible, as we didn't start with that part yet. I 
have a slight personal preference for at least the xml in the datamodel, but 
it's not that important. For us the progress of the project is much more 
important than the choice on which language support will be there and which not.
So I can perfectly live with JSON. And if your proposal leads to greater ease 
of use and faster implementation, that is fantastic. Please do so.

The support for java8 is also fine with me. We're doing everything in java 8.

So conclusion: your proposal is supported from over here!


Thanks Rinke, that is very helpful feedback!

I'll come up with a concrete (lazy consensus) proposal on the *dev* list for:
- dropping XML/XPath support
- adding JSON datamodel support
- requiring Java8
and then take it from there with an updated plan.

Regards, Ate



best regards, Rinke




Hi Rinke,

On 2015-11-24 12:24, R.C. Hoekstra wrote:

Hi Ate, Woonsan,

I was wondering if you guys could give us an update on the progress of
SCXML, and tell us how it's going.

Specifically, I was wondering if you could give us any clue on when
Milestone 2 can be expected. I'm looking forward to the new datamodel
features with great interest.

I don't see much questions and activity on the mailinglist on scxml, but I'd
like you to know that we are still very enthousiastic on the scxml project.


That is great to hear, and thank you for saying so!

Obviously there hasn't been much progress since early this year :(

Main reason for this is that the current M1 release has been sufficient for our
current use-cases, so far, and we thus right now don't have a real business
driver nor concrete budget/time to work on this during working hours, 
regrettably.

That doesn't mean I (and Woonsan) are no longer interested in working on this,
but can only do so on our own account outside office hours.
And as we've been very busy with lots of other work, you probably can understand
that working on Commons SCXML kind of ended up on the back burner.

Also there hasn't been much input from the 'community' either...

That said, your question tricked me in reviewing again the current state and
outstanding issues, for M2 and beyond, and what can/should be done next.

And I now realize again that another reason why I 'dropped the ball' since last
February is that at that time I reached several technical and frustrating
problems in the current functionality, concerning both the Javascript and XPath
datamodel support.

As you might know, the now final SCXML 1.0 specification at the end dropped the
XPath support because there were no concrete implementations, because of lack of
interest and too many complications and limitations with XPath to be able to
provide a proper implementation.

And those same complications and limitations are also causing serious and
invasive problems in the (overall) implementation in Commons SCXML.
Honestly, I'm fed up with the XML/XPath datamodel as it is hampering and
complicating the implementation way too much.

Therefore, I want to propose to completely drop XML/XPath datamodel and language
support for Commons SCXML 2.0, before moving on with completing and wrapping up
the goals for M2.

This however is a very radical change, including dropping the support for the
Data() and just added Location() functions for the Jexl and Groovy languages.
Instead however, I would like to replace this by providing proper JSON datamodel
support, not just for Javascript but also the Jexl and Groovy languages.
Technically and functionally this will be:
- much easier and straightforward to implement with a lot less edge-cases
- much easier and practical to use

And in addition, for proper Javascript support we should move to Java 8
(Nashorn Javascript engine), and thus drop support for Java 6 and 7.

But before doing so, this needs to be discussed and agreed upon by the
Commons SCXML community, however small a group that might be nowadays.

I hope you and others can comment on this idea and provide feedback if you
would be OK, or why not.
If for example you or others strongly depend and rely on XML datamodel support,
than this might be a no go, unless you are fine with migrating from XML/XPath to
JSON instead.

If we can make this decision: drop XML/XPath support, add JSON as alterative,
and move to Java 8 as minimum, then we can move forward much faster and with a
much cleaner and leaner implementation.
I'd then be happy and motivated again to continue working towards M2 shortly,
and I know Woonsan is willing to pitch in then as 

Re: Re: [scxml] update and progress?

2015-12-04 Thread R.C. Hoekstra
Hi Ate, 

thanks for answering. 

As for the datamodel...
Well, I put the stuff in our project which depended on the datamodel on hold. 
We wanted to apply a datamodel in order to separate the state flow logic and 
the numbers used in it, but we haven't done that up to now, because I was 
afraid that the datamodel on scxml commons would become subject of serious 
changes. 

So for us it's still very flexible, as we didn't start with that part yet. I 
have a slight personal preference for at least the xml in the datamodel, but 
it's not that important. For us the progress of the project is much more 
important than the choice on which language support will be there and which 
not. 
So I can perfectly live with JSON. And if your proposal leads to greater ease 
of use and faster implementation, that is fantastic. Please do so. 

The support for java8 is also fine with me. We're doing everything in java 8.

So conclusion: your proposal is supported from over here!

best regards, Rinke




Hi Rinke,

On 2015-11-24 12:24, R.C. Hoekstra wrote:
> Hi Ate, Woonsan,
>
> I was wondering if you guys could give us an update on the progress of
> SCXML, and tell us how it's going.
>
> Specifically, I was wondering if you could give us any clue on when
> Milestone 2 can be expected. I'm looking forward to the new datamodel
> features with great interest.
>
> I don't see much questions and activity on the mailinglist on scxml, but I'd
> like you to know that we are still very enthousiastic on the scxml project.

That is great to hear, and thank you for saying so!

Obviously there hasn't been much progress since early this year :(

Main reason for this is that the current M1 release has been sufficient for our
current use-cases, so far, and we thus right now don't have a real business
driver nor concrete budget/time to work on this during working hours, 
regrettably.

That doesn't mean I (and Woonsan) are no longer interested in working on this,
but can only do so on our own account outside office hours.
And as we've been very busy with lots of other work, you probably can understand
that working on Commons SCXML kind of ended up on the back burner.

Also there hasn't been much input from the 'community' either...

That said, your question tricked me in reviewing again the current state and
outstanding issues, for M2 and beyond, and what can/should be done next.

And I now realize again that another reason why I 'dropped the ball' since last
February is that at that time I reached several technical and frustrating
problems in the current functionality, concerning both the Javascript and XPath
datamodel support.

As you might know, the now final SCXML 1.0 specification at the end dropped the
XPath support because there were no concrete implementations, because of lack of
interest and too many complications and limitations with XPath to be able to
provide a proper implementation.

And those same complications and limitations are also causing serious and
invasive problems in the (overall) implementation in Commons SCXML.
Honestly, I'm fed up with the XML/XPath datamodel as it is hampering and
complicating the implementation way too much.

Therefore, I want to propose to completely drop XML/XPath datamodel and language
support for Commons SCXML 2.0, before moving on with completing and wrapping up
the goals for M2.

This however is a very radical change, including dropping the support for the
Data() and just added Location() functions for the Jexl and Groovy languages.
Instead however, I would like to replace this by providing proper JSON datamodel
support, not just for Javascript but also the Jexl and Groovy languages.
Technically and functionally this will be:
- much easier and straightforward to implement with a lot less edge-cases
- much easier and practical to use

And in addition, for proper Javascript support we should move to Java 8
(Nashorn Javascript engine), and thus drop support for Java 6 and 7.

But before doing so, this needs to be discussed and agreed upon by the
Commons SCXML community, however small a group that might be nowadays.

I hope you and others can comment on this idea and provide feedback if you
would be OK, or why not.
If for example you or others strongly depend and rely on XML datamodel support,
than this might be a no go, unless you are fine with migrating from XML/XPath to
JSON instead.

If we can make this decision: drop XML/XPath support, add JSON as alterative,
and move to Java 8 as minimum, then we can move forward much faster and with a
much cleaner and leaner implementation.
I'd then be happy and motivated again to continue working towards M2 shortly,
and I know Woonsan is willing to pitch in then as well.
That might still need a few months work to complete, but definitely overseeable.

Kind regards,
Ate

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

Re: [SCXML] Timers in SCXML

2015-09-05 Thread Woonsan Ko
Hi,

Which version of SCXML are you using? If you used a version older than
2.0-SNAPSHOT (sorry, 2.0 is still not released yet), could you try
with 2.0-SNAPSHOT by building locally by yourself from [1]?
Also, I wonder if you had a chance to follow Rahul's advice in the old
thread? I think he already gave good pointers.

Regards,

Woonsan

[1] https://github.com/apache/commons-scxml

On Thu, Sep 3, 2015 at 7:47 PM, giangttpham  wrote:
> I know this topic has been solved a long time ago but if anyone out there is
> listening, please help me. This is the scxml I have but the Timer delay
> doesn't work. I have the same problem as the person who started this post,
> after the send, the program just stops, it never goes to the next state.
>
> http://www.w3.org/2005/07/scxml;
>   version="1.0"
>   initial="player">
>
> 
> 
> 
> 
>
>  
>   
>
>   
>  
>
> 
>
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
>
> --
> View this message in context: 
> http://apache-commons.680414.n4.nabble.com/SCXML-Timers-in-SCXML-tp746934p4678456.html
> Sent from the Commons - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

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



Re: [SCXML] Timers in SCXML

2015-09-03 Thread giangttpham
I know this topic has been solved a long time ago but if anyone out there is
listening, please help me. This is the scxml I have but the Timer delay
doesn't work. I have the same problem as the person who started this post,
after the send, the program just stops, it never goes to the next state.

http://www.w3.org/2005/07/scxml;
  version="1.0"
  initial="player">






 
  
   
  
 

































--
View this message in context: 
http://apache-commons.680414.n4.nabble.com/SCXML-Timers-in-SCXML-tp746934p4678456.html
Sent from the Commons - User mailing list archive at Nabble.com.

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



Re: SCXML and Script and context access

2015-08-31 Thread Woonsan Ko
On Tue, Aug 18, 2015 at 6:27 AM, Sinisa Zec  wrote:
> Dears,
>
>
>
> We are using Apache SCXML2 for the project which is based on FSM logic. I am
> trying for some time to achieve the following:
>
>
>
> 1.Set some variables in (Groovy)context from Java – X set of variables
>
> 2.Read those values in from the 

Re: SCXML and Script and context access

2015-08-24 Thread Ate Douma

On 2015-08-18 12:27, Sinisa Zec wrote:

Dears,



We are using Apache SCXML2 for the project which is based on FSM logic. I am
trying for some time to achieve the following:



1.Set some variables in (Groovy)context from Java – X set of variables

2.Read those values in from the script in Groovy (it might be any other
but we have chosen Groovy - other suggestions are welcomed).

3.Set the NEW set of variables (in GroovyContext) from Groovy script – Y set
of variables (in principle it is simple mapping)

4.Read the new values (Y set) from context in Java.



I didn't find another way for the scenario above, but to initialize Y set of
variables to empty values already in Java, before step 3. from above.

Do you possible have a different suggestion?


What we typically do is providing a predefined POJO (which could be as simple as 
a Map) through the SCXMLExecutor.getRootContext() and use that as an external 
environment variable.
Then you can simply script your variables via that environment variable, e.g. 
env.X and env.Y






Do you think it would be better to try this with Jexl (I did try, but
totally failed to do anything with Context from Jexl script)?

Groovy in general is more powerful (and dangerous :) ).





Are you possible aware of any useful examples of context manipulation from
script (Groovy or any other)?
I don't think we really have concrete examples/tests in Commons SCXML, but it 
should be trivial to do this yourself.






Thank you very much in advance!





mit freundlichen Grüßen / with best regards / Lijepi pozdrav
Sinisa Zec


___

Adcon d.o.o.

Josipa Jurja Strossmayera 341

31000 Osijek

Hrvatska – Croatia

fix: +385 31 638 136

mobile: +385 91 509 0903

  http://www.adcon.hr/ www.adcon.hr



Sinisa Zec   mailto:%3csinisa@adcon.hr%3e sinisa@adcon.hr

development

___








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



Re: Re: Re: [scxml] bug with script in combination of a chain of transitions

2015-07-07 Thread R.C. Hoekstra
Hi Ate, 

Ah, I understand the issue now. Thanks for looking at it. 

best regards, Rinke
-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [scxml] bug with script in combination of a chain of transitions

2015-06-30 Thread Ate Douma

Hi Rinke,

I just had time to look at your example, and quickly discovered where the 
problem is.


Further comments inline below.

Regards, Ate

On 2015-06-15 22:37, R.C. Hoekstra wrote:

Hi Woonsan, hi others,

At first, sorry for the late reply. I posted the issue in april, but didn't get 
a response in the first two weeks. Then I forgot about it (busy with other 
issues), and then just saw your reply, about a week ago.

Anyway, I've been thinking hard about the issue, and I think I now understand 
what is going on here.

Then again, sorry that my example wasn't so clear, at first. The problem is 
we're having very complicated scxml schemes working with several custom 
classes, and I tried to bring the example back to the basics, but probably just 
missed the key thing.

It basically comes to this, I discovered. Consider this scxml:

state id=bla
transition event=screening target=cxr /
/state

state id=cxr
 onentry
  ntd:test id=CXR /
 /onentry
 transition event=CXR.negative target=untreated /
 transition event=CXR.positive target=somethingelse/
/state
state id=untreated /

The custom ntd:test tag fires a CXR.negative event.

Now the SCXMLListener reports this for the onentry's and onexit's

...
0.000: Human#0 ONEXIT bla
0.000: Human#0 ONEXIT cxr
0.000: Human#0 ONENTRY untreated
0.000: Human#0 ONENTRY cxr

Note that the problem is that the cxr state's onexit is reported first, and 
only at the end of the chain the onentry for cxr is reported. The order should 
have been this:
onexit bla
onentry cxr
onexit cxr
onentry untreated

This doesn't happen with logs, it only happens with my own custom action.

The custom action does some tests, and on basis of the state the engine is in, 
and has been in (and some other stuff) the outcome is positive or negative.
It then sends back a positive or a negative event, via this code:


 TriggerEvent[] evts = { new TriggerEvent(stateMachineEvent, 
TriggerEvent.SIGNAL_EVENT, payload) };



 scxmlExecutorInstance.triggerEvents(evts);


Here is the culprit: you cannot and may not invoke triggerEvents (reentrant) 
from the thread executing the statemachine itself.
SCXML, by specification, is strictly sequential in processing (to ensure 
deterministic behavior).
What you should do instead is adding your event to the internal event queue of 
the statemachine from within your custom action like:


@Override
public void execute(ActionExecutionContext exctx) throws ModelException, 
SCXMLExpressionException {

...
TriggerEvent evt = new TriggerEvent(stateMachineEvent, 
TriggerEvent.SIGNAL_EVENT, payload);

exctx.getInternalIOProcessor().addEvent(evt);
}

This will queue your event to be processed during (at the end of) the current 
external event processing, before control is returned back to the statemachine 
invoker.


Alternatively, you also can add the event to the external IO event queue via 
scxmlExecutorInstance.addEvent(evt).
That will queue your event to be processed after the current (and possible other 
pending) external event processing.


Or you can even use the ActionExecutionContext.getEventDispatcher() and dispatch 
your event indirectly. In that case you might want to take a look at the Send 
class implementation for example.


HTH, Ate




where stateMachineEvent is either id.positive or id.negative.


So what happens is this:
1) state machine exits bla - onexit bla is reported by listener
2) state machine enters cxr, and goes straight to onentry
3) custom action is executed, scxmlExecutorInstance.triggerEvents is called with 
CXR.negative.
4) Still as part of the custom action, the event is caught in the transition tag, and 
state machine directed to untreated
5) the cxr state is exited - onexit cxr reported by listener
6) untreated state entered - onentry untreated reported by listener
7) Now that the state of the scxmlExecutoerInstance.triggerEvents call is 
reached, only now the custom Actions's execute method is returned.
8) only after the execute method of the custom action returned, the onentry block of 
cxr is finished, and only after that the onentry cxr is reported by the 
listener.


So, conclusion:

A) does this scenario make sense?
B) would you consider this as a bug? The behavior is at least tricky...


Thanks, Rinke






Hi Rinke,

Did you run with commons-scxml2-2.0-SNAPSHOT?
I've tried to run the following similar to yours on latest revision, but the 
result seems
different from what you're seeing:

?xml version=1.0 ?
scxml xmlns=http://www.w3.org/2005/07/scxml;
version=1.0
datamodel=jexl
initial=test1

   state id=test1 initial=test1.1

 state id=test1.1
   onentry
 log expr='logging in test1.1' /
   /onentry
   transition event=test1.1.positive target=test1.2/
 /state

 state 

Re: Re: [scxml] bug with script in combination of a chain of transitions

2015-06-28 Thread R.C. Hoekstra
Hi Ate, 

Sorry I forgot to mention, it's 2.0-SNAPSHOT. 

Thanks for looking at it. 

best regards, Rinke


 Date  Mon, 22 Jun 2015 23:10:21 GMT
 Hi Rinke,
 
 I will try to take a look at your issue later (end of) this week.
 It would be helpful if you can report against which version you are 
 experiencing 
 this behavior: current 2.0-SNAPSHOT or earlier milestone 2.0-M1 or 2.0-M0?
 
 Thanks, Ate
-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [scxml] bug with script in combination of a chain of transitions

2015-06-22 Thread Ate Douma

Hi Rinke,

I will try to take a look at your issue later (end of) this week.
It would be helpful if you can report against which version you are experiencing 
this behavior: current 2.0-SNAPSHOT or earlier milestone 2.0-M1 or 2.0-M0?


Thanks, Ate


On 2015-06-15 22:37, R.C. Hoekstra wrote:

Hi Woonsan, hi others,

At first, sorry for the late reply. I posted the issue in april, but didn't get 
a response in the first two weeks. Then I forgot about it (busy with other 
issues), and then just saw your reply, about a week ago.

Anyway, I've been thinking hard about the issue, and I think I now understand 
what is going on here.

Then again, sorry that my example wasn't so clear, at first. The problem is 
we're having very complicated scxml schemes working with several custom 
classes, and I tried to bring the example back to the basics, but probably just 
missed the key thing.

It basically comes to this, I discovered. Consider this scxml:

state id=bla
transition event=screening target=cxr /
/state

state id=cxr
 onentry
  ntd:test id=CXR /
 /onentry
 transition event=CXR.negative target=untreated /
 transition event=CXR.positive target=somethingelse/
/state
state id=untreated /

The custom ntd:test tag fires a CXR.negative event.

Now the SCXMLListener reports this for the onentry's and onexit's

...
0.000: Human#0 ONEXIT bla
0.000: Human#0 ONEXIT cxr
0.000: Human#0 ONENTRY untreated
0.000: Human#0 ONENTRY cxr

Note that the problem is that the cxr state's onexit is reported first, and 
only at the end of the chain the onentry for cxr is reported. The order should 
have been this:
onexit bla
onentry cxr
onexit cxr
onentry untreated

This doesn't happen with logs, it only happens with my own custom action.

The custom action does some tests, and on basis of the state the engine is in, 
and has been in (and some other stuff) the outcome is positive or negative.
It then sends back a positive or a negative event, via this code:


 TriggerEvent[] evts = { new TriggerEvent(stateMachineEvent, 
TriggerEvent.SIGNAL_EVENT, payload) };
 scxmlExecutorInstance.triggerEvents(evts);

where stateMachineEvent is either id.positive or id.negative.


So what happens is this:
1) state machine exits bla - onexit bla is reported by listener
2) state machine enters cxr, and goes straight to onentry
3) custom action is executed, scxmlExecutorInstance.triggerEvents is called with 
CXR.negative.
4) Still as part of the custom action, the event is caught in the transition tag, and 
state machine directed to untreated
5) the cxr state is exited - onexit cxr reported by listener
6) untreated state entered - onentry untreated reported by listener
7) Now that the state of the scxmlExecutoerInstance.triggerEvents call is 
reached, only now the custom Actions's execute method is returned.
8) only after the execute method of the custom action returned, the onentry block of 
cxr is finished, and only after that the onentry cxr is reported by the 
listener.


So, conclusion:

A) does this scenario make sense?
B) would you consider this as a bug? The behavior is at least tricky...


Thanks, Rinke






Hi Rinke,

Did you run with commons-scxml2-2.0-SNAPSHOT?
I've tried to run the following similar to yours on latest revision, but the 
result seems
different from what you're seeing:

?xml version=1.0 ?
scxml xmlns=http://www.w3.org/2005/07/scxml;
version=1.0
datamodel=jexl
initial=test1

   state id=test1 initial=test1.1

 state id=test1.1
   onentry
 log expr='logging in test1.1' /
   /onentry
   transition event=test1.1.positive target=test1.2/
 /state

 state id=test1.2
   onentry
 log expr='logging in test1.2' /
   /onentry
   transition event=test1.2.positive target=test1.3/
 /state

 state id=test1.3
   onentry
 log expr='logging in test1.3' /
   /onentry
 /state

   /state

/scxml

I removed the custom action tags and replaced the script tag with simple log 
tags.
And I see the following when I tested it with the stanadlone tool [1]:

$ ./scxml.sh test.scxml
?xml version=1.0 encoding=UTF-8?scxml 
xmlns=http://www.w3.org/2005/07/scxml;
xmlns:cs=http://commons.apache.org/scxml; version=1.0 initial=test1 
datamodel=jexl
 8  8 
/scxml

May 05, 2015 11:44:51 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1
May 05, 2015 11:44:51 PM org.apache.commons.scxml2.model.Log execute
INFO: null: logging in test1.1
May 05, 2015 11:44:51 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1/test1.1
test1.1.positive
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onExit
INFO: exit /test1/test1.1
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onTransition
INFO: 

Re: Re: [scxml] bug with script in combination of a chain of transitions

2015-06-15 Thread R.C. Hoekstra
Hi Woonsan, hi others, 

At first, sorry for the late reply. I posted the issue in april, but didn't get 
a response in the first two weeks. Then I forgot about it (busy with other 
issues), and then just saw your reply, about a week ago. 

Anyway, I've been thinking hard about the issue, and I think I now understand 
what is going on here. 

Then again, sorry that my example wasn't so clear, at first. The problem is 
we're having very complicated scxml schemes working with several custom 
classes, and I tried to bring the example back to the basics, but probably just 
missed the key thing. 

It basically comes to this, I discovered. Consider this scxml: 

state id=bla
   transition event=screening target=cxr /
/state

state id=cxr
onentry
 ntd:test id=CXR /
/onentry 
transition event=CXR.negative target=untreated /
transition event=CXR.positive target=somethingelse/
/state
state id=untreated /

The custom ntd:test tag fires a CXR.negative event. 

Now the SCXMLListener reports this for the onentry's and onexit's

...
0.000: Human#0 ONEXIT bla
0.000: Human#0 ONEXIT cxr
0.000: Human#0 ONENTRY untreated
0.000: Human#0 ONENTRY cxr

Note that the problem is that the cxr state's onexit is reported first, and 
only at the end of the chain the onentry for cxr is reported. The order should 
have been this: 
onexit bla
onentry cxr
onexit cxr
onentry untreated

This doesn't happen with logs, it only happens with my own custom action. 

The custom action does some tests, and on basis of the state the engine is in, 
and has been in (and some other stuff) the outcome is positive or negative. 
It then sends back a positive or a negative event, via this code: 


TriggerEvent[] evts = { new TriggerEvent(stateMachineEvent, 
TriggerEvent.SIGNAL_EVENT, payload) };
scxmlExecutorInstance.triggerEvents(evts);

where stateMachineEvent is either id.positive or id.negative. 


So what happens is this:
1) state machine exits bla - onexit bla is reported by listener
2) state machine enters cxr, and goes straight to onentry
3) custom action is executed, scxmlExecutorInstance.triggerEvents is called 
with CXR.negative. 
4) Still as part of the custom action, the event is caught in the transition 
tag, and state machine directed to untreated
5) the cxr state is exited - onexit cxr reported by listener
6) untreated state entered - onentry untreated reported by listener
7) Now that the state of the scxmlExecutoerInstance.triggerEvents call is 
reached, only now the custom Actions's execute method is returned. 
8) only after the execute method of the custom action returned, the onentry 
block of cxr is finished, and only after that the onentry cxr is reported 
by the listener. 


So, conclusion: 

A) does this scenario make sense? 
B) would you consider this as a bug? The behavior is at least tricky...


Thanks, Rinke






Hi Rinke,

Did you run with commons-scxml2-2.0-SNAPSHOT?
I've tried to run the following similar to yours on latest revision, but the 
result seems
different from what you're seeing:

?xml version=1.0 ?
scxml xmlns=http://www.w3.org/2005/07/scxml;
   version=1.0
   datamodel=jexl
   initial=test1

  state id=test1 initial=test1.1

state id=test1.1
  onentry
log expr='logging in test1.1' /
  /onentry
  transition event=test1.1.positive target=test1.2/
/state

state id=test1.2
  onentry
log expr='logging in test1.2' /
  /onentry
  transition event=test1.2.positive target=test1.3/
/state

state id=test1.3
  onentry
log expr='logging in test1.3' /
  /onentry
/state

  /state

/scxml

I removed the custom action tags and replaced the script tag with simple log 
tags.
And I see the following when I tested it with the stanadlone tool [1]:

$ ./scxml.sh test.scxml 
?xml version=1.0 encoding=UTF-8?scxml 
xmlns=http://www.w3.org/2005/07/scxml;
xmlns:cs=http://commons.apache.org/scxml; version=1.0 initial=test1 
datamodel=jexl
 8  8 
/scxml

May 05, 2015 11:44:51 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1
May 05, 2015 11:44:51 PM org.apache.commons.scxml2.model.Log execute
INFO: null: logging in test1.1
May 05, 2015 11:44:51 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1/test1.1
test1.1.positive
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onExit
INFO: exit /test1/test1.1
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onTransition
INFO: transition (event = test1.1.positive, cond = null, from = /test1/test1.1, 
to = /test1/test1.2)
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.model.Log execute
INFO: null: logging in test1.2
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter 

Re: [scxml] bug with script in combination of a chain of transitions

2015-05-05 Thread Woonsan Ko
Hi Rinke,

Did you run with commons-scxml2-2.0-SNAPSHOT?
I've tried to run the following similar to yours on latest revision, but the 
result seems different from what you're seeing:

?xml version=1.0 ?
scxml xmlns=http://www.w3.org/2005/07/scxml;
   version=1.0
   datamodel=jexl
   initial=test1

  state id=test1 initial=test1.1

state id=test1.1
  onentry
log expr='logging in test1.1' /
  /onentry
  transition event=test1.1.positive target=test1.2/
/state

state id=test1.2
  onentry
log expr='logging in test1.2' /
  /onentry
  transition event=test1.2.positive target=test1.3/
/state

state id=test1.3
  onentry
log expr='logging in test1.3' /
  /onentry
/state

  /state

/scxml

I removed the custom action tags and replaced the script tag with simple log 
tags.
And I see the following when I tested it with the stanadlone tool [1]:

$ ./scxml.sh test.scxml 
?xml version=1.0 encoding=UTF-8?scxml 
xmlns=http://www.w3.org/2005/07/scxml; 
xmlns:cs=http://commons.apache.org/scxml; version=1.0 initial=test1 
datamodel=jexl
 8  8 
/scxml

May 05, 2015 11:44:51 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1
May 05, 2015 11:44:51 PM org.apache.commons.scxml2.model.Log execute
INFO: null: logging in test1.1
May 05, 2015 11:44:51 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1/test1.1
test1.1.positive
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onExit
INFO: exit /test1/test1.1
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onTransition
INFO: transition (event = test1.1.positive, cond = null, from = /test1/test1.1, 
to = /test1/test1.2)
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.model.Log execute
INFO: null: logging in test1.2
May 05, 2015 11:45:16 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1/test1.2
test1.2.positive
May 05, 2015 11:45:47 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onExit
INFO: exit /test1/test1.2
May 05, 2015 11:45:47 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onTransition
INFO: transition (event = test1.2.positive, cond = null, from = /test1/test1.2, 
to = /test1/test1.3)
May 05, 2015 11:45:47 PM org.apache.commons.scxml2.model.Log execute
INFO: null: logging in test1.3
May 05, 2015 11:45:47 PM org.apache.commons.scxml2.env.SimpleSCXMLListener 
onEntry
INFO: enter /test1/test1.3

(I typed 'test1.1.positive' and 'test1.2.positive' to trigger those events 
manually.)

So, the execution order is as follows:
1. enter into test1 state
2. execute actions in onentry of test1.1 state
3. enter into test1.1 state and wait
4. 'test1.1.positive' event triggered manually
5. exit from test1.1 state
6. transition from test1.1 to test 1.2 state
7. execute actions in onentry of test1.2 state
8. enter into test1.2 state
9. 'test1.2.positive' event triggered manually
10. exit from test1.2 state
11. transition from test1.2 to test1.3 state
12. execute actions in onentry of test1.3 state
13. enter into test1.3 state

I don't think script action would be different from log action in execution 
ordering, so I think you're seeing a different result on your end for some 
reason. Maybe you can try to find what the difference comes from?

Regards,

Woonsan

[1] http://commons.apache.org/proper/commons-scxml/guide/testing-standalone.html



On Fri, 4/17/15, R.C. Hoekstra r.c.hoeks...@erasmusmc.nl wrote:

 Subject: [scxml] bug with script in combination of a chain of transitions
 To: user@commons.apache.org user@commons.apache.org
 Date: Friday, April 17, 2015, 4:12 AM
 
 Dear people at scxml, 
 
 I found a bug in the scxml commons project. 
 
 Consider this scxml file: 
 
     state id=test1 initial=test1.1
         state id=test1.1
             onentry
                
 ntd:test id=test1.1 isIn=test1.1 /
                
 script agent.storeInMemory(test1.1);
 /script
             /onentry
             transition
 event=test1.1.positive target=test1.2/
         /state
         state id=test1.2
             onentry
                
 ntd:test id=test1.2 isIn=test1.1 memory=true
 /
             /onentry
             transition
 event=test1.2.positive target=test1.3/
         /state
         state id=test1.3/
     /state
 
 There is a custom tag, which simply tests if the state
 machine is at present in the state specified in the isIn
 attribute. If it is, it sends an event id.positive,
 else it sends id.negative.
 The purpose of this is that we needed a memory: a test that
 the state machine has at any moment been in a certain state.
 That is done via the script tag: via the
 agent.storeInMemory(test1.1) call, the test1.1 state is
 stored in the memory of the agent, and ntd:test tag
 considers this memory if the memory=true attribute is
 specified. As the state test1.1 is stored in memory while

Re: [scxml] xsd schema

2014-12-27 Thread Jacob Beard
Hi Rinke,

You could refactor your SCXML to use xsi:include instead of state/@src. I know 
that, for example, the xmllint utility includes a command-line argument 
--xinclude which will resolve these references.

Jake

 On Dec 27, 2014, at 3:32 AM, R.C. Hoekstra r.c.hoeks...@erasmusmc.nl wrote:
 
 Hi list, 
 
 We have fairly complex scxml files and would like to validate them against a 
 schema. I know there are the schema files from w3c, but the scxml files do 
 not validate by those. 
 
 The problem is we are using the state src attribute, which is not in that 
 schema (but which can easily be added). However, validation still fails 
 because with multiple files you can refer to state id's which exist in the 
 other files referenced via src. 
 
 I was wondering if anyone has an adapted scxml schema for this. 
 
 best regards, Rinke
 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org
 


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



Re: [SCXML] heads-up: Major SCXML 2.0 trunk refactoring incoming - breaking changes and intermediate instability to be expected!

2014-11-14 Thread Ate Douma

Hi SCXML developers and users,

This is a follow-up on the current status of the incoming 'breaking changes'.

Good news: the trunk is stable again :)

I've just committed the last set of intended changes through SCXML-213 [1], 
SCXML-221 [2] and SCXML-222 [3].


I invite anyone interested to checkout and update to the latest trunk and try 
and test it out yourself.


But be aware that there *are* important changes.

Some of the APIs changed, although it depends on how much you've been 
extending/customizing Commons SCXML if you'll have to adjust your code base or 
not. Most significant probably in that regard are the changes to the 
EventDispatcher interface and the *removal* of the SimpleScheduler, which has 
been 'collapsed' in the now much more complete SimpleDispatcher class.


More invasive probably are the possible changes in the SCXML document you might 
have to make, specifically if you've been using the Data() xpath builtin 
function, which was re-implemented and changed on signature (now only taking one 
instead of two parameters).


Furthermore, a new Location() xpath builtin has been added, which you now *must* 
use instead of the Data() function for location expressions.


Finally, one specific behavioral change of the send action is important to 
note (below copying the comment from SCXML-213):


The send action without a specified delay used to deliver the event through 
the internal I/O event queue.
This however was in violation of the specification (unless target=#_internal 
is specified, which wasn't supported yet).
This behavior now has been changed to be in compliance with the specification, 
so such send actions will now deliver the event through the external I/O event 
queue.
This is important, because the Commons SCXML executor will NOT automatically 
process external events itself: you'll have to invoke 
SCXMLExecutor.triggerEvents() for that manually!
If you used such send actions without a specified delay, be aware this WILL 
cause a behavioral change in your SCXML execution!!
You either have to now handle such events manually, like described above, OR 
specify send target=#_internal ... (which now IS supported) to retain the 
earlier behavior.


And as an extra, I've added support for the null datamodel AND the SCXML IRP 
test cases [4].


With these many changes, the current online documentation is really no longer 
up-to-date anymore.
I'll focus on updating the documentation shortly, after I returned from the 
ApacheCon EU in Budapest next week.
Until then, either hold off diving into the 'latest greatest' or else dive into 
the code and the unit tests to figure out how/what :)


Kind regards,
Ate

p.s. If anyone is at the ApacheCon next week, I'd love to meet you there. Just 
ping me through email.
Or even better: you can 'find me' when/after I've done my Commons SCXML 
presentation on Monday morning ;)


[1] https://issues.apache.org/jira/browse/SCXML-213
[2] https://issues.apache.org/jira/browse/SCXML-221
[3] https://issues.apache.org/jira/browse/SCXML-212
[4] http://www.w3.org/Voice/2013/scxml-irp/


On 2014-10-27 01:35, Ate Douma wrote:

Hi SCXML developers and users,

This is a heads-up for everyone using the current SCXML 2.0 trunk for their
projects.

Please checkout issue https://issues.apache.org/jira/browse/SCXML-213 which I
just created, which will requires some extensive refactoring and *breaking*
changes to the current datamodel and xpath based expressions handling.

And this includes SCXML documents using the supported non-xpath languages like
Jexl, Ecmascript and Groovy!

These changes are needed to 'fix' the current incomplete and incorrect datamodel
handling and in particular the usage of the custom Data() function and the
assign action.

This issue, and the related subtasks, will take some time to process and
complete, and in the mean time the current SCXML 2.0 trunk might become
intermediately instable.

So please be warned and probably best do NOT update to the incoming changes
until the dust has settled...
Unless you'd like to hand me some help, with testing, feedback or otherwise,
which I'd definitely would appreciate!

I'll send a following heads-up to this list once I think the engine is
stabilized again and reliable enough to upgrade again.

And as indicated, this WILL result in some breaking changes in how you use the
Data() function and assign action.
I'll provide a comprehensive explanation and migration instructions once it is
clear what and how exactly has or will be changed.

Kind regards,

Ate



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



Re: [SCXML] Plans for making SCXML more dynamic?

2014-10-27 Thread Jacob Beard

On Oct 26, 2014, at 10:45 AM, Benoît Thiébault thieba...@artenum.com wrote:

 Jake's suggestion is also interesting, but in that case I wonder how would 
 the different state diagrams interact with each other.

Each SCXML instance should receive a sessionId. Statechart instances can 
communicate with one another using SCXML send targetexpr=“target.sessionId”/. 
“target.sessionId” can be passed in dynamically when an SCXML instance is 
initialized.

I’m not sure if sessionId is currently supported by SCXML Commons. 

Feel free to contact me off-list to discuss in more detail.

All the best,

Jacob Beard



Re: [SCXML] Plans for making SCXML more dynamic?

2014-10-26 Thread Benoît Thiébault
Hi and thank you for your answers

 It isn't really clear to me under what conditions you are executing the 
 existing state chart.

We are developing an open source scientific software called SPIS (for 
Spacecraft Plasma Interactions Software http://dev.spis.org). As its name 
implies, it models the physics of space plasmas around in-orbit satellites, but 
I guess that's off-topic ;-).

We use a state chart to represent what we call the modelling chain (cf. 
attached picture), which is a generic definition of the steps to go through for 
modelling a spacecraft.

The software is based on OSGi and is composed of modules (called bundles in 
OSGi terminology) that are loaded dynamically. Roughly, we can say that each 
module provides the features necessary to perform one step of the modelling 
chain: we have a spacecraft geometry modeller, a mesher, an editor for initial 
and boundary conditions, etc. When the application starts, all bundles are 
loaded (we don't know the order in which they are loaded, it's the OSGi 
framework that decides depending on module dependencies). As of today, we have 
a unique, central state engine that defines the steps of the modelling chain 
and the modules trigger the transitions when they are done.

For now, there is just a single version of the software, but the idea is to be 
able, in the future, to provide different versions, with different capabilities 
depending on the modules provided. It is somewhat similar to what you can do 
with Eclipse distributions (Eclipse is OSGi-based by the way): depending on the 
modules installed, you have a Java IDE, a C++ IDE or a Fortran IDE (or 
something completely different). In our case, we could model different physics 
and modify the modelling chain on the fly depending on the loaded modules. We 
call that an IME (Integrated Modelling Environment). In that scenario, we would 
like the modules to inject in the central state chart the steps they are able 
to provide, not like today where it isn't dynamic: the state chart is defined 
centrally and the modules cannot modify it.

The solution you suggest is indeed interesting and could solve our problem. I 
was just wondering what was already coded in SCXML API and what needed to be 
done (either on our side or in the library).

Jake's suggestion is also interesting, but in that case I wonder how would the 
different state diagrams interact with each other.

Kind regards,

Ben

 Can't you simply rewrite (extend) the underlying SCXML XML document and then 
 reload/reset the statemachine with the updated document?
 That should be trivial to do and always have been possible.
 
 Or do you need to retain the current (context) state?
 That might be tricky as the current state is based on and tied to the SCXML 
 model, so if (sub)modules 'come and go' dynamically, you would need to ensure 
 the SCXML state is still valid and representative for the model.
 
 Maybe something like the following is an option?
 a) lock down the statemachine (disallow concurrent access/execution)
 b) somehow capture/clone the current internal state externally
 c) update your SCXML document as you need, using plain XML API or Commons 
 SCXML Java API
 d) reload the SCXML statemachine
 e) restore the previously captured state (step b)
 f) unlock the statemachine
 
 AFAICS the above should be doable without changes to the current Commons 
 SCXML implementation (and likely even with the 0.9 version), but for step b 
 and e to probably need to hook into (possibly extend) the Commons SCXML Java 
 API.
 
 If you have more concrete problems or otherwise think Commons SCXML really 
 need more dynamics support I'd be happy to discuss them further, but you need 
 to be more specific for me to understand your requirements.
 
 And of course I'd welcome contributions as well :)
 
 Regards,
 
 Ate
 
 
 Kind regards,
 
 Ben
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org
 




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

Re: [SCXML] Plans for making SCXML more dynamic?

2014-10-26 Thread Benoît Thiébault

 We use a state chart to represent what we call the modelling chain (cf. 
 attached picture)

OK, I can't attach pictures on the mailing list. Here it is: 
http://dev.artenum.com/projects/keridwen/images/modellingChain_jpg

Re: [scxml] passing datamodel elements into method call

2014-10-26 Thread Ate Douma

Hi Rinke,

I've been diving into the datamodel handling, the Data() function and supporting 
Builtin Java class the last several days.


I've now come to the conclusion that what you are asking for *should* be 
supported by Commons SCXML, and actually *is* supported through the SCXML 
specification.


The current implementation of this functionality in Commons SCXML however is 
very problematic, not just for your use-case but overall, and I've created issue 
SCXML-213 to address this.


I'm working on the SCXML 2.0 Milestone 2 goal and trying to execute (and pass) 
the SCXML IPR tests, which is pretty much blocked because of this issue.


Anyway, once I've solved this, I expect your requirement will be covered 
automatically as well!


Note though that the scope of SCXML-213 is pretty extensive and will take large 
scale (breaking) changes, for which I also just send out a separate heads-up to 
the list...


This will take a while to complete, so intermediately implementing a custom 
action to cover your requirements probably is still worthwhile.


Kind regards,

Ate


On 08-10-14 20:54, Ate Douma wrote:

On 08-10-14 11:31, R.C. Hoekstra wrote:

Hi Rinke, I think you would get a node if you used DataNode function
instead: cs:var name=treatment1Name
expr=DataNode(treatmentData,'treatments/treatment[1]/name') / Could you
try that?

Regards, Woonsan



Hi Woonsan,

thanks for your answer. But are you sure about that? If I use it like that, I
get an unknown, ambiguous or inaccessible method dataNode error.


Correct, DataNode() is not a function available (registered) within the context
of the expression evaluator.



I found the dataNode method in Builtin.java. Its javadoc says:

Manifests within location attribute of assign element, for Commons JEXL
and Commons EL based documents.

So what I get from it, is that dataNode can only be used to assign something
to a dataNode via assign.

That is not what I want. I want to pass a dataNode including subElements to
some java object via the cond attribute, so I can write a java method which
is able to check conditions with use of the passed dataNode.


So: is there a way in which I can pass a dataNode to a java object in the
context which is used in a cond attribute? Data obviously doesn't work, as I
can see in the Builtin code that it always is parsed to Double or String.


Not by the SCXML spec, and neither (directly) through Commons SCXML extensions.

However, it should be trivial to add such functionality yourself through a
custom Action. Then you can access and use the Builtin#dataNode method and do
whatever you like with a data node element.

For a quick intro in writing a custom Action (for Commons SCXML 2.0), see for
example slides 12,13 of my presentation at the ApacheCon earlier this year:


http://events.linuxfoundation.org/sites/events/files/slides/ApacheConUS2014%20-%20Apache%20Commons%20SCXML%202.0.pdf


and I suggest looking at the Commons SCXML Var action as simply example.

HTH, Ate




best regards, Rinke






On Thursday, October 2, 2014 3:53 AM, R.C. Hoekstra
r.c.hoeks...@erasmusmc.nl wrote:



Hi list, Hi people @ scxml commons,

Can I pass datamodel nodes to a rootContext var, in order to process it
in java?

like this: target event=bla cond=agent.check(datamodelNodeRef)
.../, where: * agent is an object of a java class made available to the
RootContext, having a check method returning Boolean. I want this check
method to evaluate the datamodelNode, in order to return true or false
depending on elements. * datamodelNodeRef is a reference to some node in
the datamodel.

I managed to pass final nodes as string here, like this:

cs:var name=treatment1Name
expr=Data(treatmentData,'treatments/treatment[1]/name') /, transition
... cond=agent.check(treament1Name)...

where the treatments/treatment[1]/name is a final node.


However, I would like to pass non final nodes of the datamodel, but
everything seems to be evaluated as strings first, before it is passed
into the method of the context var.

Hope you can give me a clue.

And, if these kind of constructions are possible, how would they do in
terms of performance?

thanks, Rinke








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



Re: [SCXML] Plans for making SCXML more dynamic?

2014-10-26 Thread Ate Douma

Hi Ben,

Very interesting use-case: Commons SCXML into space :)

I've only briefly looked at the image you shared, but it is difficult for me to 
comprehend the exact usage or how this is represented in SCXML.


If you'd be able to share some example SCXML document, and how parts of that 
should be(come) dynamically injected/removed, it might become easier to 
understand what your requirements are.


Thanks,

Ate


On 26-10-14 15:45, Benoît Thiébault wrote:

Hi and thank you for your answers


It isn't really clear to me under what conditions you are executing the 
existing state chart.


We are developing an open source scientific software called SPIS (for 
Spacecraft Plasma Interactions Software http://dev.spis.org). As its name 
implies, it models the physics of space plasmas around in-orbit satellites, but 
I guess that's off-topic ;-).

We use a state chart to represent what we call the modelling chain (cf. 
attached picture), which is a generic definition of the steps to go through for modelling 
a spacecraft.

The software is based on OSGi and is composed of modules (called bundles in 
OSGi terminology) that are loaded dynamically. Roughly, we can say that each 
module provides the features necessary to perform one step of the modelling 
chain: we have a spacecraft geometry modeller, a mesher, an editor for initial 
and boundary conditions, etc. When the application starts, all bundles are 
loaded (we don't know the order in which they are loaded, it's the OSGi 
framework that decides depending on module dependencies). As of today, we have 
a unique, central state engine that defines the steps of the modelling chain 
and the modules trigger the transitions when they are done.

For now, there is just a single version of the software, but the idea is to be 
able, in the future, to provide different versions, with different capabilities 
depending on the modules provided. It is somewhat similar to what you can do 
with Eclipse distributions (Eclipse is OSGi-based by the way): depending on the 
modules installed, you have a Java IDE, a C++ IDE or a Fortran IDE (or 
something completely different). In our case, we could model different physics 
and modify the modelling chain on the fly depending on the loaded modules. We 
call that an IME (Integrated Modelling Environment). In that scenario, we would 
like the modules to inject in the central state chart the steps they are able 
to provide, not like today where it isn't dynamic: the state chart is defined 
centrally and the modules cannot modify it.

The solution you suggest is indeed interesting and could solve our problem. I 
was just wondering what was already coded in SCXML API and what needed to be 
done (either on our side or in the library).

Jake's suggestion is also interesting, but in that case I wonder how would the 
different state diagrams interact with each other.

Kind regards,

Ben


Can't you simply rewrite (extend) the underlying SCXML XML document and then 
reload/reset the statemachine with the updated document?
That should be trivial to do and always have been possible.

Or do you need to retain the current (context) state?
That might be tricky as the current state is based on and tied to the SCXML 
model, so if (sub)modules 'come and go' dynamically, you would need to ensure 
the SCXML state is still valid and representative for the model.

Maybe something like the following is an option?
a) lock down the statemachine (disallow concurrent access/execution)
b) somehow capture/clone the current internal state externally
c) update your SCXML document as you need, using plain XML API or Commons SCXML 
Java API
d) reload the SCXML statemachine
e) restore the previously captured state (step b)
f) unlock the statemachine

AFAICS the above should be doable without changes to the current Commons SCXML 
implementation (and likely even with the 0.9 version), but for step b and e to 
probably need to hook into (possibly extend) the Commons SCXML Java API.

If you have more concrete problems or otherwise think Commons SCXML really need 
more dynamics support I'd be happy to discuss them further, but you need to be 
more specific for me to understand your requirements.

And of course I'd welcome contributions as well :)

Regards,

Ate



Kind regards,

Ben



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








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





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



Re: [SCXML] Plans for making SCXML more dynamic?

2014-10-25 Thread Ate Douma

On 25-10-14 09:22, Benoît Thiébault wrote:

Hi everyone,

I am very pleased to learn that SCXML is back online and that new evolutions
are coming with version 2.0. Congrats and good luck to the development team!

I already use SCXML 0.9 in one of my applications and one feature I was
missing was a more dynamic state engine. My application is OSGi-based and
thus very dynamic: modules come and go at runtime. What I wanted to do was to
be able to modify the state diagram at runtime: when a new bundle is loaded,
it injects its own state chart as a sub-set of the existing state chart. If I
understood SCXML correctly, this was not really possible with 0.9. Is it
planned for future versions?


It isn't really clear to me under what conditions you are executing the existing 
state chart.
Can't you simply rewrite (extend) the underlying SCXML XML document and then 
reload/reset the statemachine with the updated document?

That should be trivial to do and always have been possible.

Or do you need to retain the current (context) state?
That might be tricky as the current state is based on and tied to the SCXML 
model, so if (sub)modules 'come and go' dynamically, you would need to ensure 
the SCXML state is still valid and representative for the model.


Maybe something like the following is an option?
a) lock down the statemachine (disallow concurrent access/execution)
b) somehow capture/clone the current internal state externally
c) update your SCXML document as you need, using plain XML API or Commons SCXML 
Java API

d) reload the SCXML statemachine
e) restore the previously captured state (step b)
f) unlock the statemachine

AFAICS the above should be doable without changes to the current Commons SCXML 
implementation (and likely even with the 0.9 version), but for step b and e to 
probably need to hook into (possibly extend) the Commons SCXML Java API.


If you have more concrete problems or otherwise think Commons SCXML really need 
more dynamics support I'd be happy to discuss them further, but you need to be 
more specific for me to understand your requirements.


And of course I'd welcome contributions as well :)

Regards,

Ate



Kind regards,

Ben



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



Re: [SCXML] Plans for making SCXML more dynamic?

2014-10-25 Thread Jacob Beard
Hi Ben,

Could you create a new SCXML instance for each module? So, rather than having 
one global SCXML for the entire application, you have a number of small SCXML 
components, which you would instantiate when your module is loaded?

Jake

On Oct 25, 2014, at 3:22 AM, Benoît Thiébault thieba...@artenum.com wrote:

 Hi everyone,
 
 I am very pleased to learn that SCXML is back online and that new evolutions 
 are coming with version 2.0. Congrats and good luck to the development team!
 
 I already use SCXML 0.9 in one of my applications and one feature I was 
 missing was a more dynamic state engine. My application is OSGi-based and 
 thus very dynamic: modules come and go at runtime. What I wanted to do was to 
 be able to modify the state diagram at runtime: when a new bundle is loaded, 
 it injects its own state chart as a sub-set of the existing state chart. If I 
 understood SCXML correctly, this was not really possible with 0.9. Is it 
 planned for future versions?
 
 Kind regards,
 
 Ben
 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org
 


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



Re: Re: [scxml] passing datamodel elements into method call

2014-10-17 Thread R.C. Hoekstra
Thanks Woonsan, Ate, 

I think I can work that out. 

best regards, Rinke
-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Re: [scxml] passing datamodel elements into method call

2014-10-08 Thread R.C. Hoekstra
 Hi Rinke,
 I think you would get a node if you used DataNode function instead:
 cs:var name=treatment1Name 
 expr=DataNode(treatmentData,'treatments/treatment[1]/name') /
 Could you try that?

 Regards, Woonsan


Hi Woonsan,

thanks for your answer. But are you sure about that?
If I use it like that, I get an unknown, ambiguous or inaccessible method 
dataNode error.

I found the dataNode method in Builtin.java. Its javadoc says:

Manifests within location attribute of assign element, for Commons JEXL and 
Commons EL based documents.

So what I get from it, is that dataNode can only be used to assign something to 
a dataNode via assign.

That is not what I want. I want to pass a dataNode including subElements to 
some java object via the cond attribute, so I can write a java method which is 
able to check conditions with use of the passed dataNode.


So: is there a way in which I can pass a dataNode to a java object in the 
context which is used in a cond attribute? Data obviously doesn't work, as I 
can see in the Builtin code that it always is parsed to Double or String.

best regards, Rinke





 On Thursday, October 2, 2014 3:53 AM, R.C. Hoekstra 
 r.c.hoeks...@erasmusmc.nl wrote:

  Hi list, Hi people @ scxml commons,
 
  Can I pass datamodel nodes to a rootContext var, in order to process it in 
  java?
 
  like this:
  target event=bla cond=agent.check(datamodelNodeRef) .../,
  where:
  * agent is an object of a java class made available to the RootContext, 
  having a check method returning Boolean. I want this check method to 
  evaluate the
  datamodelNode, in order to return true or false depending on elements.
  * datamodelNodeRef is a reference to some node in the datamodel.
 
  I managed to pass final nodes as string here, like this:
 
  cs:var name=treatment1Name  
  expr=Data(treatmentData,'treatments/treatment[1]/name') /,
  transition ... cond=agent.check(treament1Name)...
 
  where the treatments/treatment[1]/name is a final node.
 
 
  However, I would like to pass non final nodes of the datamodel, but 
  everything seems to be evaluated as strings first, before it is passed into 
  the method of the context
  var.
 
  Hope you can give me a clue.
 
  And, if these kind of constructions are possible, how would they do in 
  terms of performance?
 
  thanks, Rinke



Re: Re: [scxml] passing datamodel elements into method call

2014-10-08 Thread Woonsan Ko
Hi Rinke,

Sorry for my confusion. Indeed, DataNode function seems to exist only for 
assign element.

Regarding other possible options, I think you can set a holder object (named 
treatmentDataHolder for instance) in the root context before execution, and 
you can invoke the holder's method to set the data object. For example,
  script
treatmentDataHolder.setData(treatementData);
treatmentDataHolder.setLocation('treatments/treatment[1]/name');
  /script

After execution, you can invoke treatmentDataHolder#getData() and 
treatmentDataHolder#getLocation() to read what was set during execution.


Regards,

Woonsan



On Wednesday, October 8, 2014 5:31 AM, R.C. Hoekstra 
r.c.hoeks...@erasmusmc.nl wrote:
 



 Hi Rinke,
 I think you would get a node if you used DataNode function instead:
 cs:var name=treatment1Name 
 expr=DataNode(treatmentData,'treatments/treatment[1]/name') /
 Could you try that?

 Regards, Woonsan


Hi Woonsan,

thanks for your answer. But are you sure about that?
If I use it like that, I get an unknown, ambiguous or inaccessible method 
dataNode error.

I found the dataNode method in Builtin.java. Its javadoc says:

Manifests within location attribute of assign element, for Commons JEXL and 
Commons EL based documents.

So what I get from it, is that dataNode can only be used to assign something 
to a dataNode via assign.

That is not what I want. I want to pass a dataNode including subElements to 
some java object via the cond attribute, so I can write a java method which is 
able to check conditions with use of the passed dataNode.


So: is there a way in which I can pass a dataNode to a java object in the 
context which is used in a cond attribute? Data obviously doesn't work, as I 
can see in the Builtin code that it always is parsed to Double or String.

best regards, Rinke





 On Thursday, October 2, 2014 3:53 AM, R.C. Hoekstra 
 r.c.hoeks...@erasmusmc.nl wrote:

  Hi list, Hi people @ scxml commons,
 
  Can I pass datamodel nodes to a rootContext var, in order to process it in 
  java?
 
  like this:
  target event=bla cond=agent.check(datamodelNodeRef) .../,
  where:
  * agent is an object of a java class made available to the RootContext, 
  having a check method returning Boolean. I want this check method to 
  evaluate the
  datamodelNode, in order to return true or false depending on elements.
  * datamodelNodeRef is a reference to some node in the datamodel.
 
  I managed to pass final nodes as string here, like this:
 
  cs:var name=treatment1Name  
  expr=Data(treatmentData,'treatments/treatment[1]/name') /,
  transition ... cond=agent.check(treament1Name)...
 
  where the treatments/treatment[1]/name is a final node.
 
 
  However, I would like to pass non final nodes of the datamodel, but 
  everything seems to be evaluated as strings first, before it is passed 
  into the method of the context
  var.
 
  Hope you can give me a clue.
 
  And, if these kind of constructions are possible, how would they do in 
  terms of performance?
 
  thanks, Rinke




Re: [scxml] passing datamodel elements into method call

2014-10-08 Thread Ate Douma

On 08-10-14 11:31, R.C. Hoekstra wrote:

Hi Rinke, I think you would get a node if you used DataNode function
instead: cs:var name=treatment1Name
expr=DataNode(treatmentData,'treatments/treatment[1]/name') / Could you
try that?

Regards, Woonsan



Hi Woonsan,

thanks for your answer. But are you sure about that? If I use it like that, I
get an unknown, ambiguous or inaccessible method dataNode error.


Correct, DataNode() is not a function available (registered) within the context 
of the expression evaluator.




I found the dataNode method in Builtin.java. Its javadoc says:

Manifests within location attribute of assign element, for Commons JEXL
and Commons EL based documents.

So what I get from it, is that dataNode can only be used to assign something
to a dataNode via assign.

That is not what I want. I want to pass a dataNode including subElements to
some java object via the cond attribute, so I can write a java method which
is able to check conditions with use of the passed dataNode.


So: is there a way in which I can pass a dataNode to a java object in the
context which is used in a cond attribute? Data obviously doesn't work, as I
can see in the Builtin code that it always is parsed to Double or String.


Not by the SCXML spec, and neither (directly) through Commons SCXML extensions.

However, it should be trivial to add such functionality yourself through a 
custom Action. Then you can access and use the Builtin#dataNode method and do 
whatever you like with a data node element.


For a quick intro in writing a custom Action (for Commons SCXML 2.0), see for 
example slides 12,13 of my presentation at the ApacheCon earlier this year:



http://events.linuxfoundation.org/sites/events/files/slides/ApacheConUS2014%20-%20Apache%20Commons%20SCXML%202.0.pdf 



and I suggest looking at the Commons SCXML Var action as simply example.

HTH, Ate




best regards, Rinke






On Thursday, October 2, 2014 3:53 AM, R.C. Hoekstra
r.c.hoeks...@erasmusmc.nl wrote:



Hi list, Hi people @ scxml commons,

Can I pass datamodel nodes to a rootContext var, in order to process it
in java?

like this: target event=bla cond=agent.check(datamodelNodeRef)
.../, where: * agent is an object of a java class made available to the
RootContext, having a check method returning Boolean. I want this check
method to evaluate the datamodelNode, in order to return true or false
depending on elements. * datamodelNodeRef is a reference to some node in
the datamodel.

I managed to pass final nodes as string here, like this:

cs:var name=treatment1Name
expr=Data(treatmentData,'treatments/treatment[1]/name') /, transition
... cond=agent.check(treament1Name)...

where the treatments/treatment[1]/name is a final node.


However, I would like to pass non final nodes of the datamodel, but
everything seems to be evaluated as strings first, before it is passed
into the method of the context var.

Hope you can give me a clue.

And, if these kind of constructions are possible, how would they do in
terms of performance?

thanks, Rinke






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



Re: [scxml] passing datamodel elements into method call

2014-10-06 Thread Woonsan Ko
Hi Rinke,

I think you would get a node if you used DataNode function instead:

cs:var name=treatment1Name  
expr=DataNode(treatmentData,'treatments/treatment[1]/name') /

Could you try that?

Regards,

Woonsan



On Thursday, October 2, 2014 3:53 AM, R.C. Hoekstra r.c.hoeks...@erasmusmc.nl 
wrote:
 



Hi list, Hi people @ scxml commons,

Can I pass datamodel nodes to a rootContext var, in order to process it in 
java?

like this:
target event=bla cond=agent.check(datamodelNodeRef) .../,
where:
* agent is an object of a java class made available to the RootContext, having 
a check method returning Boolean. I want this check method to evaluate the 
datamodelNode, in order to return true or false depending on elements.
* datamodelNodeRef is a reference to some node in the datamodel.

I managed to pass final nodes as string here, like this:

cs:var name=treatment1Name  
expr=Data(treatmentData,'treatments/treatment[1]/name') /,
transition ... cond=agent.check(treament1Name)...

where the treatments/treatment[1]/name is a final node.


However, I would like to pass non final nodes of the datamodel, but everything 
seems to be evaluated as strings first, before it is passed into the method of 
the context var.

Hope you can give me a clue.

And, if these kind of constructions are possible, how would they do in terms 
of performance?

thanks, Rinke





Re: [SCXML] onentry executable content parallel to further transitions

2014-09-16 Thread Johannes Wienke
Hi,

thanks for the feedback.

I could actually make this work by extending the executor and everything
seems to work fine.

Cheers,
Johannes

On 09/15/2014 04:32 PM, Ate Douma wrote:
 On 11-09-14 11:30, Johannes Wienke wrote:
 On 09/09/2014 04:28 PM, Ate Douma wrote:
 On 08-09-14 18:59, Johannes Wienke wrote:
 On 09/07/2014 10:31 PM, Ate Douma wrote:
 Actually, Commons SCXML already uses an event queue (one for internal
 events and one for external events).
 It is however the responsibility of separate client threads to only
 use
 the executor #addEvent methods and only use a single client thread for
 actual execution and event triggering on the state machine.
 The bug you encountered was in the Commons SCXML *internal*
 delivery of
 events which likewise (now) should use #addEvent but still used the
 #triggerEvent method instead. This should now be fixed.

 Ok, assuming I am always using addEvents to fill the event queue, what
 is the correct pattern for a worker thread that then calls
 triggerEvents()? As far as I can tell from the implementation, this
 method returns immediately in case the queue is currently empty. Hence,
 implementing something like
 while (true) {
   executor.triggerEvents();
 }
 should result in a loop wasting one CPU in case no external events need
 to be processed? This sounds wrong to me.

 I think that is typically what you'll need to do, or else add some
 'eventAdded' notification and coordination yourself (see below).

 Wouldn't it be much nicer from a user perspective if the executor could
 offer something like waitForNextEvents() or
 waitUntilEventsInExternalQueue()? Depending on the use case, this is
 much easier to implement internally than externally.
 
 Yes, that might be possible to add.
 But note that the current implementation isn't 'done' yet and several
 aspects of the current specification with regards to the event IO
 processor [1] aren't
 completely implemented yet.
 That functionally was initially on my plan for milestone 3 in the
 roadmap [2], but I already discovered I need some of this earlier on,
 and I've already started on some further internal refactoring and
 enhancements in this area.
 
 But even when completed, such 'automatic' event coordination and
 execution still should remain an optional feature only to allow for
 other solutions where this coordination better be done within custom and
 domain specific client code.
 
 My goal anyway is to first get the event IO processing in place as
 required by the specification.
 But of course I'm also open for contributions and development support in
 general :)
 
 [1] http://www.w3.org/TR/scxml/#eventioprocessors
 [2]
 http://commons.apache.org/proper/commons-scxml/roadmap.html#Milestone_3:_External_communications_support
 
 

 Moreover, since SimpleScheduler now uses addEvent, too, I cannot even
 know all events that enter the state machine, or am I wrong? So I am
 doomed to implement a busy waiting loop.
 
 Yes, in the current implementation you'll have to coordinate this yourself.
 It should be trivial though to extend the SCXMLExecutor for your purpose
 to get 'notified' about such #addEvent invocations.
 

 The initiating thread creating/owning the executor/engine instance
 likely also should be responsible for managing the statemachine
 execution: instantiating and then starting with go(), continuing with
 triggerEvents(), and if needed resetting through reset().

 Other threads (as well as the 'owner' thread) can/should only add events
 to the queue through addEvent(Event), including threads dispatched from
 the engine itself.

 Only a single owner thread should 'trigger' subsequent engine
 processing.
 You can use executor.hasPendingEvents() to prevent the overhead of a
 trivial amount of CPU cycles, but executor.triggerEvents() with an empty
 queue will only impose a minimal overhead anyway.

 But if I know that there are currently no pending events, then I can't
 do anything else then polling in a busy loop. Either I have to do this
 quite often and just increase CPU load or with a larger sleep statement
 I will add an unwanted delay in processing.
 
 Maybe you can try my suggestion above: extending SCXMLExecutor probably
 will allow for a trivial intermediate solution for this.
 

 Because only the 'owner' thread does (and may do) the actual execution
 of the engine, you're guaranteeing, and protecting (yourself!), no
 concurrent statemachine processing will happen. The (current) executor
 intendedly does NOT enforce this (as you noticed) with synchronization
 blocks or otherwise.

 Ok, got it. Could you please fix up the respective FAQ entry that is at
 least confusing in that respect:
 https://commons.apache.org/proper/commons-scxml/faq.html#many-threads
 
 Done, thanks for pointing this out.
 

 It remains that your owner thread will have to use some timer based
 triggering of the executor, but that is typical when dealing with
 multiple thread coordination/synchronization. Or else you 

Re: [SCXML] onentry executable content parallel to further transitions

2014-09-15 Thread Ate Douma

On 11-09-14 11:30, Johannes Wienke wrote:

Hi,

On 09/09/2014 04:28 PM, Ate Douma wrote:

On 08-09-14 18:59, Johannes Wienke wrote:

On 09/07/2014 10:31 PM, Ate Douma wrote:

Actually, Commons SCXML already uses an event queue (one for internal
events and one for external events).
It is however the responsibility of separate client threads to only use
the executor #addEvent methods and only use a single client thread for
actual execution and event triggering on the state machine.
The bug you encountered was in the Commons SCXML *internal* delivery of
events which likewise (now) should use #addEvent but still used the
#triggerEvent method instead. This should now be fixed.


Ok, assuming I am always using addEvents to fill the event queue, what
is the correct pattern for a worker thread that then calls
triggerEvents()? As far as I can tell from the implementation, this
method returns immediately in case the queue is currently empty. Hence,
implementing something like
while (true) {
  executor.triggerEvents();
}
should result in a loop wasting one CPU in case no external events need
to be processed? This sounds wrong to me.


I think that is typically what you'll need to do, or else add some
'eventAdded' notification and coordination yourself (see below).


Wouldn't it be much nicer from a user perspective if the executor could
offer something like waitForNextEvents() or
waitUntilEventsInExternalQueue()? Depending on the use case, this is
much easier to implement internally than externally.


Yes, that might be possible to add.
But note that the current implementation isn't 'done' yet and several aspects of 
the current specification with regards to the event IO processor [1] aren't

completely implemented yet.
That functionally was initially on my plan for milestone 3 in the roadmap [2], 
but I already discovered I need some of this earlier on, and I've already 
started on some further internal refactoring and enhancements in this area.


But even when completed, such 'automatic' event coordination and execution still 
should remain an optional feature only to allow for other solutions where this 
coordination better be done within custom and domain specific client code.


My goal anyway is to first get the event IO processing in place as required by 
the specification.

But of course I'm also open for contributions and development support in 
general :)

[1] http://www.w3.org/TR/scxml/#eventioprocessors
[2] 
http://commons.apache.org/proper/commons-scxml/roadmap.html#Milestone_3:_External_communications_support




Moreover, since SimpleScheduler now uses addEvent, too, I cannot even
know all events that enter the state machine, or am I wrong? So I am
doomed to implement a busy waiting loop.


Yes, in the current implementation you'll have to coordinate this yourself.
It should be trivial though to extend the SCXMLExecutor for your purpose to get 
'notified' about such #addEvent invocations.





The initiating thread creating/owning the executor/engine instance
likely also should be responsible for managing the statemachine
execution: instantiating and then starting with go(), continuing with
triggerEvents(), and if needed resetting through reset().

Other threads (as well as the 'owner' thread) can/should only add events
to the queue through addEvent(Event), including threads dispatched from
the engine itself.

Only a single owner thread should 'trigger' subsequent engine processing.
You can use executor.hasPendingEvents() to prevent the overhead of a
trivial amount of CPU cycles, but executor.triggerEvents() with an empty
queue will only impose a minimal overhead anyway.


But if I know that there are currently no pending events, then I can't
do anything else then polling in a busy loop. Either I have to do this
quite often and just increase CPU load or with a larger sleep statement
I will add an unwanted delay in processing.


Maybe you can try my suggestion above: extending SCXMLExecutor probably will 
allow for a trivial intermediate solution for this.





Because only the 'owner' thread does (and may do) the actual execution
of the engine, you're guaranteeing, and protecting (yourself!), no
concurrent statemachine processing will happen. The (current) executor
intendedly does NOT enforce this (as you noticed) with synchronization
blocks or otherwise.


Ok, got it. Could you please fix up the respective FAQ entry that is at
least confusing in that respect:
https://commons.apache.org/proper/commons-scxml/faq.html#many-threads


Done, thanks for pointing this out.




It remains that your owner thread will have to use some timer based
triggering of the executor, but that is typical when dealing with
multiple thread coordination/synchronization. Or else you could consider
extending/intercepting the executor to 'notify' your owner thread when
new events are added to the external queue.
But with that you'll enter a domain specific implementation, not easily
generalizable in Commons SCXML (although 

Re: [SCXML] onentry executable content parallel to further transitions

2014-09-11 Thread Johannes Wienke
Hi,

On 09/09/2014 04:28 PM, Ate Douma wrote:
 On 08-09-14 18:59, Johannes Wienke wrote:
 On 09/07/2014 10:31 PM, Ate Douma wrote:
 Actually, Commons SCXML already uses an event queue (one for internal
 events and one for external events).
 It is however the responsibility of separate client threads to only use
 the executor #addEvent methods and only use a single client thread for
 actual execution and event triggering on the state machine.
 The bug you encountered was in the Commons SCXML *internal* delivery of
 events which likewise (now) should use #addEvent but still used the
 #triggerEvent method instead. This should now be fixed.

 Ok, assuming I am always using addEvents to fill the event queue, what
 is the correct pattern for a worker thread that then calls
 triggerEvents()? As far as I can tell from the implementation, this
 method returns immediately in case the queue is currently empty. Hence,
 implementing something like
 while (true) {
  executor.triggerEvents();
 }
 should result in a loop wasting one CPU in case no external events need
 to be processed? This sounds wrong to me.
 
 I think that is typically what you'll need to do, or else add some
 'eventAdded' notification and coordination yourself (see below).

Wouldn't it be much nicer from a user perspective if the executor could
offer something like waitForNextEvents() or
waitUntilEventsInExternalQueue()? Depending on the use case, this is
much easier to implement internally than externally.

Moreover, since SimpleScheduler now uses addEvent, too, I cannot even
know all events that enter the state machine, or am I wrong? So I am
doomed to implement a busy waiting loop.

 The initiating thread creating/owning the executor/engine instance
 likely also should be responsible for managing the statemachine
 execution: instantiating and then starting with go(), continuing with
 triggerEvents(), and if needed resetting through reset().
 
 Other threads (as well as the 'owner' thread) can/should only add events
 to the queue through addEvent(Event), including threads dispatched from
 the engine itself.
 
 Only a single owner thread should 'trigger' subsequent engine processing.
 You can use executor.hasPendingEvents() to prevent the overhead of a
 trivial amount of CPU cycles, but executor.triggerEvents() with an empty
 queue will only impose a minimal overhead anyway.

But if I know that there are currently no pending events, then I can't
do anything else then polling in a busy loop. Either I have to do this
quite often and just increase CPU load or with a larger sleep statement
I will add an unwanted delay in processing.

 Because only the 'owner' thread does (and may do) the actual execution
 of the engine, you're guaranteeing, and protecting (yourself!), no
 concurrent statemachine processing will happen. The (current) executor
 intendedly does NOT enforce this (as you noticed) with synchronization
 blocks or otherwise.

Ok, got it. Could you please fix up the respective FAQ entry that is at
least confusing in that respect:
https://commons.apache.org/proper/commons-scxml/faq.html#many-threads

 It remains that your owner thread will have to use some timer based
 triggering of the executor, but that is typical when dealing with
 multiple thread coordination/synchronization. Or else you could consider
 extending/intercepting the executor to 'notify' your owner thread when
 new events are added to the external queue.
 But with that you'll enter a domain specific implementation, not easily
 generalizable in Commons SCXML (although I'm happy to review patches ;) ).

Is this really domain specific? Something simple as using notify on an
object available to clients whenever new events enter the external queue
would already be sufficient to implement a proper synchronization system
without busy waiting. And this would be a huge improvement several use
cases that I can imagine.

Cheers,
Johannes

-- 
Johannes Wienke, Researcher at CoR-Lab / CITEC, Bielefeld University
Address: Inspiration 1, D-33619 Bielefeld, Germany (Room 1.307)
Phone: +49 521 106-67277



signature.asc
Description: OpenPGP digital signature


Re: [SCXML] onentry executable content parallel to further transitions

2014-09-11 Thread Johannes Wienke
On 09/09/2014 04:31 PM, Ate Douma wrote:
 On 09-09-14 11:20, Johannes Wienke wrote:
 Hi,

 On 09/08/2014 10:07 PM, Martin Gainty wrote:
 StringTokenizer st = new StringTokenizer(event);

 int tkns = st.countTokens();
 TriggerEvent[] evts = new TriggerEvent[tkns];
 for (int i = 0; i  tkns; i++) {
 executor.triggerEvents();


 But then I have to implement a custom logic to restart that loop once
 new events arrive after it finished once. Moreover, this doesn't look
 thread-safe.
 
 Hi Johannes,
 
 Wrong list or did you intend to raise a question about the above?
 The context isn't clear to me and the code example confusing and not
 complete/correct either.

Got this as an answer to my question but it seems that answer did not
end up on the list.

Cheers,
Johannes

-- 
Johannes Wienke, Researcher at CoR-Lab / CITEC, Bielefeld University
Address: Inspiration 1, D-33619 Bielefeld, Germany (Room 1.307)
Phone: +49 521 106-67277



signature.asc
Description: OpenPGP digital signature


Re: [SCXML] onentry executable content parallel to further transitions

2014-09-09 Thread Johannes Wienke
Hi,

On 09/08/2014 10:07 PM, Martin Gainty wrote:
 StringTokenizer st = new StringTokenizer(event); 
 
 int tkns = st.countTokens(); 
 TriggerEvent[] evts = new TriggerEvent[tkns]; 
 for (int i = 0; i  tkns; i++) { 
executor.triggerEvents();
 

But then I have to implement a custom logic to restart that loop once
new events arrive after it finished once. Moreover, this doesn't look
thread-safe.

Cheers,
Johannes

-- 
Johannes Wienke, Researcher at CoR-Lab / CITEC, Bielefeld University
Address: Inspiration 1, D-33619 Bielefeld, Germany (Room 1.307)
Phone: +49 521 106-67277



signature.asc
Description: OpenPGP digital signature


Re: [SCXML] onentry executable content parallel to further transitions

2014-09-09 Thread Ate Douma

On 08-09-14 18:59, Johannes Wienke wrote:

Hi,

thanks for the feedback work on this!

On 09/07/2014 10:31 PM, Ate Douma wrote:

Actually, Commons SCXML already uses an event queue (one for internal
events and one for external events).
It is however the responsibility of separate client threads to only use
the executor #addEvent methods and only use a single client thread for
actual execution and event triggering on the state machine.
The bug you encountered was in the Commons SCXML *internal* delivery of
events which likewise (now) should use #addEvent but still used the
#triggerEvent method instead. This should now be fixed.


Ok, assuming I am always using addEvents to fill the event queue, what
is the correct pattern for a worker thread that then calls
triggerEvents()? As far as I can tell from the implementation, this
method returns immediately in case the queue is currently empty. Hence,
implementing something like
while (true) {
 executor.triggerEvents();
}
should result in a loop wasting one CPU in case no external events need
to be processed? This sounds wrong to me.


I think that is typically what you'll need to do, or else add some 'eventAdded' 
notification and coordination yourself (see below).


The initiating thread creating/owning the executor/engine instance likely also 
should be responsible for managing the statemachine execution: instantiating and 
then starting with go(), continuing with triggerEvents(), and if needed 
resetting through reset().


Other threads (as well as the 'owner' thread) can/should only add events to the 
queue through addEvent(Event), including threads dispatched from the engine itself.


Only a single owner thread should 'trigger' subsequent engine processing.
You can use executor.hasPendingEvents() to prevent the overhead of a trivial 
amount of CPU cycles, but executor.triggerEvents() with an empty queue will only 
impose a minimal overhead anyway.


Because only the 'owner' thread does (and may do) the actual execution of the 
engine, you're guaranteeing, and protecting (yourself!), no concurrent 
statemachine processing will happen. The (current) executor intendedly does NOT 
enforce this (as you noticed) with synchronization blocks or otherwise.


It remains that your owner thread will have to use some timer based triggering 
of the executor, but that is typical when dealing with multiple thread 
coordination/synchronization. Or else you could consider extending/intercepting 
the executor to 'notify' your owner thread when new events are added to the 
external queue.
But with that you'll enter a domain specific implementation, not easily 
generalizable in Commons SCXML (although I'm happy to review patches ;) ).


Regards, Ate



Cheers,
Johannes




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



Re: [SCXML] onentry executable content parallel to further transitions

2014-09-09 Thread Ate Douma

On 09-09-14 11:20, Johannes Wienke wrote:

Hi,

On 09/08/2014 10:07 PM, Martin Gainty wrote:

StringTokenizer st = new StringTokenizer(event);

int tkns = st.countTokens();
TriggerEvent[] evts = new TriggerEvent[tkns];
for (int i = 0; i  tkns; i++) {
executor.triggerEvents();



But then I have to implement a custom logic to restart that loop once
new events arrive after it finished once. Moreover, this doesn't look
thread-safe.


Hi Johannes,

Wrong list or did you intend to raise a question about the above?
The context isn't clear to me and the code example confusing and not 
complete/correct either.


Ate



Cheers,
Johannes




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



Re: [SCXML] onentry executable content parallel to further transitions

2014-09-08 Thread Johannes Wienke
Hi,

thanks for the feedback work on this!

On 09/07/2014 10:31 PM, Ate Douma wrote:
 Actually, Commons SCXML already uses an event queue (one for internal
 events and one for external events).
 It is however the responsibility of separate client threads to only use
 the executor #addEvent methods and only use a single client thread for
 actual execution and event triggering on the state machine.
 The bug you encountered was in the Commons SCXML *internal* delivery of
 events which likewise (now) should use #addEvent but still used the
 #triggerEvent method instead. This should now be fixed.

Ok, assuming I am always using addEvents to fill the event queue, what
is the correct pattern for a worker thread that then calls
triggerEvents()? As far as I can tell from the implementation, this
method returns immediately in case the queue is currently empty. Hence,
implementing something like
while (true) {
executor.triggerEvents();
}
should result in a loop wasting one CPU in case no external events need
to be processed? This sounds wrong to me.

Cheers,
Johannes

-- 
Johannes Wienke, Researcher at CoR-Lab / CITEC, Bielefeld University
Address: Inspiration 1, D-33619 Bielefeld, Germany (Room 1.307)
Phone: +49 521 106-67277



signature.asc
Description: OpenPGP digital signature


Re: [SCXML] onentry executable content parallel to further transitions

2014-09-07 Thread Ate Douma

On 02-09-14 12:58, Johannes Wienke wrote:

Hi,

On 08/29/2014 12:39 PM, Johannes Wienke wrote:

we are currently evaluating commons scxml in the trunk version for our
purposes. On thing that confused us is the fact that transitions from a
state can already occur while that state's onentry executable content is
still processing. Hence, we end up with more parallelism than expected.

Is this the intended behavior?

 From the SCXML specification I actually cannot find anything that either
allows or prevents this interpretation. So I am also curious how this
behavior is justified wrt. to specs.


Following up on this: We have found a statement in the SCXML
specification that disallows the current behavior. In section 4.10 the
specification states:

Note that SCXML treats the executable content triggered by a transition
as a single blocking operation and that no events are processed until
all the executable content has completed. For example, when taking a
transition into state S, the SCXML processor will not process any events
or take any transitions until all onentry handlers in S have finished.

This is definitely not the case right now when using multiple threads to
trigger events.


Hi Johannes,

Please see my comments and fixes for SCXML-206 and SCXML-207.
The problems you were seeing were caused by erroneous and incorrect (internal!) 
concurrent execution of the same state machine instance, which as you correctly 
stated above is not allowed.




 From a design point of view: why do the client threads that trigger
events directly process the whole event transition logic instead of
using an internal event queue and a processing thread as proposed by the
SCXML specification?


Actually, Commons SCXML already uses an event queue (one for internal events and 
one for external events).
It is however the responsibility of separate client threads to only use the 
executor #addEvent methods and only use a single client thread for actual 
execution and event triggering on the state machine.
The bug you encountered was in the Commons SCXML *internal* delivery of events 
which likewise (now) should use #addEvent but still used the #triggerEvent 
method instead. This should now be fixed.


Regards, Ate



Cheers,
Johannes




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



Re: SCXML: context thinks it is in no state at all in onentry of non atomic states.

2014-09-07 Thread Ate Douma

On 02-09-14 23:23, R.C. Hoekstra wrote:

Hi all at scxml.



In my project I found some behavior which I regarded as unexpected, but maybe 
I'm overlooking something. In non-atomic states action execution the engine 
reports to be in no state at all.



I made a test Action class which only does one thing: it prints the result of 
SCXMLExecutor.getStatus().getAllStates() in a listing to StdOut.



Consider the following simple scxml file:



state id=entry

transition event=to.test target=1/

/state



state id=1

onentrymy:printStates//onentry

/state



This shows the following output:

entering entry

exiting entry

my prints 1 state: 1

entering 1



Placing the onentry in an atomic substate like this:



state id=1

state id=1.1

 onentrymy:printStates//onentry

/state

/state



shows the following output:

entering entry

exiting entry

entering 1

 my prints 2 states: 1 and 1.1

entering 1.1





However, placing the onentry in the parent of that atomic substate like this:



state id=1

 onentrymy:printStates//onentry

 state id=1.1 /

/state



gives a result which I hadn't expected:



entering entry

exiting entry

my prints 0 states

entering 1

entering 1.1



Here, the action reports that the engine is in NO STATE AT ALL.

I can see that the action is always executed before the listener reports it's 
onentry (of which I'm not sure if it's weird or not), but nevertheless it always 
reports correctly the states it belongs to. Except when the action is executed on 
a non-atomic state - then it believes to be in 0 states.



This looks to me like inconsistent, and thus a bug, or am I overlooking some 
logic?


Hi Rinke,

This indeed is a bug and the result of how Commons SCXML keeps track of active 
atomic states only, deriving the set of all states from them dynamically.
Clearly in use-cases like yours above this won't be consistent until these 
active atomic states actually have been entered.


I've to think of a proper solution how best to fix this: we might have to track 
both the active and the all states sets in the Status object now.

Which of course will add to its footprint.

If you can create a JIRA issue for it, I'll pick it up from there.

Regards, Ate





Test classes are available at request.



best regards, Rinke




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



Re: [SCXML] onentry executable content parallel to further transitions

2014-09-02 Thread Johannes Wienke
Hi,

On 08/29/2014 12:39 PM, Johannes Wienke wrote:
 we are currently evaluating commons scxml in the trunk version for our
 purposes. On thing that confused us is the fact that transitions from a
 state can already occur while that state's onentry executable content is
 still processing. Hence, we end up with more parallelism than expected.
 
 Is this the intended behavior?
 
 From the SCXML specification I actually cannot find anything that either
 allows or prevents this interpretation. So I am also curious how this
 behavior is justified wrt. to specs.

Following up on this: We have found a statement in the SCXML
specification that disallows the current behavior. In section 4.10 the
specification states:

Note that SCXML treats the executable content triggered by a transition
as a single blocking operation and that no events are processed until
all the executable content has completed. For example, when taking a
transition into state S, the SCXML processor will not process any events
or take any transitions until all onentry handlers in S have finished.

This is definitely not the case right now when using multiple threads to
trigger events.

From a design point of view: why do the client threads that trigger
events directly process the whole event transition logic instead of
using an internal event queue and a processing thread as proposed by the
SCXML specification?

Cheers,
Johannes

-- 
Johannes Wienke, Researcher at CoR-Lab / CITEC, Bielefeld University
Address: Inspiration 1, D-33619 Bielefeld, Germany (Room 1.307)
Phone: +49 521 106-67277



signature.asc
Description: OpenPGP digital signature


Re: [SCXML] onentry executable content parallel to further transitions

2014-09-01 Thread Ate Douma

On 29-08-14 12:39, Johannes Wienke wrote:

Hi,

we are currently evaluating commons scxml in the trunk version for our
purposes. On thing that confused us is the fact that transitions from a
state can already occur while that state's onentry executable content is
still processing. Hence, we end up with more parallelism than expected.

Is this the intended behavior?

 From the SCXML specification I actually cannot find anything that either
allows or prevents this interpretation. So I am also curious how this
behavior is justified wrt. to specs.

Kind regards,
Johannes


Hi Johannes,

Great to see you looking into commons scxml!
I've been away for a while on holiday so sorry for the late feedback on this and 
the other issues you reported. I haven't had time yet to dive into these but 
will look into them shortly.


Regards, Ate



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



Re: [SCXML] onentry executable content parallel to further transitions

2014-09-01 Thread Johannes Wienke
On 09/01/2014 09:23 AM, Ate Douma wrote:
 Great to see you looking into commons scxml!
 I've been away for a while on holiday so sorry for the late feedback on
 this and the other issues you reported. I haven't had time yet to dive
 into these but will look into them shortly.

Great! Thank you very much!

Johannes

-- 
Johannes Wienke, Researcher at CoR-Lab / CITEC, Bielefeld University
Address: Inspiration 1, D-33619 Bielefeld, Germany (Room 1.307)
Phone: +49 521 106-67277



signature.asc
Description: OpenPGP digital signature


Re: [SCXML] mapping of data types used to store values of datamodel with the java datatypes

2014-07-19 Thread Woonsan Ko


 On Wednesday, July 16, 2014 10:02 AM, anshul gangwar 
 anshul.mit20...@gmail.com wrote:
  Hi,
 
 I have one query regarding datatypes used to store values of SCXM datamodel.
 
 Suppose there is a string A = 1234567891. This variable is sent in
 payload when event is fired and is assigned in the SCXML datamodel through
 assign tag.

Is it like assign ... expr='1234567891' / or assign ... expr=1234567891 
/?
The former is handed as a string, but the latter is handled as a number.

 Now when I am fetching this variable A in invoker class, its value is in
 exponential form. So, in order to get the actual value I have perform below
 steps:
 
                 double d =
 Double.parseDouble(String.valueOf(lastParams.get(A)));
                 String deviceId = BigDecimal.valueOf(d).toPlainString();

If it was passed as string, then you could use new 
BigDecimal(lastParams.get(A)).
But, I guess you got a numeric object from lastParams.get(A) instead.

 
 If the value of A does not reach to specific range then it simply convert
 it into float instead of converting it in exponential form.
 
 I would like to know how commons SCXML datatypes are mapped with the java
 datatypes? Is this the right way of doing converting Integer values from
 SCXML?
 Which document can I refer for such details?

Expressions are evaluated by an Evaluator. If you're using JexlEvaluator, then 
you can refer to this:
- http://commons.apache.org/proper/commons-jexl/reference/syntax.html

I think you can treat it as a string with single quotes or as a number with a 
suffix (e.g, 1234567891B or 1234567891.0H).

Regards,

Woonsan

 
 Thanks in advance.
 
 Regards,
 Anshul


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



Re: [scxml] profiling scxml commons

2014-06-18 Thread Ate Douma

On 18-06-14 09:42, R.C. Hoekstra wrote:

Hi all @ scxml commons.

We had some profiling done on our scxml multi agent simulation project. Our 
issue is that scxml is too slow. We need about 100,000 instances of scxml 
engines for a multi agent simulation, and tests show that the approach with 
scxml is over 10 times slower than an alternative but less flexible approach. 
Still, the flexibility of the scxml commons project serves us very well, so we 
need to look for ways to improve the performance.



Great, and already thanks a lot for the valuable feedback and testing.

I think there is definitely room for improvements, and I'd be happy to help out 
and already can take care of some of your suggestions below.


More inline comments below.



For our project setup see my mailing to this list on Fri, 30 May, 20:45.

We have the following tips and improvements:

1) Now, there's a logger applied for each instance, which is inefficient.

Make default Log in SimpleContext static. In 
SCXMLExecutionContext/SCXMLExecutor, it can be static final even.
public class SimpleContext implements Context, Serializable {
/** Implementation independent log category. */
private static final Log DEFAULT_LOG = LogFactory.getLog(Context.class);
private  Log log = DEFAULT_LOG;


Sure, will take care of this.




2)  SimpleContext containsKey() + get() to get()

you can rewrite SimpleContext to:
public Object get(final String name) {
 Object localValue = getVars().get(name);
if (localValue!=null) {
return localValue;
} else if (parent != null) {
return parent.get(name);
} else {
return null;
}
}


+1, also a trivial improvement, thanks.




We think item 1)  2) will lead to a 30-50% improvement in our scenario, and 
they are very simple to apply.


3) Other issues we are not sure about:

- Status.getAllStates can probably be cached: Difficult to determine if this 
can be done since the states member is writable from outside and not sure when 
this getAllStates() cache should be invalidated. But it takes up quite some 
time.
Yeah, I think we can add some caching here, but as you already indicate, the 
underlying states map is writable so it really depends on how often the 
#getAllStates() method is invoked (extra) between updates against the states map 
how much gain you'll receive.

But it is something I'll look into and try to add some caching.



- SCXMLSemanticsImpl.isLegalConfig is probably a paranoia check, can we disable 
it?
It is a paranoia check yes, so if you are sure all your possible statemachine 
transitions will end up legal anyhow, this check could be disabled.

I can add an option to configure this, but will keep it enabled by default.
Of course, you already could customize (extend) the current SCXMLSemanticsImpl 
right now and overwrite this method to do nothing right now.

But adding a configurable option for this is a simply improvement I'm happy to 
add.




4) Some questions about further speed improvements:

4a) scripting:

In the configuration as given, about 10% is spend in JEXL scripting. Depending 
on how much we want to do with that, we could switch to another scripting 
implementation (would require some benchmarking) or maybe move some of the 
scripts into the Java domain.

Do you guys have any clues about which of the provided scripting 
implementations is expected to be the fastest? Are there other possibilities to 
improve the scripting performance?


I suggest trying out and testing the Groovy scripting instead. For *our* 
use-cases it turned out to be faster (about 30%), but it expect it depends on 
the specific evaluations you need to do.
If you try out the Groovy scripting it would be great if you can report back 
your results here.





4b) initializing / common stuff:

What happens now is that each StateMachine engine (SCXMLExecutor) is 
instantiated a thousand times, once for each agent. Maybe it's possible to move 
some of the stuff to some common initialization where it is now done for each 
agent. Do you see any opportunities here?


This'll take some more time to look into.
It's probably possible to restructure the setup a bit to be more optimal for 
your use-case, but I need to think about the consequences for other use-cases as 
well. And take into account other/future functional changes which are still 
needed to bring the Commons SCXML further in line with the specification.


To be honest about this, I haven't had much time the last two months to work on 
Commons SCXML, too busy with other obligations.

But I expect to have more time in a few weeks time.

The easy improvements you proposed above, I will pick up shortly though within 
the coming week or so.


Thank again for the feedback and keep it coming :)

Regards,

Ate



Thanks,
kind regards,

Rinke Hoekstra.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For 

Re: [scxml] Re: our project setup: any tips specifically on performance/speed?

2014-06-07 Thread Woonsan Ko
Hi Rinke,


On Friday, May 30, 2014 4:46 PM, R.C. Hoekstra r.c.hoeks...@erasmusmc.nl 
wrote:




Hi Woonsan, Hi Ate, 

(sorry for the late response)

Woonsan wrote:

 If the estimate of the pure SCXML executions can possibly meet your 
 requirements, then I think
 the next thing to consider might be how to reduce IOs if you have to 
 (de)serialize those instances.
 In one of our projects, we initialize a root context and an executor every 
 time before triggering
 events. So, the SCXML definition is responsible for initializing itself (to 
 move the right
 current state) from the given root context (in script blocks). I think this 
 pattern could
 help reduce the amount of (de)serialized data, and so reduce IO.

We haven't given the (de)serialization lots of attention yet. Of course, 
potentially it can be quite heavy with a few 100.000 of instances, but I don't 
know yet what is exactly needed. 
Your pattern sounds interesting, but can you please point out some link to 
that project, so I can get the real picture clear? 

Ate gave a presentation last April in Denver with Hippo CMS Document Workflow 
use cases and SVN location info (p15):
- 
http://events.linuxfoundation.org/sites/events/files/slides/ApacheConUS2014%20-%20Apache%20Commons%20SCXML%202.0.pdf

You will be able to find 'documentworkflow.scxml' and 
'DocumentWorkflowImpl.java' which always invokes workflowExecutor.start() to 
reset the context and initialize the state without having to store the executor 
or instance.

Regards,

Woonsan



thanks for the response, 

Rinke

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




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



Re: scxml: planning and versions

2014-04-23 Thread Ate Douma

Hi Rinke,

On 19-04-14 22:15, R.C. Hoekstra wrote:

Hi Ate, Woonsan,

thanks for the long answer; sorry for my late reply, I was away for a few
days.

Good to hear you are really interested in our use-case, Ate.

You're asking what specific specification features we will be using now, or
in the near future. To be honest; I don't know yet. At the moment we are
still in the stage of settings things up, and we are exploring all the
possibilities scxml offers to our project.


OK, that is already good to know :)



Because to launch out here about our project features wouldn't fit anymore in
the subject of this thread, I will soon post a subject about our project, and
then maybe you guys can advise us some more on the best features to use.


Great, looking forward to your email.

FYI: I'll be away on a trip the coming 10 days, with little to no connectivity, 
so my feedback might come in only after I return.


Regards, Ate



best regards, Rinke
- To
unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional
commands, e-mail: user-h...@commons.apache.org




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



RE: Re: scxml: planning and versions

2014-04-19 Thread R.C. Hoekstra
Hi Ate, Woonsan, 

thanks for the long answer; sorry for my late reply, I was away for a few days. 

Good to hear you are really interested in our use-case, Ate. 

You're asking what specific specification features we will be using now, or in 
the near future. To be honest; I don't know yet. At the moment we are still in 
the stage of settings things up, and we are exploring all the possibilities 
scxml offers to our project. 

Because to launch out here about our project features wouldn't fit anymore in 
the subject of this thread, I will soon post a subject about our project, and 
then maybe you guys can advise us some more on the best features to use. 

best regards, Rinke
-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: scxml: planning and versions

2014-04-15 Thread Woonsan Ko
Hi Rinke,

Welcome! And that's great to hear about your project!
The roadmap is described here: 
http://commons.apache.org/proper/commons-scxml/roadmap.htmlI would recommend 
you to use 2.0-M1 instead because the milestones (M0 and M1) were actually done 
based on the J6 branch and included proper cleanups and basic alignments to the 
latest specification.

Kind regards,

Woonsan

[1] 
http://mail-archives.apache.org/mod_mbox/commons-dev/201404.mbox/%3c533d4314.40...@douma.nu%3E
 


On Tuesday, April 15, 2014 5:30 AM, R.C. Hoekstra r.c.hoeks...@erasmusmc.nl 
wrote:
 
Hi all @ commons scxml,

We're a university team of scientists working on multi agent simulations of 
tropical diseases for a world health organization project. A disease can be 
considered as a state machine, with the patient going through various states 
and transitions, each triggering new events.

For our project we're diving into commons scxml. However I'm a bit confused 
about what version would be best to use. I'm a bit afraid that the 0.9 
official release is so much outdated that it will not be compatible with the 
coming release, so we would end up with lots of changes to be made when 
updating. On the other hand working on a release which is still under 
development or unstable doesn't seem a good idea.

Is the J6 branch on the svn.apache.org repository a good idea (1.0)?

Can you give some clues in when the first 2.0 release can be expected?

Thanks, Rinke

by the way: thanks for all the good work done. I think it is a great project. 


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




Re: scxml: planning and versions

2014-04-15 Thread Ate Douma

Hi Rinke,

On 15-04-14 11:29, R.C. Hoekstra wrote:

Hi all @ commons scxml,

We're a university team of scientists working on multi agent simulations of
tropical diseases for a world health organization project. A disease can be
considered as a state machine, with the patient going through various states
and transitions, each triggering new events.


Interesting use-case which I definitely like to hear more details about!



For our project we're diving into commons scxml. However I'm a bit confused
about what version would be best to use. I'm a bit afraid that the 0.9
official release is so much outdated that it will not be compatible with the
coming release, so we would end up with lots of changes to be made when
updating. On the other hand working on a release which is still under
development or unstable doesn't seem a good idea.

Is the J6 branch on the svn.apache.org repository a good idea (1.0)?


You better no longer start with the 0.9 release.
It is outdated for sure and no longer actively maintained.
But true enough, the 2.0 development hasn't completely stabilized out either.

The J6 branch won't give you much benefit above the 0.9 release though: it is 
about just as outdated, and neither forwards compatible with the the W3C SCXML 
specification, nor the current 2.0 development in trunk for that matter.


However, the latest milestone tag M1 towards the 2.0 release should give you a 
reasonable stable and reliable basis to start with. So much so that we actually 
are already using it in our product (see [1], slides 14-15 for some background 
on our use-case).
And as Woonsan just emailed and which I'm just repeating here for completeness: 
instructions to get started with the M1 milestone can be found in an earlier 
email I send out to this list [2].


Anyway, it really depends on which of the SCXML specification features you need 
right now, today, or possibly very soon.
As indicated on the roadmap [3], not everything is completely implemented or 
properly aligned with the requirements of the specification yet.
Especially certain aspects around the datamodel handling, external 
communications and specific expression (language) features still needs some 
major changes and improvements.


However, except for some temporarily dropped language features (milestone 0), 
most if not all features available from the 0.9 release still also work in the 
current 2.0 trunk, so from an SCXML semantics perspective you're far better off 
with the latest milestone already.


The real significant changes so far are in the SCXML document model (with 
*added* capabilities, not so much dropped anything other than now being more in 
line with the specification), the processing algorithm, and the internal APIs.


We are aggressively working towards further improving the alignment with the 
specification and I expect a next milestone tag might be possible in a few weeks 
time. This *will* result in additional changes, but mostly in the internal APIs, 
and probably some of the public/external interfaces (SCXMLExecutor etc.).


So, upgrading between milestones will cause some coding impact, but should not 
change the SCXML state machine semantics itself, other than providing more 
support for and alignment to the specification.


What definitely will help speed things up is if others can test drive it and 
provide feedback on what is working or not yet :)


I'm definitely interested to hear more about your team requirements, what 
specific SCXML features you need and how you intend to integrate and execute 
Commons SCXML.
If feasible I might be able to adjust the work planning if it would help you out 
with specific features sooner, if you are willing to test drive and provide 
feedback and/or maybe even directly contribute?


Any help for sure is welcome and much appreciated!



Can you give some clues in when the first 2.0 release can be expected?

That is the toughest question to answer :)

It depends: on the amount of time we can make free to work on this, the amount 
of help and contributions provided, and of course the technical hurdles still to 
solve.
So I cannot give you a precise answer, but personally I think/hope it might be 
doable sometime this summer, or maybe even a bit sooner with the help and 
contributions of others ...


Regards, Ate

[1] 
http://events.linuxfoundation.org/sites/events/files/slides/ApacheConUS2014%20-%20Apache%20Commons%20SCXML%202.0.pdf
[2] 
http://mail-archives.apache.org/mod_mbox/commons-user/201404.mbox/%3C533D4314.40805%40douma.nu%3E

[3] http://commons.apache.org/proper/commons-scxml/roadmap.html



Thanks, Rinke

by the way: thanks for all the good work done. I think it is a great
project.


Thanks, great to hear you like it!




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





Re: SCXML retrieve root context

2014-04-14 Thread Ate Douma

On 12-04-14 21:46, ten...@free.fr wrote:

Thank you for your help Ate, it works very well, I still have a long way to go 
in understanding SCXML..


No problem, I'd be happy to help you out further if you have more questions.

If you haven't seen them yet, the slides of my presentation I gave at the 
ApacheCon last week might also be helpful [1], especially page 9-13.


I'll update the SCXML website sometime soon to provide a direct link to these 
slides as well.


Regards, Ate

[1] 
http://events.linuxfoundation.org/sites/events/files/slides/ApacheConUS2014%20-%20Apache%20Commons%20SCXML%202.0.pdf




Francis,


On 12-04-14 10:28, ten...@free.fr wrote:
Hi,

I would like to know if it's possible to retrieve the rootcontext given during 
the creation of an SCXMLExecutor inside a custon action (i.e. Hello.class 
example).

Yes you can. There isn't a direct API for it but its easy to retrieve the root 
context with:

 @Override
 public void execute(ActionExecutionContext exctx) throws ModelException, 
SCXMLExpressionException {
 Context context = exctx.getGlobalContext();
 while (context.getParent() != null) {
 context = context.getParent();
 }
 // context now references the root context
   ...
 }

The above starts with the global context (the one used and reserved for the 
root/script element) and walks the parent tree up. Currently only the system 
context sits between the root and global context.

HTH, Ate


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




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



Re: [scxml] question on datamodel

2013-03-11 Thread liuhuan123
Hermes replica totes are actually ambrosial in accretion to about apprenticed
that you acquire complete admiring for those who acquire 1. Irrespective of
your breadth activity to, accepting a afflicted by  hermes belt kit women
http://justhermes.net/goods-29-UK-Hermes-Belts-New-Arrivals-86.html  , you
should not all-overs any bootless affliction. Every abandoned afflicted will
be anxiously bogus to accomplish it abide best than it's competitors on the
market. This can be a haversack an abandoned broker by appliance delight. If
you're a sweetheart with out them these these reproductions, that you are
accepting larboard aback with the assets of Hermes. There're below than this
18-carat ones and the identical axial development. Hermes won't discriminate
rolling about in its carriers.



--
View this message in context: 
http://apache-commons.680414.n4.nabble.com/scxml-question-on-datamodel-tp4642836p4647247.html
Sent from the Commons - User mailing list archive at Nabble.com.

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



RE: [scxml] standalone example not working

2012-12-12 Thread Jim Barnett
A bit more detail.  I'm trying to get the StandaloneJexlExpressions example to 
work, as described on the commons website 
(http://commons.apache.org/scxml/guide/testing-standalone.html), specifically:

java -classpath

commons-digester-1.8.1.jar;commons-beanutils-1.8.0.jar;
commons-logging-1.1.1.jar;commons-scxml-0.9.jar;
commons-jexl-1.1.jar

org.apache.commons.scxml.test.StandaloneJexlExpressions  microwave01.xml

When I run this code, I get a missing class def error:

Exception in thread main java.lang.NoClassDefFoundError: 
org/apache/commons/jexl/JexlContext
at 
org.apache.commons.scxml.env.jexl.StandaloneJexlExpressions.main(StandaloneJexlExpressions.java:62)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.jexl.JexlContext
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

The relevant line in StandaloneJexlExpressions.java is the one that 
instantiates the JexlEvaluator:

   Evaluator evaluator = new JexlEvaluator();

The code for the JexlEvaluator class references the JexlContext class, but 
what's puzzling about this error is that it is looking for JexlContext in the 
wrong package.  (JexlContext is in org.apache.commons.scxml.env.jexl, not 
org/apache/commons/jexl.) Furthermore I get the same error even if I a) include 
the org/apache/commons/scxml/env/jexl/JexlContext package in the 
JexlEvaluator.java source file, or b) modify the JexlEvaluator.java code to use 
the correct fully qualified package name for JexlContext (i.e., 
org.apache.commons.scxml.env.jexl.JexlContext).  

So I'm puzzled.  There's obviously something about the package layout that I 
don't understand.  I'd be grateful for any suggestions.  

- Jim

-Original Message-
From: Stadelmann Josef [mailto:josef.stadelm...@axa-winterthur.ch] 
Sent: Wednesday, December 12, 2012 3:47 AM
To: Commons Users List
Subject: AW: [scxml] standalone example not working

sometimes you get help if you tell the community which calls is missing.
for that we would need the stack trace and perhaps a fragment of your source 
code causing the problem.

Josef 


-Ursprüngliche Nachricht-
Von: Jim Barnett [mailto:jim.barn...@genesyslab.com]
Gesendet: Dienstag, 11. Dezember 2012 14:35
An: user@commons.apache.org
Betreff: [scxml] standalone example not working

Has anyone gotten the StandaloneJexlExpressions example to work?  When I run 
it, I get a missing class error.   Any guidance would be appreciated.

thanks


-  Jim

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



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



RE: [scxml] update data model

2012-12-12 Thread Jim Barnett
Use the 'delay' attribute on send to create a timer.  Then add an event 
handler/transition that catches the delayed event and updates the data model 
(using the executable content that is a child  of transition).

- Jim

-Original Message-
From: Riccardo Manoni [mailto:arduinowifishi...@gmail.com] 
Sent: Wednesday, December 12, 2012 12:00 PM
To: user@commons.apache.org
Subject: [scxml] update data model

Hi all,

i'm new to scxml so here i am with a (maybe dumb..) question: is it possible to 
update the datamodel or raise an event from a java method? For example, in 
the StopWatch use case, can i force the life cycle to go in reset state when 
10sec elapsed?

My intention is let the data model knows about the time elapsed since the 
start, so i think i need a way to communicate the seconds elapsed to the data 
model... Can someone point me in the right direction? Thanks.

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



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



RE: [SCXML] update data model

2012-12-12 Thread Jim Barnett
Do you have a command line version of the product working?  I have been trying 
to get the StandaloneJexlExpressions example to work.  If someone can help me 
with that, I'll take a look at why 'delay' isn't working.

- Jim

-Original Message-
From: Riccardo Manoni [mailto:arduinowifishi...@gmail.com] 
Sent: Wednesday, December 12, 2012 5:28 PM
To: user@commons.apache.org
Subject: RE: [SCXML] update data model

Removing the delay, the send work. The state change immediatly from 
paused to stopped. So now we know that the problem is the delay.
Any help will be greatly appreciated.

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



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



Re: [SCXML] updte data model

2012-12-12 Thread Riccardo Manoni
[News]
I'm here again to say you that now i understoond how to get/set datamodel from 
java method (the main question), so the last unanswered question now is why the 
delay tag don't work to me.


Il giorno 13/dic/2012, alle ore 01:16, Riccardo Manoni ha scritto:

 Unfortunately i don't know what you need to run my work with command line. If 
 needed, this is my complete scxml doc:
 
 ?xml version=1.0?
 scxml xmlns=http://www.w3.org/2005/07/scxml;
version=1.0
initialstate=reset
 
 datamodel
 data id=time expr=1/
 /datamodel
 
 state id=reset
 onentry
 log label=entered on reset expr='xXx'/
 assign name=time expr=0/
 /onentry
 transition event=watch.start   target=running/
 onexit
 log label=time is expr=time/
 log label=exited from reset expr='xXx'/
 /onexit
 /state
 
 state id=running
 onentry
 log label=entered on running expr='xXx'/log
 /onentry
 transition event=watch.split   target=paused
 send event='watch.stop' delay='2s'/
 
 /transition
 transition event=watch.stoptarget=stopped/
 onexit
 log label=exited from running expr='xXx'/log
 /onexit
 /state
 
 state id=paused
 onentry
 log label=entered on paused expr='xXx'/log
 /onentry
 transition event=watch.unsplit target=running/
 transition event=watch.stoptarget=stopped/
 onexit
 log label=exited from paused expr='xXx'/log
 /onexit
 /state
 
 state id=stopped
 onentry
 log label=entered on stopped expr='xXx'/log
 /onentry
 transition event=watch.reset   target=reset/
 onexit
 log label=exited from stopped expr='xXx'/log
 /onexit
 /state
 
 /scxml
 
 
 
 
 
 -
 
 Do you have a command line version of the product working?  I have been 
 trying to get the StandaloneJexlExpressions
 example to work.  If someone can help me with that, I'll take a look at why 
 'delay' isn't
 working.
 
 - Jim
 
 -Original Message-
 From: Riccardo Manoni [mailto:arduinowifishi...@gmail.com] 
 Sent: Wednesday, December 12, 2012 5:28 PM
 To: user@commons.apache.org
 Subject: RE: [SCXML] update data model
 
 Removing the delay, the send work. The state change immediatly from 
 paused to stopped.
 So now we know that the problem is the delay.
 Any help will be greatly appreciated.
 



Re: [scxml] question on datamodel

2012-12-03 Thread Jacob Beard
Hi Francesco,

The example you describe looks like the special timeout event described
by Harel in his original papers on Statechart semantics:
http://research.microsoft.com/apps/pubs/default.aspx?id=148785
http://dl.acm.org/citation.cfm?id=235322

If so, this event can be implemented in SCXML as a transformation, as in
the following example: https://gist.github.com/4195449

In this example, on entering state a, the event $timeout_1 is scheduled
to be sent after 1 second. If the state is exited before that time, the
scheduled event will be cancelled via the cancel action. If the machine
stays in state a, and after 1 second the event is sent, then the
transition in state a with event $transition_1 will be selected, and
the machine will leave state a and enter state b.

This transformation can be implemented easily in a language like XSLT.
Therefore, SCXML should be able to handle your example out of the box. Does
your application have other, more complex requirements for transition
conditions?

Jake

On Mon, Dec 3, 2012 at 9:30 AM, Francesco Spegni francesco.spe...@gmail.com
 wrote:

 The first problem we are trying to solve is: how to extend the definition
 of Transition to accept custom XML nodes to be interpreted as complex
 conditions? E.g. we would like to express something as:

 scxml 
 xmlns=http://www.w3.org/2005/**07/scxmlhttp://www.w3.org/2005/07/scxml
 
version=1.0
initialstate=a
datamodel=xmlns:cc=someurl 

 state id=a
 transition target=b cond=cc:eval(//condition) 
 cc:condition
 time exp=clock  1 sec /
 /cc:condition
 /transition
 /state

 state id=b final=true

 /state
 /scxml



Re: [scxml] ANN: SCION-Java project

2012-07-20 Thread Jacob Beard
Hi,

I just wanted to quickly follow up on this, as looks like the page hasn't
been updated yet. Thanks,

Jake

On Mon, Jun 11, 2012 at 10:56 PM, Jacob Beard jbea...@cs.mcgill.ca wrote:

 Hi,

 I opened a task in JIRA to update the SCXML Commons home page, and
 provided a patch, here:
 https://issues.apache.org/jira/browse/SCXML-166

 Thanks,

 Jake

 On Thu, May 31, 2012 at 9:45 AM, Jacob Beard jbea...@cs.mcgill.ca wrote:
  Will do. Thanks,
 
  Jake
 
  On Thu, May 31, 2012 at 9:31 AM, Rahul Akolkar rahul.akol...@gmail.com
 wrote:
  If you want to provide a patch to the Commons SCXML home page source
  via JIRA, we could add this to the Related Projects section [1].
 
  -Rahul
 
  [1] http://commons.apache.org/scxml/#Related_Projects
 
 
  On Wed, May 30, 2012 at 5:36 PM, Jacob Beard jbea...@cs.mcgill.ca
 wrote:
  Hi,
 
  While not specifically related to SCXML Commons, I wanted to draw your
  attention to a new SCXML-related project I have just released called
  SCION-Java [0]. SCION is an implementation of SCXML in JavaScript [1],
  and SCION-Java provides lightweight bindings to the SCION library for
  Java. Some advantages of SCION-Java are:
 
  * liberally licensed (Apache 2)
  * extremely simple Java API (just one class)
  * well-tested, using the SCXML Test Framework [2]
  * supports scripting with ECMAScript out of the box
 
  The Java API is not quite complete yet, as I still need to allow
  registering state change listeners from Java.
 
  If you have any questions or comments, please do not hesitate to
  contact me. Thanks,
 
  Jake
 
 
  [0] https://github.com/jbeard4/SCION-Java
  [1] https://github.com/jbeard4/SCION
  [2] https://github.com/jbeard4/scxml-test-framework
 
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
  For additional commands, e-mail: user-h...@commons.apache.org
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
  For additional commands, e-mail: user-h...@commons.apache.org
 



Re: [scxml] JEXL Evaluator's evalCond issue

2012-06-16 Thread Rahul Akolkar
On Thu, Jun 14, 2012 at 5:23 PM,  sgu...@osc.state.ny.us wrote:
 1. Problem renaming method in class used for condition evaluation.

 Class: Test
 method: boolean method1(integer i)

 xml snippet:

 state id=DELETE_STATE
            transition event=delete target=STATUS_UNKNOWN
 cond=test.method1(100)/
 /state


 We are trying rename test.method1(integer i) in Test class to
 test.methodRenamed(integer i)

 and update xml to:

 state id=DELETE_STATE
            transition event=delete target=STATUS_UNKNOWN
 cond=test.methodRenamed(100)/
 /state

 Executing SCXML after the above change, test.methodRenamed(100) is not
 invoked and no information in logs are seen nor any exception seen in the
 trace.

 Note: Putting back to the old method name (test.method1(100)) works as
 expected.

snip/

It isn't clear how you are testing the changes once you update the
Test class. From the description, it doesn't look like the new Test
class is loaded. I don't think this is related to Commons SCXML (i.e.
the library code).



 2. Problem adding a new method (test.methodNew(200)).

 Class: Test
 methods: boolean method1(Integer i)
                  boolean methodNew(Integer i)

 transition event=delete target=STATUS_UNKNOWN cond=test.method1(100)
 amp;amp; test.methodNew(200)/


 Executing SCXML:

 1. test.method1(100) was invoked and returned true.

 2. test.methodNew(200) was never invoked

 3. JexlEvaluator's method evalCond line
 exp.evaluate(getEffectiveContext(jexlCtx)) returns false.

 Note: Adding a non existent method or junk string to the xml's cond
 attribute doesn't yield any failure information and JexlEvaluator simply
 returns false .

snap/

Same comment as above. Additionally, boolean expressions are assumed
to be false unless they successfully evaluate to true.


 Versions used: commons-scxml-0.9.jar, commons-jexl.1.1.jar

 The issue seems to be a JEXL issue, however upgrading to the latest JEXL 2
 version is not feasible due to compilation issues.

 Is there/will there be a version of SCXML that is compatible with a later
 version of JEXCL? (ie: JEXL2)

snip/

You can try the Evaluator implementation attached here [1] (which is
not released code) or provide your own evaluator implementation [2]
for this.

-Rahul

[1] https://issues.apache.org/jira/browse/SCXML-114
[2] http://commons.apache.org/scxml/guide/contexts-evaluators.html



 Thanks  Regards
 Satish Gutta



 Notice: This communication, including any attachments, is intended solely
 for the use of the individual or entity to which it is addressed. This
 communication may contain information that is protected from disclosure
 under State and/or Federal law. Please notify the sender immediately if
 you have received this communication in error and delete this email from
 your system. If you are not the intended recipient, you are requested not
 to disclose, copy, distribute or take any action in reliance on the
 contents of this information.

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



Re: [scxml] ANN: SCION-Java project

2012-06-11 Thread Jacob Beard
Hi,

I opened a task in JIRA to update the SCXML Commons home page, and
provided a patch, here:
https://issues.apache.org/jira/browse/SCXML-166

Thanks,

Jake

On Thu, May 31, 2012 at 9:45 AM, Jacob Beard jbea...@cs.mcgill.ca wrote:
 Will do. Thanks,

 Jake

 On Thu, May 31, 2012 at 9:31 AM, Rahul Akolkar rahul.akol...@gmail.com 
 wrote:
 If you want to provide a patch to the Commons SCXML home page source
 via JIRA, we could add this to the Related Projects section [1].

 -Rahul

 [1] http://commons.apache.org/scxml/#Related_Projects


 On Wed, May 30, 2012 at 5:36 PM, Jacob Beard jbea...@cs.mcgill.ca wrote:
 Hi,

 While not specifically related to SCXML Commons, I wanted to draw your
 attention to a new SCXML-related project I have just released called
 SCION-Java [0]. SCION is an implementation of SCXML in JavaScript [1],
 and SCION-Java provides lightweight bindings to the SCION library for
 Java. Some advantages of SCION-Java are:

 * liberally licensed (Apache 2)
 * extremely simple Java API (just one class)
 * well-tested, using the SCXML Test Framework [2]
 * supports scripting with ECMAScript out of the box

 The Java API is not quite complete yet, as I still need to allow
 registering state change listeners from Java.

 If you have any questions or comments, please do not hesitate to
 contact me. Thanks,

 Jake


 [0] https://github.com/jbeard4/SCION-Java
 [1] https://github.com/jbeard4/SCION
 [2] https://github.com/jbeard4/scxml-test-framework

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


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


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



Re: [scxml] ANN: SCION-Java project

2012-05-31 Thread Jacob Beard
Will do. Thanks,

Jake

On Thu, May 31, 2012 at 9:31 AM, Rahul Akolkar rahul.akol...@gmail.com wrote:
 If you want to provide a patch to the Commons SCXML home page source
 via JIRA, we could add this to the Related Projects section [1].

 -Rahul

 [1] http://commons.apache.org/scxml/#Related_Projects


 On Wed, May 30, 2012 at 5:36 PM, Jacob Beard jbea...@cs.mcgill.ca wrote:
 Hi,

 While not specifically related to SCXML Commons, I wanted to draw your
 attention to a new SCXML-related project I have just released called
 SCION-Java [0]. SCION is an implementation of SCXML in JavaScript [1],
 and SCION-Java provides lightweight bindings to the SCION library for
 Java. Some advantages of SCION-Java are:

 * liberally licensed (Apache 2)
 * extremely simple Java API (just one class)
 * well-tested, using the SCXML Test Framework [2]
 * supports scripting with ECMAScript out of the box

 The Java API is not quite complete yet, as I still need to allow
 registering state change listeners from Java.

 If you have any questions or comments, please do not hesitate to
 contact me. Thanks,

 Jake


 [0] https://github.com/jbeard4/SCION-Java
 [1] https://github.com/jbeard4/SCION
 [2] https://github.com/jbeard4/scxml-test-framework

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


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


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



Re: [scxml] there is a working example?

2012-05-23 Thread Rahul Akolkar
On Mon, May 21, 2012 at 6:55 PM, Jacob Beard jbea...@cs.mcgill.ca wrote:
 Regarding project status, see this thread posted last week:
 http://mail-archives.apache.org/mod_mbox/commons-dev/201205.mbox/browser

snip/

Or this link:

  http://markmail.org/message/wu5rfl25fxjyn7tb

-Rahul


 Jake

 On Mon, May 21, 2012 at 5:15 PM, Alessandro Scarozza
 xan.sc...@gmail.com wrote:
 first of all, THZ

 last stable release are 0.9
 there is also 0.10 and 1.0
 whis is the more feature version?

 second question: this project are alive? there is anyone that commit
 for commons SCXML?

 bye


snap/

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



Re: [scxml]

2012-05-23 Thread Rahul Akolkar
On Wed, May 23, 2012 at 2:01 AM, Ronald Hinchley commu...@gmail.com wrote:
 I notice that none of the examples or cases work. W3C Working Draft 16
 February 2012. SCXML seems heavenly to me but is there interest in it?
snip/

I believe you're asking about the Commons SCXML project, rather than
the W3C SCXML standard itself. See this recent thread:

  http://markmail.org/message/wu5rfl25fxjyn7tb

-Rahul

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



Re: [scxml] there is a working example?

2012-05-21 Thread Alessandro Scarozza
I explain better my problem, actually we use scxml like this:

?xml version=1.0 encoding=UTF-8?
scxml xmlns=http://www.w3.org/2005/07/scxml; version=1.0
exmode=lax initialstate=initialstate
datamodel
data id=one$value0/data
/datamodel
state id=one
transition event=alfa cond= _eventdata.getone$value() ==  
0 target=two
assign location=one$value 
expr=_eventdata.setone$value(1) /
/transition
/state
/scxml

there is a way to access to one$value directly? without call java
method?? EL?? if yes, anyone can give me help??

thz

2012/5/20 Alessandro Scarozza xan.sc...@gmail.com:
 hi to all,

 i need a full working example for SCXML, in particular with evalutator
 online i just find stopwatch, but i need a more complex example (xml and java)

 anyone can help me?


 thz



 --
 Alessandro Scarozza
 http://www.google.com/profiles/xan.scale



-- 
Alessandro Scarozza
http://www.google.com/profiles/xan.scale

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



Re: [scxml] there is a working example?

2012-05-21 Thread Jacob Beard
I haven't used SCXML Commons for this, but it seems like the SCXML
specification would lead you to something like the following (untested)
code:

?xml version=1.0 encoding=UTF-8?
scxml xmlns=http://www.w3.org/2005/07/scxml; version=1.0 exmode=lax
  datamodel
  data id=oneValue expr=0/data
  /datamodel
  state id=one
  transition event=alfa cond= oneValue ===  0 target=two
  assign location=oneValue
expr=_event.data.oneValue /
  /transition
  /state
  state id=two/
/scxml

Jake

On Mon, May 21, 2012 at 12:25 PM, Alessandro Scarozza xan.sc...@gmail.com
wrote:
 I explain better my problem, actually we use scxml like this:

 ?xml version=1.0 encoding=UTF-8?
 scxml xmlns=http://www.w3.org/2005/07/scxml; version=1.0
 exmode=lax initialstate=initialstate
datamodel
data id=one$value0/data
/datamodel
state id=one
transition event=alfa cond= _eventdata.getone$value()
==  0 target=two
assign location=one$value
expr=_eventdata.setone$value(1) /
/transition
/state
 /scxml

 there is a way to access to one$value directly? without call java
 method?? EL?? if yes, anyone can give me help??

 thz

 2012/5/20 Alessandro Scarozza xan.sc...@gmail.com:
 hi to all,

 i need a full working example for SCXML, in particular with evalutator
 online i just find stopwatch, but i need a more complex example (xml and
java)

 anyone can help me?


 thz



 --
 Alessandro Scarozza
 http://www.google.com/profiles/xan.scale



 --
 Alessandro Scarozza
 http://www.google.com/profiles/xan.scale

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



Re: [scxml] there is a working example?

2012-05-21 Thread Alessandro Scarozza
YES i need this

to make this code working i need to integrate EL? o not? if yes, how i
can do it?
if i use that code in my java application, it doesent works!!

th


2012/5/21 Jacob Beard jbea...@cs.mcgill.ca:
 I haven't used SCXML Commons for this, but it seems like the SCXML
 specification would lead you to something like the following (untested)
 code:

 ?xml version=1.0 encoding=UTF-8?
 scxml xmlns=http://www.w3.org/2005/07/scxml; version=1.0 exmode=lax
      datamodel
              data id=oneValue expr=0/data
      /datamodel
      state id=one
              transition event=alfa cond= oneValue ===  0 target=two
                      assign location=oneValue
 expr=_event.data.oneValue /
              /transition
      /state
      state id=two/
 /scxml

 Jake

 On Mon, May 21, 2012 at 12:25 PM, Alessandro Scarozza xan.sc...@gmail.com
 wrote:
 I explain better my problem, actually we use scxml like this:

 ?xml version=1.0 encoding=UTF-8?
 scxml xmlns=http://www.w3.org/2005/07/scxml; version=1.0
 exmode=lax initialstate=initialstate
        datamodel
                data id=one$value0/data
        /datamodel
        state id=one
                transition event=alfa cond= _eventdata.getone$value()
 ==  0 target=two
                        assign location=one$value
 expr=_eventdata.setone$value(1) /
                /transition
        /state
 /scxml

 there is a way to access to one$value directly? without call java
 method?? EL?? if yes, anyone can give me help??

 thz

 2012/5/20 Alessandro Scarozza xan.sc...@gmail.com:
 hi to all,

 i need a full working example for SCXML, in particular with evalutator
 online i just find stopwatch, but i need a more complex example (xml and
 java)

 anyone can help me?


 thz



 --
 Alessandro Scarozza
 http://www.google.com/profiles/xan.scale



 --
 Alessandro Scarozza
 http://www.google.com/profiles/xan.scale

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




-- 
Alessandro Scarozza
http://www.google.com/profiles/xan.scale

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



Re: [SCXML] custom tags

2011-10-24 Thread Micka
Hi,


I also really like customActions.

But right Now, i'm trying to figure out how to use ExternalContent .

The document say that I have to implements it, but  I really don't
understand how to use it, I mean i get :


class myclass extends Action implements ExternalContent
 .
.
..
@Override
public List getExternalNodes() {

return null;
}
}


thx,

On Mon, Dec 13, 2010 at 9:28 AM, jocke eriksson jock...@gmail.com wrote:

 Hej jonathan I have done a telephony state machine, and commons scxml
 was a perfect choice for handling the logic. Custom actions and custom
 tags are the same thing.

 register your action like this.
 ListCustomAction actions 
 actions.add(new CustomAction(NAME_SPACE, menu, MenuAction.class));
 SCXMLParser.parse(document, errHandler, actions);

 And menu action is a class that have getters and setters for choices
 maxtime and value.

 ms:menu choices='123  maxtime=30s value=main-menu.wav' /

 If you need anymore help don't be afraid to ask

 Regards Jocke

 2010/12/13 jonathan augenstine jaugenst...@gmail.com:
  I am investigating using the SCXML to implement a telephony state
 machine.
   I need to be able to add custom tags and actions.  I see examples of
 adding
  custom actions, but no examples of adding custom tags.  Can someone point
 me
  in the direction of how to accomplish that task?
 
  Jonathan
 

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




Re: [SCXML] Ignoring raise element

2011-10-17 Thread Rahul Akolkar
On Mon, Oct 17, 2011 at 8:43 AM, Dark.Rider85 dark.ride...@yahoo.de wrote:
 Hi!
 I wanted to use the raise element but when parsing the .xml file the
 processor says the following warning:

 Ignoring element raise in namespace http://www.w3.org/2005/07/scxml; at
 bundleresource:***.xml:9:38 and digester match
 scxml/state/state/onentry/raise

 What is the meaning of that warning? And how do I solve the problem?
snip/

The raise action wasn't implemented then. You can use send without
a target or type for the same effect below.

-Rahul


 Here is an extract of my xml file:

 ...
 state id=State1 initial=SubState1_1
 state id=SubState1_1
 transition event=event.SubState1_2 target=SubState1_2/
 onentry
 my:customSay id=Hello SubState1_2!/
 raise event=event.SubState1_2/
 /onentry
 /state
 state id=SubState1_2
 transition event=event.SubState1_3 target=SubState1_3/
 onentry
 my:customSay id=Hello SubState1_3!/
 raise event=event.SubState1_3/
 /onentry
 /state
 /state
 ...

 Thanks in advance!

 Best regards


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



  1   2   3   4   5   >