Thanks Rahul,
I've changed the in the way you told me and the warning disappeared, but it
didn't work in the way I needed, so I've changed the implementation to do it in
a custom action in the onentry tag. The custom Action does the work fine, but
at
the end I need to raise a "next event" to the queue but it's not working. I try
to raise the event with eventDispatcher.send method but it's not lauching that
event. I know it's not launchiung because I have a SCXMLListener with a onentry
method wich is executed after the custom action and I can see in debug mode the
states where the the flow goes.
Here is the code I'm using. I've tried also to set target and type to null, but
it happens the same.
any idea?
thanks.
public class Skip extends Action {
@Override
public void execute(EventDispatcher eventDispatcher, ErrorReporter
errorReporter,
SCInstance scInstance, Log log, Collection derivedEvents) throws
ModelException,
SCXMLExpressionException {
//some checks and if I want to skip this state I add in the String
event
//variable the name of the event
...
if(event != null){
//I want to raise the event
String sendId = null;
String target = "#_internal";
String type = "scxml";
Map params = null;
Object hints = null;
long delay = 0;
List externalNodes = null;
eventDispatcher.send(sendId , target, type, event, params,
hints, delay, externalNodes);
}
}
}
________________________________
De: Rahul Akolkar <[email protected]>
Para: Commons Users List <[email protected]>
Enviado: jue,26 mayo, 2011 15:31
Asunto: Re: [scxml] Problem raising event in scxml
On Thu, May 26, 2011 at 7:55 AM, J J <[email protected]> wrote:
> Hello,
>
>
> I'm having an issue with the <raise> tag inside an <if> element in the
><onentry>
> content.
>
> The problem is explained more in this Stackoverflow question:
> http://stackoverflow.com/questions/6044370/problem-raising-event-in-scxml
>
> Can anyone tell me what may be the problem?
>
<snip/>
As the warning message indicates, <raise> is not implemented yet,
neither is _event (previously, a subset was _eventdata, which is
implemented). You can use <send> with no target or type to achieve the
same (basically change the element name in that snippet to be send).
You may open enhancement requests for anything that isn't implemented
yet from the latest draft [1].
-Rahul
[1] http://commons.apache.org/scxml/issue-tracking.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]