Take a look at other widgets to get directions.
Mainly two ways: if it is a presentation widget, bound to an attribute you can use the built in _getValueAttr and _setValueAttr functions.
if it is more complex:
The event microflow must be defined in the xml. Commit the objec in the microflow.
@Chris de Gelder many thnx
@Chris de Gelder sorry but can you show example in code how to use second way with microflow and object