Call Nanoflow in a javasript code

3
Hi, how can we call a nanoflow in a javascript?
asked
3 answers
5

Hi Sonam.

There are only two legal ways to call a nanoflow from Javascript.

  1. Create a Javascript Action document and and call it from another nanoflow. You can define a nanoflow parameter in your Javascript Action. In the generated javascript function the nanoflow will be passed to your code as a callback function that has its own parameter of the type “Object” and expects its members to be the nanoflow parameters
  2. Create a classic custom widget (not a pluggable widged) and add a Nanoflow property to it. When the widget is initialized the nanoflow configured in widget properties will be set to an opaque object that you can pass to the API mx.data.callNanoflow()

There’s no documented way to call a nanoflow by its name. It’s only available for microflows.

answered
3

export async function JS_ExecuteSyncInBackground(nanoflow, obj1, obj2, obj3) {

    // BEGIN USER CODE

    nanoflow({ParameterName1: obj1, ParameterName2: obj1, ParameterName3: obj3});

    // END USER CODE

}

answered
2

I used this solution and it works great.

https://mymendix.blogspot.com/2019/06/

 

enjoy

:)

answered