jbeard4 / SCION

SCXML/Statecharts in JavaScript, moved to gitlab: https://gitlab.com/scion-scxml/scion
https://scion.scxml.io
Apache License 2.0
149 stars 29 forks source link

accessing application context from scxml #396

Closed Getafix-hub closed 6 years ago

Getafix-hub commented 6 years ago

Is is possible to send a websocket message from the scxml document. something like this:

`

`

Thanks

jbeard4 commented 6 years ago

Yes. You can make objects in the application context available in the state machine scripting context available through the hostContext argument in model.prepare. See here for an example: https://github.com/jbeard4/SCION/issues/393#issuecomment-376150331 Documentation is here: https://github.com/jbeard4/SCION#modelpreparefunctionerr-fnmodel--executioncontext-hostcontext