Run Microflow from JS

Hi all, i am trying to run Microflow within widget JS file: mx.processor.xasAction({ error : function() { logger.error( + "error: XAS error executing microflow"); }, actionname : 'GetStaffFromDepartmentsRota', guids : [givenObject.getGUID()], callback: dojo.hitch(this, this.test) }); Action name is name of microflow from mendix. My flow is allowed for all roles, but i always got NetworkError 560. Any idea, where can be problem? regards, Lukas
3 answers

You need to add the module in front of the microflow name.

Either way it's best to have the user set these in your widget properties, instead of hardcoding these in.

Try this in your xml:

<property key="buttonmf" type="microflow" required="true">
                <returnType type="Void"/>

That should give you a string with the correct microflow name the user selected, which you can use as the actionname


For returning lists in the xml:

<returnType type="Object" isList="true" entityProperty="entity"/>

And here is the beginning of a callback that can process the result set:

 processSearchResult : function(data) {
        var newitems = [];
        if (data.actionResult !== "") { //if we return empty in the MF, it will come in here as empty string...
            for(var i = 0; i < data.actionResult.length; i++)

Oki, I am trying to include it in the widget properties. But. What if my microflow return List of Objects? How can i change the return type?