You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Cook, Dennis" <de...@terayon.com> on 2007/09/05 03:00:24 UTC

[SCXML] questions on event ids and finalize

I have a few questions

 

1.	The spec indicates that an invoked service must return a
''id.Done' event , (where the 'id' is the id for this invocation).  But
I noticed the SimpleSCXMLInvoker is returing a "id.invoke.done" event
when done and a "id.invoke.cancel.response" event in response to the
cancel.  The spec indicates that format as TBD.  So what is the proper
format for the done event.  Is it "id.Done" as spec'ed or
"id.invoked.done" as the SimpleSCXMLInvoker uses?
2.	I cannot figure out how to get a <finalize> block to execute any
content.  I have tried a <log> entry, but it never seems to be executed.
I  found a test case org.apache.commons.scxml.invoke.InvokeTest.java
which also includes a <final> element.  This is not getting executed
either.  Is this a known bug?

 

Dennis Cook

Motorola - Home & Network Mobility

Sr. Staff Software Engineer

(o) (408) 235-5874

(c) (408) 515-4799

 

NOTICE: This communication contains information which may be proprietary, privileged or confidential.  If you are not the intended recipient (or authorized to receive for the intended recipient), or believe that you have received this communication in error, please do not print, copy, retransmit, disseminate, disclose or otherwise use the information.  Also, please indicate to the sender that you have received this communication in error and delete the copy you received.  Thank you.

Re: [SCXML] questions on event ids and finalize

Posted by Rahul Akolkar <ra...@gmail.com>.
On 9/4/07, Cook, Dennis <de...@terayon.com> wrote:
> I have a few questions
>
>
>
> 1.      The spec indicates that an invoked service must return a
> ''id.Done' event , (where the 'id' is the id for this invocation).  But
> I noticed the SimpleSCXMLInvoker is returing a "id.invoke.done" event
> when done and a "id.invoke.cancel.response" event in response to the
> cancel.  The spec indicates that format as TBD.  So what is the proper
> format for the done event.  Is it "id.Done" as spec'ed or
> "id.invoked.done" as the SimpleSCXMLInvoker uses?
<snip/>

We won't know until the spec has the TBD there. But IMO, it clearly
shouldn't be "id.done" since that already has a (different) meaning --
in particular, it indicates that a final substate has been reached for
a composite state. Therefore, "id.invoke.done" was used in the Commons
implementation (and it is subject to change based on spec changes).


> 2.      I cannot figure out how to get a <finalize> block to execute any
> content.  I have tried a <log> entry, but it never seems to be executed.
> I  found a test case org.apache.commons.scxml.invoke.InvokeTest.java
> which also includes a <final> element.  This is not getting executed
> either.  Is this a known bug?
>
<snap/>

Thanks for taking time to look at the test cases, it makes the
discussion easier. The particular test case you mention
[testInvoke01Sample() in the file above] is a bit incomplete in terms
of <finalize> (it is complete in terms of what its testing -- which is
ensuring the context of the invoked state machine is populated
correctly). In order to execute the <finalize> block, the invoked
state machine needs to run to completion. That can be done by adding
the following line as the last statement of the try block:

 SCXMLTestHelper.fireEvent(exec, "invoked.next");

This will drive the invoked state machine (invoked-01.xml) to
completion, cause the <finalize> to execute, the corresponding
"id.invoke.done" event to be triggered and the gating transition to be
followed to the "end" state.

-Rahul


>
>
> Dennis Cook
>
> Motorola - Home & Network Mobility
>
> Sr. Staff Software Engineer
>
> (o) (408) 235-5874
>
> (c) (408) 515-4799
>
>

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