-
Notifications
You must be signed in to change notification settings - Fork 58
Description
Maybe someone can help who uses statemachines generated by uscxml-transform, I am playing with what was published here. If you look at the scxml statemachine he lists line 25/26 he defines a transition with a cond element accessing _event->data.
If you look at the dequeueExternal method he defines:
static void* dequeueExternal(const uscxml_ctx* ctx) { ...}
_event gets set to NULL.
BUT The statemachine invokes first dequeueExternal before it does the transition handling
if (ctx->dequeue_external != NULL && (ctx->event = ctx->dequeue_external(ctx)) != NULL) {
goto SELECT_TRANSITIONS;
}
Thus when
SCXML_GET_TRANS(i).is_enabled(ctx, &USCXML_GET_TRANS(i)) > 0)) is called in the transition handling which does the actual evaluation of the cond e.g. _event->data.light > LIGHT_THRES it will fail because_event was just set to NULL.
That being said the example he posts actually does not work. So, what is the proper way to access _event->data or _event->name inside a transition condition? Or what is the proper way of defining dequeueExternal/dequeueInternal?
Any help would be appreciated a lot!
Thanks!