Call Microflow from Widget

1
I'm calling Microflow from widget, this microflow is just showing value from the passed object, the message it is always showing null, but the property has value. mx.processor.xasAction({ error : function() { }, actionname : this.callbackMF, guids : [this.dataobject.getGUID()], callback : dojo.hitch(this, function(output){ }) }); The (this.dataobject) has property called FileID, it has value, but from the Microflow it is null.
asked
1 answers
3

mx.processor.xasAction is deprecated a long time ago. It is better to use mx.ui.action to execute a microflow. By adding a breakpoint in the microflow and inspecting the variables, you would notice that the object is not passed to the microflow. That is because the applyto property is not defined. This would fix it for you:

mx.ui.action(this.callbackMF, {
    params: {
        guids: [this.dataobject.getGuid()],
        applyto: "selection"
    },
    callback: function(output) {
        console.log(out);
    }
}, this);

By passing 'this' as the third parameter, the error and callback handler are executed in this scope, so there is no need to use dojo.hitch. Note that MxObject.getGUID is also deprecated. (When using index-console.html, the deprecation messaged are printed to your console).

answered