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] 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:  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  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 .

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
 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: , 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:

, 







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



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

2014-10-26 Thread Ate Douma

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 
 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  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-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] 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: JCS Cache behaviour question

2014-10-26 Thread Thomas Vandahl
On 24.10.14 00:48, arnout cator wrote:
> Can someone tell me how JCS works to show Auxiliary hits and no data
> file size nor key size, considering my setup? 

JCS keeps the disk cache files open during operation. So depending on
your operating system, you may not see updates of the directory entries
of these files. If you shut down JCS properly, the files will be closed
and the size should reflect the actual content.

Bye, Thomas.


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