How can we pass the entity object as a parameter to Microflow from an event of custom widget element ?

I have create a page & inside a dataview of that page provided SMS entity which have properties  fromNumberString String  toNumberString  String  messageBodyString String Also create the custom widget as per reference on website Following is code snippet for widget xml  <widget id="SendSMS.widget.SendSMS" needsEntityContext="true" xmlns="">     <name>SendSMS</name>     <description>The description of this widget.</description>     <icon />     <properties>         <property key="fromNumberString" type="attribute" >             <caption>From</caption>             <category>Appearance</category>             <description>Message send from.</description>             <attributeTypes>                 <attributeType name="String" />             </attributeTypes>         </property>         <property key="toNumberString" type="attribute" >             <caption>To</caption>             <category>Appearance</category>             <description>Message send to.</description>             <attributeTypes>                 <attributeType name="String" />             </attributeTypes>         </property>                  <property key="messageBodyString" type="attribute" >             <caption>Message Body</caption>             <category>Appearance</category>             <description>Message body .</description>             <attributeTypes>                 <attributeType name="String" />             </attributeTypes>         </property>                  <property key="mfToExecute" type="microflow" required="false" defaultValue="">             <caption>Microflow</caption>             <category>Behavior</category>             <description>The microflow to execute on click.</description>             <returnType type="Boolean" />         </property>    Also created html and edited dojo javascript file  On using custom widget I also provided microflow in behaviour section, now the microflow requires SMS Object as a parameter    In the dojo javascript how can I set the parameters as SMS entity and pass it to microflow .   Do I need to create the SMS object first before calling microflow ?   What is procedure for that ? I am able to log page values of html but not able to initialize SMS entity  I am able to use the custom widget on above created page but not able to pass entity to the microflow 
1 answers

Since you have set the property


then the widget must be placed inside a dataview as you noted above. When the widget is created on the page, it will call this function in your widget when the context object is available:

update(obj, callback)

In here: obj is your context object. If you look at the sample widget boilerplate here, you'll see that the context obj is stored as this._contextObj. Then see lines 136 and 141 for how the microflow is actually called with that context object as a parameter.