bildwelt
E2E FORUM
E2E Bridge E2E Commerce

Reply To: OnUnhandled signal: Access property of the original signal

E2E Forum Modeling & Development OnUnhandled signal: Access property of the original signal Reply To: OnUnhandled signal: Access property of the original signal

#476

Alfred
Moderator

Another solution for your problem is that you define a second default handler with your concrete signal type as first parameter. This signal handler will be called instead of the more general signal handler with signal type AnySignal. In this case you do not need a cast. You can look at the attached model.

On the other hand the casting works for me.

`
log(“Info”, “Signal”, “Type”, signal.typeOf());
log(“Info”, “Signal”, “Content”, signal.classToXML().transcodeToString(“utf-8”));
log(“Info”, “Event”, “Content”, event.classToXML().transcodeToString(“utf-8”));
set mysignal = cast(signal);
log(“Info”, “Signal”, “Payload”, mysignal.payload);
`

The model is attached. The default signal handler is called if you create the object and then send the signal step1 twice.

If you send a signal which is not used in the state diagram then the default signal handler is not called. You can test this with error or restart. The reason for this is that the model compiler generates for each used signal an entry for the E2E Runtime.