[SCXML] How to obtain a collection of valid events

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[SCXML] How to obtain a collection of valid events

Mansour Al Akeel
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Woonsan Ko-3
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
<[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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 <[hidden email]> 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
> <[hidden email]> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Woonsan Ko-3
On Fri, May 20, 2016 at 9:36 PM, Mansour Al Akeel
<[hidden email]> 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 <[hidden email]> 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
>> <[hidden email]> 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: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]